Millisecond Online Community

Bug with position command using decimals

rated by 0 users
This post has 7 Replies | 1 Follower

Top 10 Contributor
Posts 53
andy Posted: 02-28-2008 2:56 AM
Hi Sean,

I think that I just faced a problem using the position command with decimals.
I wanted to present a central fixation cross and two stimuli that are each 2.194% of the screen to the left and the right of the fixation cross.

left position:       "/ position = (47.806, 50)"
right position:     "/ position = (52.194, 50)"

Surprisingly the two stimuli had two different distances to central fixation cross (/ position = (50, 50)):
14 mm vs. 9 mm.

I played around a little and found that Inquisit doesn't look at the decimals at all. That means it treats 47.806 as 47 and 52.194 as 52 (the distances to central cross are the same).

Is that a bug, or is there a mistake in my script?

Best,

Andy


Top 10 Contributor
Posts 1,082

Hi Andy,

I verified that Inquisit is processing decimal values correctly for screen positions.

What screen resolution are you running at? I'm wondering if these fine grained distinctions are being lost simply because you are running at a relatively low screen resolution.  Ultimately, Inquisit must specify the pixel where the stimulus should appear, and the number of available pixels is finite and determined by the screen resolution. It's possible that at low resolutions, 47.806% and 47% would both fall within the region of the same pixel.

Let me know your resolution and I can test this hypothesis. If you don't think that's the problem, send your script to inquisit at millisecond dot com, and I'll test it out.

By the way, you should make sure you are running the latest release of 3.0.1.1.

-Sean

Top 10 Contributor
Posts 53
Hi Sean,

thanks for your answer. I don't think that my screen resolution is the problem. I am using an Eizo Flexscan 2201W (22inch) monitor at a resolution of 1680x1050.
I'll send you my script, because I still face that problem, even if I use only one decimal (e.g. 47.5% vs. 52.5%). Probabely you are able to find the mistake. Thanks in advance for all your efforts.

Best,

Andy

Top 10 Contributor
Posts 1,082

Andy,

Here's a test script that should help us narrow down the problem. If you run the "test" trial below with the Object Browser, you should see a four text stimuli, all presented at slightly different vertical positions. If the horizontal resolution of your screen is 1680, then the top two stimuli should be left-aligned with each other, and the bottom two should also be left aligned with each other. (If the horizontal resolution of your screen is not 1680, then the stimuli won't be aligned.)

Try it and let me know if it works.

<trial test>
/ stimulusframes = [1=showpositionpercent, showpositionpixels, showpositionpercentleft, showpositionpixelsleft]
/ response = anyresponse
</trial>

<text showpositionpercent>
/ items = ("position: <% text.showpositionpercent.hposition %>")
/ hposition = 877px
/ vposition = 49%
/ halign = left
</text>

<text showpositionpixels>
/ items = ("position: <% text.showpositionpixels.hposition %>")
/ hposition = 52.194%
/ vposition = 51%
/ halign = left
</text>

<text showpositionpercentleft>
/ items = ("position: <% text.showpositionpercentleft.hposition %>")
/ hposition = 803px
/ vposition = 52%
/ halign = left
</text>

<text showpositionpixelsleft>
/ items = ("position: <% text.showpositionpixelsleft.hposition %>")
/ hposition = 47.806%
/ vposition = 53%
/ halign = left
</text>

Top 10 Contributor
Posts 53
Hi Sean,

thank you for the test script. I tried it out and the positions of the stimuli 877px and 52.194pct as well as the positions of 803px and 47.806pct are left aligned with each other, just as you said (so the script works correctly). I sent you a picture of my screen showing the stimuli (using the "print screen" key) so that you can see what's happening on my screen.

Might it perhaps be a problem with the bitmap-stimuli themselves or is the "/position" command working differently for text and picture stimuli?

Best,

Andy
Top 10 Contributor
Posts 1,082

Andy,

I think I've figured out what is going on. Inquisit is positioning the stimuli as it is supposed to. The problem is that some your pictures have a width of 35px. Because that's an odd number, when you specify that the picture should be centered around a point, the right side will have 1px more than the other.

For example, the picture presented at 803px will extend from 786px to 821px, which leaves 17px to the left and 18px to the right. A picture presented at 877px will extend from 860px to 895px, which also leaves 17px to the left and 18px to the right. Effectively, the actual center points of the pictures are 1/2 pixel to the right of the specified center point.

To fix this, you can do one of the following:
1) Use pictures with even numbered pixel widths
2) Adjust the position of the right of center pictures leftward by 1 pixel.
3) The best option is to not position the pictures using /valign = center, which is the default setting. Instead, set /valign = right for the pictures presented left of center, and /valign = left for pictures presented right of center. That will cause the right and left edges of the pictures respectively to be located at the specified horizontal position. Using that method, you can more easily ensure that both pictures are equidistance from center.

-Sean 

Top 10 Contributor
Posts 53
Hi Sean,

good idea! Using the halign commands the way you tolf me, indeed changes the position of the stimuli,
but now they still are on different positions (now 16mm to the left and 11mm to the right of the fixation cross - compared to 14mm and 9mm in the original script).

I had another idea and tried out the the position commands "/ hposition = 803px" and "/ hposition = 877px" you used in your test script and interestingly now the distances are the same (12mm from the middle). Using this command is a good option for me, too.

Do you have an idea why these two commands have different effects?

Best,

Andy

Top 10 Contributor
Posts 1,082

Hmmm. The test script specified those positions both in terms of pixels and percentages, and if they produced the same result in the test script, I'm not sure why they would have produced different results in your script. I could be missing something here though.

 

 

Page 1 of 1 (8 items) | RSS
Powered by Community Server (Non-Commercial Edition), by Telligent Systems