Drifting grating spatial frequency and mask

Bram's Avatar

Bram

12 May, 2015 10:31 PM

Hi Chris,

I have two questions about the drifting gratings in MWorks:

- The spatial frequency of the gratings changes with the "width" parameter, but not with the "height" parameter. Could you explain why it changes this way?

- I would like to add a parameter that allows me to change the mask of the grating at runtime. So instead of hardcoding mask="Gaussian", I would like something like mask="gratingMask", where I can set gratingMask to e.g. "rectangle" during the experiment.
If I do it like this:
<variable tag="gratingMask" scope="global" logging="when_changed" default_value="gaussian" type="string" persistant="1"/>
, it gives an error. Can you tell me how to do this?

Thanks a lot,
Bram

  1. Support Staff 1 Posted by Christopher Sta... on 13 May, 2015 06:24 PM

    Christopher Stawarz's Avatar

    Hi Bram,

    The spatial frequency of the gratings changes with the "width" parameter, but not with the "height" parameter. Could you explain why it changes this way?

    I must be misunderstanding your question, as it doesn't appear to me that the width affects the spatial frequency at all (see attachment grating_width.xml). Can you send me an example experiment that demonstrates this behavior?

    I would like to add a parameter that allows me to change the mask of the grating at runtime.

    Currently, this is not possible, as the mask is fixed at experiment load time. One potential workaround is to use a list replicator to create multiple gratings that differ only in their mask, and then queue/dequeue them as needed. See attachment grating_masks.xml for a demonstration of this approach.

    Cheers,
    Chris

  2. 2 Posted by Bram-Ernst Verh... on 13 May, 2015 09:38 PM

    Bram-Ernst Verhoef's Avatar

    Hi Chris,

    I should have been more precise, the spatial frequency changes when the aspect ratio of the rectangle < 1, so that the height > width. See the attached experiment. Note also that, although I use x_size=9 for dg1 and dg2, the x_size of dg1 is larger in reality.

    Thanks for the list replicator suggestion, that’s a useful feature.

    Let me know what you think.
    Greetings,
    Bram

  3. Support Staff 3 Posted by Christopher Sta... on 14 May, 2015 06:15 PM

    Christopher Stawarz's Avatar

    Hi Bram,

    I should have been more precise, the spatial frequency changes when the aspect ratio of the rectangle < 1, so that the height > width.

    Thanks for the clarification. I see the issue now, and it is definitely a bug. I'll try to get a fix in to the nightly build soon.

    Cheers,
    Chris

  4. Support Staff 4 Posted by Christopher Sta... on 14 May, 2015 07:59 PM

    Christopher Stawarz's Avatar

    Hi Bram,

    The fix for the spatial frequency issue will be in tonight's nightly build.

    Cheers,
    Chris

  5. 5 Posted by Bram-Ernst Verh... on 14 May, 2015 10:13 PM

    Bram-Ernst Verhoef's Avatar

    Thanks!

  6. Christopher Stawarz closed this discussion on 15 May, 2015 01:30 PM.

  7. Bram-Ernst Verhoef re-opened this discussion on 20 May, 2015 09:59 PM

  8. 6 Posted by Bram-Ernst Verh... on 20 May, 2015 09:59 PM

    Bram-Ernst Verhoef's Avatar

    Hi Chris,

    Just did some quick tests. Everything seems to work fine. I will do more tests in the upcoming weeks.

    Thanks a lot,
    Bram

  9. Christopher Stawarz closed this discussion on 19 Jun, 2015 02:39 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac