Noise stimulus

Hi Lindsey,

The error message shows that MWorks is looking in the right place for the image file. Did you run the “Generate noise” protocol to create the noise images?

Chris

Yes- I used the same protocol to generate the noise images- the path for those images is set in the noise_stimulus.py file. I had included a screenshot of that in the previous email.
Lindsey.

Can you send me the MWEL and Python files you’re using?

Hi Chris,
Here are the two files.
I edited the .py file to add the fileName variable and targeted my folder structure. And I edited a bunch of stuff in the mwel, but the most relevant is that the presentation mode only starts once it has received inputs from our microscope (line 106)- so you will need to comment this to make it run.
Lindsey.

(attachments)

noise_stimulus.mwel (4.21 KB)
noise_stimulus.py (1.66 KB)

Hi Lindsey,

The files you sent work correctly for me.

One thing that you may not have noticed is that every time the experiment is loaded, the Python code creates a new subdirectory using the current date and time (whose name is stored in the variable sessiondir) and writes/reads images to/from this subdirectory. So if you generate noise images, then close and re-load the experiment, it’s not going to find any of the images you just created.

If you want to pre-generate the images and use them during multiple sessions, you should remove this data/time subdirectory. The easiest way to do this is to define sessiondir to be .:

sessiondir = '.'

Cheers,
Chris

Ah- that is definitely my problem.
I will try that.
Thanks,
Lindsey.

Hi Chris,
That was the issue- I can now replay the movies in a new MWorks session.
However, when presenting this way, it will only present as many frames as are hard-coded by the stimulus duration in the mwel. Is there any way around this, or do I need to edit the mwel according to the duration of the movie that I want?
Thanks,
Lindsey.

Hi Lindsey,

Because the variable noise_frames_per_trial is used in a range replicator, its value has to be known at load time. If you want to change the movie duration at run time, you could hard code the maximum number of frames per trial in the replicator, and then set the actual number of frames per trial to a smaller value. For example:

range_replicator (
    variable = rr_index
    from = 1
    to = 72000  // Max 20 minutes @ 60Hz
    step = 1
    ...

var noise_frames_per_trial = 36000  // 10 minutes @ 60Hz

Does that make sense?

Chris

Yes. Thanks!
Lindsey.