Millisecond Forums

Can Inquisite use equations to mathematically define the gray-scale values of visual stimuli?

https://forums.millisecond.com/Topic25035.aspx

By matthewsn@denison.edu - 5/29/2018

Can Inquisite use equations to mathematically define the gray-scale values of visual stimuli?
A related question is whether inquisite can use equations to define the motion (or other dynamic properties) of visual stimuli.
By Dave - 5/30/2018

matthewsn@denison.edu - Wednesday, May 30, 2018
Can Inquisite use equations to mathematically define the gray-scale values of visual stimuli?
A related question is whether inquisite can use equations to define the motion (or other dynamic properties) of visual stimuli.

Color of stimuli is determined by RGB values ranging from 0 to 255 in each color channel, and grey hues are what results when all three channels -- red, green, and blue -- are set to the same value. It is possible to set these values programmatically and dynamically. Here's an example that will change the color of a square from white to black across the entire range of grey values on a trial by trial basis:

<values>
/ channel = 256
</values>

<shape square>
/ shape = rectangle
/ size = (500px, 500px)
/ color = (values.channel, values.channel, values.channel)
/ erase = false
</shape>

<trial mytrial>
/ ontrialbegin = [
    values.channel -= 1;
]
/ stimulusframes = [1=square]
/ validresponse = (0)
/ trialduration = 20
</trial>

<block myblock>
/ trials = [1-256 = mytrial]
</block>

You can, of course, calculate the channel value via any kind of mathematical expression as long as the result is an integer in the range 0 to 255.

As for the movement of objects, that's trickier and depends on what exactly you want to do. Similar to the above example, you can of course manipulate an object's on-screen position mathematically on a trial by trial basis, resulting in a quasi-animation.

You can also use stimulus elements' /animation attribute https://www.millisecond.com/support/docs/v5/html/language/attributes/animation.htm to have an object move within a single trial, albeit your options are somewhat more limited here.

Hope this helps.
By matthewsn@denison.edu - 5/30/2018

Dave - Wednesday, May 30, 2018
matthewsn@denison.edu - Wednesday, May 30, 2018
Can Inquisite use equations to mathematically define the gray-scale values of visual stimuli?
A related question is whether inquisite can use equations to define the motion (or other dynamic properties) of visual stimuli.

Color of stimuli is determined by RGB values ranging from 0 to 255 in each color channel, and grey hues are what results when all three channels -- red, green, and blue -- are set to the same value. It is possible to set these values programmatically and dynamically. Here's an example that will change the color of a square from white to black across the entire range of grey values on a trial by trial basis:

<values>
/ channel = 256
</values>

<shape square>
/ shape = rectangle
/ size = (500px, 500px)
/ color = (values.channel, values.channel, values.channel)
/ erase = false
</shape>

<trial mytrial>
/ ontrialbegin = [
    values.channel -= 1;
]
/ stimulusframes = [1=square]
/ validresponse = (0)
/ trialduration = 20
</trial>

<block myblock>
/ trials = [1-256 = mytrial]
</block>

You can, of course, calculate the channel value via any kind of mathematical expression as long as the result is an integer in the range 0 to 255.

As for the movement of objects, that's trickier and depends on what exactly you want to do. Similar to the above example, you can of course manipulate an object's on-screen position mathematically on a trial by trial basis, resulting in a quasi-animation.

You can also use stimulus elements' /animation attribute https://www.millisecond.com/support/docs/v5/html/language/attributes/animation.htm to have an object move within a single trial, albeit your options are somewhat more limited here.

Hope this helps.

This is extremely helpful! Thank you!