Millisecond Forums

Control for different monitor sizes in inquisit web

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

By marlonz - 12/23/2020

Hi,
Due to covid and the labs being closed im forced to change to study we are conducting into an online study.
We are using a dot-probe paradigm and visual angle is very important to us.
The script and it's visual angles, are optimized for a 15,6" monitor.
A problem we face is that we can't control for monitor sizes, e.g. any participant might have a larger or smaller monitor than 15,6"

Is there an option to force the size of the task? So that all stimuli in the test will have the exact same dimensions as on a 15,6" monitor?
As an example.
On my 15,6" monitor the dot probe target and non-target stimuli have dimensions of 4,6cmx6,5cm with a distance of 2,2cm from fixation point to the edge of either picture. When my co-worker opens the task in inquisit web on their 23" monitor the dimensions of the images become much larger, as well as the distance from fixation point to the edge of a stimulus.

Kind regards,
Marlon
By Dave - 12/23/2020

marlonz - 12/23/2020
Hi,
Due to covid and the labs being closed im forced to change to study we are conducting into an online study.
We are using a dot-probe paradigm and visual angle is very important to us.
The script and it's visual angles, are optimized for a 15,6" monitor.
A problem we face is that we can't control for monitor sizes, e.g. any participant might have a larger or smaller monitor than 15,6"

Is there an option to force the size of the task? So that all stimuli in the test will have the exact same dimensions as on a 15,6" monitor?
As an example.
On my 15,6" monitor the dot probe target and non-target stimuli have dimensions of 4,6cmx6,5cm with a distance of 2,2cm from fixation point to the edge of either picture. When my co-worker opens the task in inquisit web on their 23" monitor the dimensions of the images become much larger, as well as the distance from fixation point to the edge of a stimulus.

Kind regards,
Marlon

You can set the screen area used by any given script per the <defaults> element's /canvassize and /canvasaspectratio.

https://www.millisecond.com/support/docs/v6/html/language/attributes/canvassize.htm
https://www.millisecond.com/support/docs/v6/html/language/attributes/canvasaspectratio.htm

Note that you can use physical dimensions in /canvassize if that is what you want / require. E.g.

/ canvassize = (345mm, 194mm)
/ canvasaspectratio = (16,9)

would be the physical dimensions of a typical 15.6'' monitor with a 16:9 aspect ratio.

Any devices with a display too small to run the task at the desired dimensions would obviously have to be excluded. This can be done per /onexptbegin logic. and using the <display> element's member functions:
https://www.millisecond.com/support/docs/v6/html/language/functions/getmmx.htm
https://www.millisecond.com/support/docs/v6/html/language/functions/getmmy.htm
By Dave - 12/23/2020

Dave - 12/23/2020
marlonz - 12/23/2020
Hi,
Due to covid and the labs being closed im forced to change to study we are conducting into an online study.
We are using a dot-probe paradigm and visual angle is very important to us.
The script and it's visual angles, are optimized for a 15,6" monitor.
A problem we face is that we can't control for monitor sizes, e.g. any participant might have a larger or smaller monitor than 15,6"

Is there an option to force the size of the task? So that all stimuli in the test will have the exact same dimensions as on a 15,6" monitor?
As an example.
On my 15,6" monitor the dot probe target and non-target stimuli have dimensions of 4,6cmx6,5cm with a distance of 2,2cm from fixation point to the edge of either picture. When my co-worker opens the task in inquisit web on their 23" monitor the dimensions of the images become much larger, as well as the distance from fixation point to the edge of a stimulus.

Kind regards,
Marlon

You can set the screen area used by any given script per the <defaults> element's /canvassize and /canvasaspectratio.

https://www.millisecond.com/support/docs/v6/html/language/attributes/canvassize.htm
https://www.millisecond.com/support/docs/v6/html/language/attributes/canvasaspectratio.htm

Note that you can use physical dimensions in /canvassize if that is what you want / require. E.g.

/ canvassize = (345mm, 194mm)
/ canvasaspectratio = (16,9)

would be the physical dimensions of a typical 15.6'' monitor with a 16:9 aspect ratio.

Any devices with a display too small to run the task at the desired dimensions would obviously have to be excluded. This can be done per /onexptbegin logic. and using the <display> element's member functions:
https://www.millisecond.com/support/docs/v6/html/language/functions/getmmx.htm
https://www.millisecond.com/support/docs/v6/html/language/functions/getmmy.htm

Adding: If you're not worried about stimuli's physical dimensions, but merely wish to ensure that their *relative* sizes and positions are consistent across different displays, define all sizes and positions in percentages and define a uniform /canvasaspectratio.
By marlonz - 12/23/2020

I've tried experimenting with the two element's you provided. Unfortunately this does not seem to solve the problem i'm running into.
If i understand the canvas elements correctly they will change the canvas size / aspect ratio relative to the user's monitor of the task.

Im trying to achieve that different screen sizes and resolutions have no influence on the physical dimensions of a stimulus. For example, currently i am using my 15,6" monitor, the dimensions of the stimuli are 6,5cm (width) x 4,6cm (height). If i would now connect my pc to for example a screen of 23" and i would open the task, i would need the stimuli to again be 6,5cm x 4,6cm.

Thank you for your help
By Dave - 12/23/2020

marlonz - 12/23/2020
I've tried experimenting with the two element's you provided. Unfortunately this does not seem to solve the problem i'm running into.
If i understand the canvas elements correctly they will change the canvas size / aspect ratio relative to the user's monitor of the task.

Im trying to achieve that different screen sizes and resolutions have no influence on the physical dimensions of a stimulus. For example, currently i am using my 15,6" monitor, the dimensions of the stimuli are 6,5cm (width) x 4,6cm (height). If i would now connect my pc to for example a screen of 23" and i would open the task, i would need the stimuli to again be 6,5cm x 4,6cm.

Thank you for your help

> If i understand the canvas elements correctly they will change the canvas size / aspect ratio relative to the user's monitor of the task.

No. You can define a physical canvassize as explained in my response. I.e. on a 23'' monitor, the task would then only use a physical area equivalent to that of a 15.6'' display.

You can, of course, define your stimuli's sizes in physical dimensions as well.

<shape example>
/ shape = rectangle
/ size = (100mm, 20mm)
/ color = red
</shape>

will be 10cm width and 2cm height on any display.
By Dave - 12/23/2020

Dave - 12/23/2020
marlonz - 12/23/2020
I've tried experimenting with the two element's you provided. Unfortunately this does not seem to solve the problem i'm running into.
If i understand the canvas elements correctly they will change the canvas size / aspect ratio relative to the user's monitor of the task.

Im trying to achieve that different screen sizes and resolutions have no influence on the physical dimensions of a stimulus. For example, currently i am using my 15,6" monitor, the dimensions of the stimuli are 6,5cm (width) x 4,6cm (height). If i would now connect my pc to for example a screen of 23" and i would open the task, i would need the stimuli to again be 6,5cm x 4,6cm.

Thank you for your help

> If i understand the canvas elements correctly they will change the canvas size / aspect ratio relative to the user's monitor of the task.

No. You can define a physical canvassize as explained in my response. I.e. on a 23'' monitor, the task would then only use a physical area equivalent to that of a 15.6'' display.

You can, of course, define your stimuli's sizes in physical dimensions as well.

<shape example>
/ shape = rectangle
/ size = (100mm, 20mm)
/ color = red
</shape>

will be 10cm width and 2cm height on any display.

Similarly,

<shape center>
/ shape = rectangle
/ size = (25mm, 25mm)
/ color = blue
/ position = (50%, 50%)
</shape>

<shape left>
/ shape = rectangle
/ size = (60mm, 60mm)
/ color = green
/ hposition = display.getmmx(display.width/2, 1) - 50mm
/ vposition = 50%
</shape>

<shape right>
/ shape = rectangle
/ size = (60mm, 60mm)
/ color = red
/ hposition = display.getmmx(display.width/2, 1) + 50mm
/ vposition = 50%
</shape>

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

will have the exact same physical dimensions and distances between the three shapes on any display.
By marlonz - 12/25/2020

