[visionegg] Re: Control visionegg from Matlab

  • From: patrik andersson <andersson.j.p@xxxxxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Thu, 27 Aug 2009 14:26:09 +0200

Thank you alll for the replies and suggestions.
I will try it out.

To answer Mark regarding why not use Matlab for the stimulus, I have
done that so far but even though I am a big fan of Matlab the graphics
are not always fully efficient. I do real-time fMRI stuff which is
pretty computationally intensive and the graphics sometimes start to
get a bit wobbly.

Thanks again,
Patrik

2009/8/26 Andrew Straw <astraw@xxxxxxxxxxx>:
> patrik andersson wrote:
>> Hi all,
>>
>> I have just started looking at how to use visionegg (I normally write
>> everything in Matlab).
>> Having played around a bit and liking what I see I have a couple of
>> questions that I would be really grateful if someone could help
>> answering before I make the decision to switch.
>> 1. I will still use Matlab for a lot of other stuff, and will need to
>> change the stimuli depending on what comes out from Matlab.
>>     Is it possible to control the visionegg application from Matlab?
>> 2. Will this control be fast?
>> 3. Is there any problems with Vista compatibility? (I hate Vista but
>> am stuck with it)
>>
> Hi Patrik,
>
> The easiest way to control the VE is to simply start a new process with
> the VE script you wish to run. In python, this would be something like:
>
> import subprocess
> subprocess.check_call('python my_cool_visionegg_script.py')
>
> I know this is possible in MATLAB, I just don't remember the function
> name required.
>
> As far as anything more elaborate, you've got two broad categories of
> options 1) getting Python to run in your same MATLAB process using some
> sort of embedding with mex files or 2) using inter-process communication
> (IPC) to control Python. Approach 2 is bound to be much simpler, and
> there are numerous ways you could do it. The specific approach, speed of
> implementation and speed of execution depend a lot on what exactly you
> need to do -- so if you can provide more details, I'm happy to give more
> specific suggestions. Apparently TCP/IP networking is not built into
> base MATLAB (a shocking omission and correct me if I'm wrong). To use
> TCP in MATLAB, one needs the Industrial Control Toolbox or to download a
> 3rd party free toolbox. Regardless of this, using TCP in some way would
> probably be near the top of my list.
>
> I don't know of any reason why Vista wouldn't be compatible, but I
> haven't tested the VE with it, either. My understanding is that most
> Python stuff works fine.
>
> -Andrew
>
> --
> Andrew D. Straw, Ph.D.
> California Institute of Technology
> http://www.its.caltech.edu/~astraw/
>
> ======================================
> The Vision Egg mailing list
> Archives: //www.freelists.org/archives/visionegg
> Website: http://www.visionegg.org/mailinglist.html
>
=====================================The Vision Egg mailing list
Archives: //www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

Other related posts: