Set absolute stimuli size


Author
Message
lukasg
lukasg
Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)
Group: Forum Members
Posts: 35, Visits: 103
Hello all,

For my experiment it is important that stimuli are of the same exact size, irrespective of the screen they are being presented on. I am hesitant to set the canvas size to a particular value because it requires me to set a minimum screen size for eligible participants. Instead, I was hoping to set the size of my stimuli, as well as the distance between them. My attempt looks as follows:

<list t_x>
/ items = (display.getmmx(display.width/2, 1) - 10mm, display.getmmx(display.width/2, 1), display.getmmx(display.width/2, 1) + 10mm)
display.getmmx(pixels, monitor)
display.getmmx(pixels, monitor)
/ poolsize = 60
</list>

<text t>
/ items = targets
/ select = values.t
/ hposition = values.t_x
/ txcolor = values.t_color
/ erase = false
</text>



The above code is not doing as I intended (one letter position in the centre, one 10mm to the left, one 10mm to the right). How can I achieve this?

All the best,
Lukas
lukasg
lukasg
Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)
Group: Forum Members
Posts: 35, Visits: 103
/ hposition = 1px * (display.canvaswidth/2) - 10 * expressions.ratio_pxpermm
In search for a solution I came across previous entries on absolute stimuli sizes. However, I do not see how I can translate this to the present example. The recurring issue is that display.canvaswidth and others provide the total pixel width. Thus, the physical distance in cm will differ across screens?

e.g.:

/ hposition = 1px * (display.canvaswidth/2) - 10 * expressions.ratio_pxpermm


Instead, I would two letters to presented at a horizontal distance of 2cm, for instance.
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
lukasg - 1/31/2022
/ hposition = 1px * (display.canvaswidth/2) - 10 * expressions.ratio_pxpermm
In search for a solution I came across previous entries on absolute stimuli sizes. However, I do not see how I can translate this to the present example. The recurring issue is that display.canvaswidth and others provide the total pixel width. Thus, the physical distance in cm will differ across screens?

e.g.:

/ hposition = 1px * (display.canvaswidth/2) - 10 * expressions.ratio_pxpermm


Instead, I would two letters to presented at a horizontal distance of 2cm, for instance.

<block myblock>
/ onblockbegin = [
    values.c = 1mm*display.getmmx(display.width/2);
    values.l = values.c - 10mm;
    values.r = values.c + 10mm;
]

/ trials = [1 = mytrial]
</block>

<values>
/ c = 0
/ l = 0
/ r = 0
</values>


<trial mytrial>
/ stimulusframes = [1=center, left, right]
/ validresponse = (57)
</trial>

<text center>
/ items = ("0")
/ hposition = values.c
</text>

<text left>
/ items = ("-10")
/ hposition = values.l
</text>

<text right>
/ items = ("+10")
/ hposition = values.r
</text>

lukasg
lukasg
Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)
Group: Forum Members
Posts: 35, Visits: 103
Dave - 1/31/2022

<block myblock>
/ onblockbegin = [
    values.c = 1mm*display.getmmx(display.width/2);
    values.l = values.c - 10mm;
    values.r = values.c + 10mm;
]

/ trials = [1 = mytrial]
</block>

<values>
/ c = 0
/ l = 0
/ r = 0
</values>


<trial mytrial>
/ stimulusframes = [1=center, left, right]
/ validresponse = (57)
</trial>

<text center>
/ items = ("0")
/ hposition = values.c
</text>

<text left>
/ items = ("-10")
/ hposition = values.l
</text>

<text right>
/ items = ("+10")
/ hposition = values.r
</text>

Great, exactly what I was looking for. I do have a follow-up question. It appears the code takes the dimensions of my primary screen (laptop). As a result, the stimuli are shifted when presenting the experiment on an external monitor. Is there a way to ensure the mm dimensions are taken from the screen that the experiment is running on?

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
lukasg - 1/31/2022
Dave - 1/31/2022

<block myblock>
/ onblockbegin = [
    values.c = 1mm*display.getmmx(display.width/2);
    values.l = values.c - 10mm;
    values.r = values.c + 10mm;
]

/ trials = [1 = mytrial]
</block>

<values>
/ c = 0
/ l = 0
/ r = 0
</values>


<trial mytrial>
/ stimulusframes = [1=center, left, right]
/ validresponse = (57)
</trial>

<text center>
/ items = ("0")
/ hposition = values.c
</text>

<text left>
/ items = ("-10")
/ hposition = values.l
</text>

<text right>
/ items = ("+10")
/ hposition = values.r
</text>

Great, exactly what I was looking for. I do have a follow-up question. It appears the code takes the dimensions of my primary screen (laptop). As a result, the stimuli are shifted when presenting the experiment on an external monitor. Is there a way to ensure the mm dimensions are taken from the screen that the experiment is running on?

The getmmx() function allows you to specify the monitor.

