File Management with MWorks

Hi Chris,

I spoke to Arash and he said that you might have some ideas on this.

For the white noise, we’ve decided to generate a maximum number of images each day and name them by date/time, use as many as we can, and discard the images we don’t end up using that day.

For this, I see a couple possible options:

  1. Generate the images in an outside program, and load them as a stimulus group in the experiment. For this, it would be best if MWorks could use them in order with date/time names, so that we wouldn’t need to write extra code to then rename them. I already have a Matlab code written that generates white noise, and can either name them sequentially (1, 2, 3, 4, …etc) or with the date/time of generation.
    It would also be helpful in this case if there was some sort of marker to use to indicate the last image that was used (there may already be a way to do this, and I just missed it).

  2. If MWorks could generate images and save them appropriately, that would also be an option, so as not to have to use outside scripts. However, my understanding is that currently MWorks would not support this.

Thoughts?

Thank you,
Yvonne

Hi Yvonne,

You’re correct that MWorks itself cannot generate and save the noise images. As I’ve described elsewhere, you could invoke your MATLAB script from within MWorks (not directly, but via Python). However, if you want to pre-generate the images before the experiment runs, then there probably isn’t any reason to do this.

Regardless of when you generate the images, your MWorks experiment will still need to run some Python code (or MATLAB via Python) in order to handle the bookkeeping work: discovering filenames, keeping track of and archiving the images used, etc.

I’m going to send you a new version of your example experiment that generates the images at runtime via MATLAB. Although this isn’t exactly what you’re looking for, it demonstrates all the techniques you’ll need to use. The code may a bit beyond your comfort zone in terms of programming, but hopefully it will mostly make sense.

Chris