Thank you for your help! The picture sizes are now consistent on different sizes of monitors.
the problem I ran into with the canvas functions is the following. I tried to run the task on my laptop (15,6" screen) and my TV (43"). The dimensions on the TV were  disturbed (everything was incredibly small).
However, when i connected my laptop to my old PC monitor (21" screen) the stimuli were indeed the exact same size, so again thank you for the help.

Unfortunately the canvas function doesn't seem to include the positioning of the stimuli? I think this is due to the <parameters> being defined in percentages, but even when i tried to define it in mm there were still differences in positioning of the stimuli presentation. I tried to use the function you described above "/ hposition = display.getmmx(display.width/2, 1) + 50mm" and "... - 50mm" and experiment with it, but unfortunately didn't get a consist positioning result. 

The position for practice trials in my script is defined as

<parameters> 
/ target_left_x = 29.0%
/ target_right_x = 71.1%
</parameters> 

<picture PracticeTarget>
/ items = PracticeTargets
/ select = noreplace
/ hposition = values.Target_x
/ vposition = parameters.target_y
/ size = (65mm, 46mm)
</picture>

<picture PracticeComp>
/ items = PracticeComps
/ select = picture.PracticeTarget.currentitemnumber
/ hposition = values.Comp_x
/ vposition = parameters.target_y
/ size = (65mm, 46mm)
</picture>

I looked at the script you posted above and tried to use it to define my stimulus positions, but unfortunately with no succes. 
With the "/ hposition = values.Target_x and / hposition = values.Comp_x" ultimately depending on the <parameters> section i posted above.

So my question is, how can i get the stimuli position consistent on different sized monitors?
By Dave - 12/25/2020

marlonz - 12/25/2020
Thank you for your help! The picture sizes are now consistent on different sizes of monitors.
the problem I ran into with the canvas functions is the following. I tried to run the task on my laptop (15,6" screen) and my TV (43"). The dimensions on the TV were  disturbed (everything was incredibly small).
However, when i connected my laptop to my old PC monitor (21" screen) the stimuli were indeed the exact same size, so again thank you for the help.

Unfortunately the canvas function doesn't seem to include the positioning of the stimuli? I think this is due to the <parameters> being defined in percentages, but even when i tried to define it in mm there were still differences in positioning of the stimuli presentation. I tried to use the function you described above "/ hposition = display.getmmx(display.width/2, 1) + 50mm" and "... - 50mm" and experiment with it, but unfortunately didn't get a consist positioning result. 

The position for practice trials in my script is defined as

<parameters> 
/ target_left_x = 29.0%
/ target_right_x = 71.1%
</parameters> 

<picture PracticeTarget>
/ items = PracticeTargets
/ select = noreplace
/ hposition = values.Target_x
/ vposition = parameters.target_y
/ size = (65mm, 46mm)
</picture>

<picture PracticeComp>
/ items = PracticeComps
/ select = picture.PracticeTarget.currentitemnumber
/ hposition = values.Comp_x
/ vposition = parameters.target_y
/ size = (65mm, 46mm)
</picture>

I looked at the script you posted above and tried to use it to define my stimulus positions, but unfortunately with no succes. 
With the "/ hposition = values.Target_x and / hposition = values.Comp_x" ultimately depending on the <parameters> section i posted above.

So my question is, how can i get the stimuli position consistent on different sized monitors?

> Unfortunately the canvas function doesn't seem to include the positioning of the stimuli?

If you define positions in percentages, the stimuli will be positioned relative to the defined canvas size.

> "/ hposition = display.getmmx(display.width/2, 1) + 50mm" and "... - 50mm" and experiment with it, but unfortunately didn't get a consist positioning result.

If you defined a canvas, you ought to use display.canvaswidth and display.canvasheight.
By marlonz - 12/25/2020

While the distance between the stimuli is consistent (4,4cm), their positioning still seems to be shifted towards the left on my 21" monitor

I defined the canvas according to the dimensions of my laptop screen (in inches)
/ canvasaspectratio = (13, 8)

The position of the stimuli is defined as
/ target_left_x = display.getmmx(display.canvaswidth/2, 1) - 68.5mm
/ target_right_x = display.getmmx(display.canvaswidth/2, 1) + 38.8mm

The same problem occured when i defined the positions in percentages
could you point out to where i'm getting stuck on the positioning?

I added the script I'm using as an attachment in case it's needed to see where I make the mistake
Note, so far i'm only working on my practice trial stimuli
By Dave - 12/25/2020

marlonz - 12/25/2020
While the distance between the stimuli is consistent (4,4cm), their positioning still seems to be shifted towards the left on my 21" monitor

I defined the canvas according to the dimensions of my laptop screen (in inches)
/ canvasaspectratio = (13, 8)

The position of the stimuli is defined as
/ target_left_x = display.getmmx(display.canvaswidth/2, 1) - 68.5mm
/ target_right_x = display.getmmx(display.canvaswidth/2, 1) + 38.8mm

The same problem occured when i defined the positions in percentages
could you point out to where i'm getting stuck on the positioning?

I added the script I'm using as an attachment in case it's needed to see where I make the mistake
Note, so far i'm only working on my practice trial stimuli

Is the 21'' monitor connected to your laptop as a secondary display or is this an entirely different system?

If the former, you're using the getmmx function wrong. It requires you to specify the monitor and you're calculating distances based on the primary monitor, which would be the laptop's built-in 15.6'' display.

Further, sharing a script isn't terribly useful if you don't also share all files the respective script requires to run.
By Dave - 12/25/2020

Dave - 12/25/2020
marlonz - 12/25/2020
While the distance between the stimuli is consistent (4,4cm), their positioning still seems to be shifted towards the left on my 21" monitor

I defined the canvas according to the dimensions of my laptop screen (in inches)
/ canvasaspectratio = (13, 8)

The position of the stimuli is defined as
/ target_left_x = display.getmmx(display.canvaswidth/2, 1) - 68.5mm
/ target_right_x = display.getmmx(display.canvaswidth/2, 1) + 38.8mm

The same problem occured when i defined the positions in percentages
could you point out to where i'm getting stuck on the positioning?

I added the script I'm using as an attachment in case it's needed to see where I make the mistake
Note, so far i'm only working on my practice trial stimuli

Is the 21'' monitor connected to your laptop as a secondary display or is this an entirely different system?

If the former, you're using the getmmx function wrong. It requires you to specify the monitor and you're calculating distances based on the primary monitor, which would be the laptop's built-in 15.6'' display.

Further, sharing a script isn't terribly useful if you don't also share all files the respective script requires to run.

One more thing: It's best to set the parameters /onexptbegin. Otherwise, it's possible that the exact canvassize is not yet known at the time the <parameters> element is parsed and the parameters take on their respective values.

<shape center>
/ shape = rectangle
/ size = (25mm, 25mm)
/ color = blue
/ position = (50%, 50%)
</shape>

<shape left>
/ shape = rectangle
/ size = (60mm, 60mm)
/ color = green
/ hposition = parameters.left_x
/ vposition = 50%
</shape>

<shape right>
/ shape = rectangle
/ size = (60mm, 60mm)
/ color = red
/ hposition = parameters.right_x
/ vposition = 50%
</shape>

<shape linetop>
/ shape = rectangle
/ size = (160mm, 1mm)
/ hposition = 50%
/ vposition = parameters.top_y
</shape>

<text 16cm>
/ items = ("16cm")
/ hposition = 50%
/ vposition = parameters.top_y
/ txbgcolor = transparent
/ txcolor = magenta
</text>

<shape linebottom>
/ shape = rectangle
/ size = (40mm, 1mm)
/ hposition = 50%
/ vposition = parameters.bottom_y
</shape>

<text 4cm>
/ items = ("4cm")
/ hposition = 50%
/ vposition = parameters.bottom_y
/ txbgcolor = transparent
/ txcolor = magenta
</text>

<shape linecenter>
/ shape = rectangle
/ size = (100mm, 1mm)
/ hposition = 50%
/ vposition = 50%
</shape>

<text 10cm>
/ items = ("10cm")
/ hposition = 50%
/ vposition = 50%
/ txbgcolor = transparent
/ txcolor = magenta
</text>

<trial mytrial>
/ stimulusframes = [1=left, center, right, linetop, linecenter, linebottom, 16cm, 10cm, 4cm]
/ validresponse = (57)
</trial>

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

<expt>
/ onexptbegin = [
    parameters.left_x = display.getmmx(display.canvaswidth/2, 1) - 50mm;
    parameters.right_x = display.getmmx(display.canvaswidth/2, 1) + 50mm;
    parameters.top_y = display.getmmy(display.canvasheight/2, 1) - 30mm;
    parameters.bottom_y = display.getmmy(display.canvasheight/2, 1) + 30mm;
]
/ blocks = [1=myblock]
</expt>

<defaults>
/ canvasaspectratio = (13,8)
/ screencolor = grey
</defaults>

<parameters>
/ left_x = 0
/ right_x = 0
/ top_y = 0
/ bottom_y = 0
</parameters>


Beyond that, I don't know how to make this any clearer, I'm afraid.
By marlonz - 12/27/2020

Thank you for your help, /onexptbegin has solved the issue!
By ylyl27 - 10/26/2022

Dave - 12/23/2020
marlonz - 12/23/2020
I've tried experimenting with the two element's you provided. Unfortunately this does not seem to solve the problem i'm running into.
If i understand the canvas elements correctly they will change the canvas size / aspect ratio relative to the user's monitor of the task.

Im trying to achieve that different screen sizes and resolutions have no influence on the physical dimensions of a stimulus. For example, currently i am using my 15,6" monitor, the dimensions of the stimuli are 6,5cm (width) x 4,6cm (height). If i would now connect my pc to for example a screen of 23" and i would open the task, i would need the stimuli to again be 6,5cm x 4,6cm.

Thank you for your help

> If i understand the canvas elements correctly they will change the canvas size / aspect ratio relative to the user's monitor of the task.

No. You can define a physical canvassize as explained in my response. I.e. on a 23'' monitor, the task would then only use a physical area equivalent to that of a 15.6'' display.

You can, of course, define your stimuli's sizes in physical dimensions as well.

<shape example>
/ shape = rectangle
/ size = (100mm, 20mm)
/ color = red
</shape>

will be 10cm width and 2cm height on any display.

Hi! I have a similar problem. I want to present some pictures (see below for an example) to participants. When I set the height and width of the picture as 28.8cm, the diameter of the circle was 18cm, which is what I wanted. When I ran the program on my laptop (13.3-inch), everything was correct, and the diameter of the circle was 18cm. But when I ran it with a 27'' monitor, the diameter became 17.5cm. And when I ran it with a 29'' ultrawide monitor, the diameter was 15.4cm. I don't know why the size is different on different monitors. Could you help with this? Thanks!!

I'm using Inquisit 5, and here is my script:
<picture pic>
/ items = pic
/ position = (50%,50%)
/ size = (28.8cm,28.8cm)
/ select = values.picindex
</picture>


By Dave - 10/26/2022

ylyl27 - 10/26/2022
Dave - 12/23/2020
marlonz - 12/23/2020
I've tried experimenting with the two element's you provided. Unfortunately this does not seem to solve the problem i'm running into.
If i understand the canvas elements correctly they will change the canvas size / aspect ratio relative to the user's monitor of the task.

Im trying to achieve that different screen sizes and resolutions have no influence on the physical dimensions of a stimulus. For example, currently i am using my 15,6" monitor, the dimensions of the stimuli are 6,5cm (width) x 4,6cm (height). If i would now connect my pc to for example a screen of 23" and i would open the task, i would need the stimuli to again be 6,5cm x 4,6cm.

Thank you for your help

> If i understand the canvas elements correctly they will change the canvas size / aspect ratio relative to the user's monitor of the task.

No. You can define a physical canvassize as explained in my response. I.e. on a 23'' monitor, the task would then only use a physical area equivalent to that of a 15.6'' display.

You can, of course, define your stimuli's sizes in physical dimensions as well.

<shape example>
/ shape = rectangle
/ size = (100mm, 20mm)
/ color = red
</shape>

will be 10cm width and 2cm height on any display.

Hi! I have a similar problem. I want to present some pictures (see below for an example) to participants. When I set the height and width of the picture as 28.8cm, the diameter of the circle was 18cm, which is what I wanted. When I ran the program on my laptop (13.3-inch), everything was correct, and the diameter of the circle was 18cm. But when I ran it with a 27'' monitor, the diameter became 17.5cm. And when I ran it with a 29'' ultrawide monitor, the diameter was 15.4cm. I don't know why the size is different on different monitors. Could you help with this? Thanks!!

I'm using Inquisit 5, and here is my script:
<picture pic>
/ items = pic
/ position = (50%,50%)
/ size = (28.8cm,28.8cm)
/ select = values.picindex
</picture>



> When I ran the program on my laptop (13.3-inch), everything was correct, and the diameter of the circle was 18cm.
> But when I ran it with a 27'' monitor, the diameter became 17.5cm.
> And when I ran it with a 29'' ultrawide monitor, the diameter was 15.4cm. I don't know why the size is different on different monitors. [...]

If you need exact physical dimensions under Inquisit 5 or below, you will need to have your participants go through a calibration procedure. See e.g. https://forums.millisecond.com/Topic21340.aspx

There are a number of factors that can throw off the calculations based on the monitor's reported PPI (pixels per inch) otherwise, such as the display running at a non-native resolution or various tricks used by some very high-definiton displays (where multiple physical pixels together form one logical pixel).

In the future, please post questions pertaining to Inquisit 5 in the Inquisit 5 section of the forums to avoid confusion: https://forums.millisecond.com/Forum101.aspx
By ylyl27 - 10/26/2022

Thank you for the reply!