https://www.millisecond.com/support/docs/v6/html/language/functions/getmmx.htm
lukasg
lukasg
Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)
Group: Forum Members
Posts: 35, Visits: 103
Dave - 1/31/2022
lukasg - 1/31/2022
Dave - 1/31/2022

<block myblock>
/ onblockbegin = [
    values.c = 1mm*display.getmmx(display.width/2);
    values.l = values.c - 10mm;
    values.r = values.c + 10mm;
]

/ trials = [1 = mytrial]
</block>

<values>
/ c = 0
/ l = 0
/ r = 0
</values>


<trial mytrial>
/ stimulusframes = [1=center, left, right]
/ validresponse = (57)
</trial>

<text center>
/ items = ("0")
/ hposition = values.c
</text>

<text left>
/ items = ("-10")
/ hposition = values.l
</text>

<text right>
/ items = ("+10")
/ hposition = values.r
</text>

Great, exactly what I was looking for. I do have a follow-up question. It appears the code takes the dimensions of my primary screen (laptop). As a result, the stimuli are shifted when presenting the experiment on an external monitor. Is there a way to ensure the mm dimensions are taken from the screen that the experiment is running on?

The getmmx() function allows you to specify the monitor.

https://www.millisecond.com/support/docs/v6/html/language/functions/getmmx.htm

But there is no way of selecting the screen the experiment is being presented on? This may be the 1st screen for some participants and the 2nd or 3rd for others?
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
lukasg - 1/31/2022
Dave - 1/31/2022
lukasg - 1/31/2022
Dave - 1/31/2022

<block myblock>
/ onblockbegin = [
    values.c = 1mm*display.getmmx(display.width/2);
    values.l = values.c - 10mm;
    values.r = values.c + 10mm;
]

/ trials = [1 = mytrial]
</block>

<values>
/ c = 0
/ l = 0
/ r = 0
</values>


<trial mytrial>
/ stimulusframes = [1=center, left, right]
/ validresponse = (57)
</trial>

<text center>
/ items = ("0")
/ hposition = values.c
</text>

<text left>
/ items = ("-10")
/ hposition = values.l
</text>

<text right>
/ items = ("+10")
/ hposition = values.r
</text>

Great, exactly what I was looking for. I do have a follow-up question. It appears the code takes the dimensions of my primary screen (laptop). As a result, the stimuli are shifted when presenting the experiment on an external monitor. Is there a way to ensure the mm dimensions are taken from the screen that the experiment is running on?

The getmmx() function allows you to specify the monitor.

https://www.millisecond.com/support/docs/v6/html/language/functions/getmmx.htm

But there is no way of selecting the screen the experiment is being presented on? This may be the 1st screen for some participants and the 2nd or 3rd for others?

The experiment will run on what the respective user has set as their primary display. That's the only safe and reasonable choice and most people will not have multiple displays attached.
lukasg
lukasg
Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)
Group: Forum Members
Posts: 35, Visits: 103

Dave - 1/31/2022
lukasg - 1/31/2022
/ hposition = 1px * (display.canvaswidth/2) - 10 * expressions.ratio_pxpermm
In search for a solution I came across previous entries on absolute stimuli sizes. However, I do not see how I can translate this to the present example. The recurring issue is that display.canvaswidth and others provide the total pixel width. Thus, the physical distance in cm will differ across screens?

e.g.:

/ hposition = 1px * (display.canvaswidth/2) - 10 * expressions.ratio_pxpermm


Instead, I would two letters to presented at a horizontal distance of 2cm, for instance.

<block myblock>
/ onblockbegin = [
    values.c = 1mm*display.getmmx(display.width/2);
    values.l = values.c - 10mm;
    values.r = values.c + 10mm;
]

/ trials = [1 = mytrial]
</block>

<values>
/ c = 0
/ l = 0
/ r = 0
</values>


<trial mytrial>
/ stimulusframes = [1=center, left, right]
/ validresponse = (57)
</trial>

<text center>
/ items = ("0")
/ hposition = values.c
</text>

<text left>
/ items = ("-10")
/ hposition = values.l
</text>

<text right>
/ items = ("+10")
/ hposition = values.r
</text>

Hello,

To obtain the physical center of the screen and place stimuli at a set distance (in mm) I have used the following code:

</values>
/ center = 0
/ left = 0
/ right = 0
</values>

<list t_x>
/ items = (values.center, values.left, values.right)
/ poolsize = 60
</list>

<list d_x>
/ items = (values.center, values.left, values.right)
/ selectionrate = always
/ not = (values.t_x)
</list>

<text t>
/ items = targets
/ select = values.t
/ hposition = values.t_x
/ txcolor = values.t_color
/ erase = false
/ fontstyle = ("Arial", 1.05cm, false, false, false, false, 5, 0)
</text>

<text d1>
/ items = distractors
/ select = values.d1
/ hposition = values.d1_x
/ txcolor = values.d1_color
/ erase = false
/ fontstyle = ("Arial", 1.05cm, false, false, false, false, 5, 0)
</text>

<text d2>
/ items = distractors
/ select = values.d2
/ hposition = values.d2_x
/ txcolor = values.d2_color
/ erase = false
/ fontstyle = ("Arial", 1.05cm, false, false, false, false, 5, 0)
</text>

<text dig1>
/ items = digits
/ select = values.dig1
/ hposition = values.center - 25mm
/ txcolor = black
/ erase = false
/ fontstyle = ("Arial", 1.05cm, false, false, false, false, 5, 0)
</text>

<text dig2>
/ items = digits
/ select = values.dig2
/ hposition = values.center + 25mm
/ txcolor = black
/ erase = false
/ fontstyle = ("Arial", 1.05cm, false, false, false, false, 5, 0)
</text>



/ onexptbegin = [
    defaults.finishpage = "INSERT PROLIFIC LINK";
    
//values.center = 1mm*display.getmmx(display.width/2);
    values.center = 1mm*display.getmmx(display.width/2,2);
values.left = values.center - 13mm;
values.right = values.center + 13mm;
]


While the rest of the experiment is displayed perfectly fine in the centre of the screen, the stimuli are displayed with an offset to the right - where do I go wrong?


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
lukasg - 2/15/2022

Dave - 1/31/2022
lukasg - 1/31/2022
/ hposition = 1px * (display.canvaswidth/2) - 10 * expressions.ratio_pxpermm
In search for a solution I came across previous entries on absolute stimuli sizes. However, I do not see how I can translate this to the present example. The recurring issue is that display.canvaswidth and others provide the total pixel width. Thus, the physical distance in cm will differ across screens?

e.g.:

/ hposition = 1px * (display.canvaswidth/2) - 10 * expressions.ratio_pxpermm


Instead, I would two letters to presented at a horizontal distance of 2cm, for instance.

<block myblock>
/ onblockbegin = [
    values.c = 1mm*display.getmmx(display.width/2);
    values.l = values.c - 10mm;
    values.r = values.c + 10mm;
]

/ trials = [1 = mytrial]
</block>

<values>
/ c = 0
/ l = 0
/ r = 0
</values>


<trial mytrial>
/ stimulusframes = [1=center, left, right]
/ validresponse = (57)
</trial>

<text center>
/ items = ("0")
/ hposition = values.c
</text>

<text left>
/ items = ("-10")
/ hposition = values.l
</text>

<text right>
/ items = ("+10")
/ hposition = values.r
</text>

Hello,

To obtain the physical center of the screen and place stimuli at a set distance (in mm) I have used the following code:

</values>
/ center = 0
/ left = 0
/ right = 0
</values>

<list t_x>
/ items = (values.center, values.left, values.right)
/ poolsize = 60
</list>

<list d_x>
/ items = (values.center, values.left, values.right)
/ selectionrate = always
/ not = (values.t_x)
</list>

<text t>
/ items = targets
/ select = values.t
/ hposition = values.t_x
/ txcolor = values.t_color
/ erase = false
/ fontstyle = ("Arial", 1.05cm, false, false, false, false, 5, 0)
</text>

<text d1>
/ items = distractors
/ select = values.d1
/ hposition = values.d1_x
/ txcolor = values.d1_color
/ erase = false
/ fontstyle = ("Arial", 1.05cm, false, false, false, false, 5, 0)
</text>

<text d2>
/ items = distractors
/ select = values.d2
/ hposition = values.d2_x
/ txcolor = values.d2_color
/ erase = false
/ fontstyle = ("Arial", 1.05cm, false, false, false, false, 5, 0)
</text>

<text dig1>
/ items = digits
/ select = values.dig1
/ hposition = values.center - 25mm
/ txcolor = black
/ erase = false
/ fontstyle = ("Arial", 1.05cm, false, false, false, false, 5, 0)
</text>

<text dig2>
/ items = digits
/ select = values.dig2
/ hposition = values.center + 25mm
/ txcolor = black
/ erase = false
/ fontstyle = ("Arial", 1.05cm, false, false, false, false, 5, 0)
</text>



/ onexptbegin = [
    defaults.finishpage = "INSERT PROLIFIC LINK";
    
//values.center = 1mm*display.getmmx(display.width/2);
    values.center = 1mm*display.getmmx(display.width/2,2);
values.left = values.center - 13mm;
values.right = values.center + 13mm;
]


While the rest of the experiment is displayed perfectly fine in the centre of the screen, the stimuli are displayed with an offset to the right - where do I go wrong?


It's not possible to say based on an incomplete code snippet. My guess would be you're wrong in using display.width, and ought to use display.canvaswidth.
lukasg
lukasg
Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)Partner Member (577 reputation)
Group: Forum Members
Posts: 35, Visits: 103
Dave - 2/15/2022

It's not possible to say based on an incomplete code snippet. My guess would be you're wrong in using display.width, and ought to use display.canvaswidth.

I have attached the entire script. Changing to canvaswidth did not resolve the issue.
Attachments
IC-Constant-Task.iqx (127 views, 25.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search