I am trying to use the Screen('fillOval'...) function to display a series of ovals one at a time, whose "rect" argument coordinates are contained within the columns of a matrix MyOvals. I can successfully display any set of two or more of the ovals from MyOvals simultaneously by referencing a range of two or more columns, but when I try to reference a single column from MyOvals I get an error.
I have been through the provided documentation for the fillOval function in MATLAB and on the Psychtoolbox wiki and as far as I can tell I am following the prescribed format for input arguments. I have searched the web and this forum for issues related to use of the fillOval function and have found nothing useful.
In the code I have tried using different values of my index "i", I have tried referencing a transposed version of MyOvals, I have tried "MyOvals" as a cell array, both with cells of one or all four of the coordinate values for the "rect" argument and referenced using either { } or ( ), and I have tried assigning MyOvals(:,i) to a seperate variable and passing that variable as the "rect" argument, all to the same effect. The only thing that doesn't produce this error is using a matrix for MyOvals (as opposed to a cell array) and referencing a range of at least two ovals. It works with two or more ovals at once, but returns the error below whenever referencing a single column in MyOvals.
Below the dashed line is a simplified verision of my code, followed by what is produced in the command window when I run (Note: only the messages at the bottom below the "i = 1" line are unusual for my setup). When I try to run, I see the white "Welcome to psychtoolbox" screen, followed by the "!" in a triangle on red background that I believe is part of the Sync Test, as per normal, and then the screen flashes back to the desktop. The details of my setup appear at the bottom of the post. I am at my wit's end as to how to address this issue and display my ovals one at a time, so any assistance anyone can offer to point me in the right direction would be much appreciated. Thanks.
~ Christopher
My code:
----------------------------------------------------------
BG_COLOR = [128 128 128];
HIGH_COLOR = [255 255 255];
MyOvals = [390 378 416 353 440;
257 361 160 354 169;
429 416 454 391 478;
118 322 122 316 131];
screen = max(Screen('Screens'));
[windowPtr, rect] = Screen('OpenWindow',screen, BG_COLOR);
% I would like to be able to use a loop to iterate across columns in
% "ovals", (by stepping through values of "i") but I get an error
% whenever I reference any less than two columns in "ovals" at a time
i = 1
Screen('FillOval', windowPtr, HIGH_COLOR, MyOvals(:,i), 256);
% It works just fine if the line above is replaced by the line below:
% Screen('FillOval', windowPtr, HIGH_COLOR, MyOvals(:,i:2), 256);
Screen('Flip',windowPtr);
Resulting Command Window Messages:
----------------------------------------------------------
PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab (Version 3.0.9 - Build date: Apr 2 2012).
PTB-INFO: Type 'PsychtoolboxVersion' for more detailed version information.
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with
PTB-INFO: some restrictions. See file 'License.txt' in the Psychtoolbox root folder for the exact licensing conditions.
PTB-INFO: Will disable DWM because a regular fullscreen onscreen window is opened -> We want best timing and performance.
PTB-WARNING: PsychOSOpenOnscreenWindow: Failed to change state of Windows desktop compositor! Expect timing or performance problems!!
PTB-INFO: The detected endline of the vertical blank interval is equal or lower than the startline. This indicates
PTB-INFO: that i couldn't detect the duration of the vertical blank interval and won't be able to correct timestamps
PTB-INFO: for it. This will introduce a very small and constant offset (typically << 1 msec). Read 'help BeampositionQueries'
PTB-INFO: for how to correct this, should you really require that last few microseconds of precision.
PTB-INFO: Btw. this can also mean that your systems beamposition queries are slightly broken. It may help timing precision to
PTB-INFO: enable the beamposition workaround, as explained in 'help ConserveVRAM', section 'kPsychUseBeampositionQueryWorkaround'.
PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: Quadro FX 5800/PCI/SSE2 :: 3.3.0
PTB-INFO: VBL startline = 2400 , VBL Endline = 2399
PTB-INFO: Measured monitor refresh interval from beamposition = 31.627990 ms [31.617564 Hz].
PTB-INFO: Will use beamposition query for accurate Flip time stamping.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.661366 ms [60.019088 Hz]. (50 valid samples taken, stddev=0.053831 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.666667 ms [60.000000 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.
WARNING: Mismatch between measured monitor refresh intervals! This indicates problems with rasterbeam position queries.
----- ! PTB - WARNING: SYNCHRONIZATION TROUBLE ! ----
One or more internal checks (see Warnings above) indicate that
queries of rasterbeam position are not properly working for your setup.
Psychtoolbox will work around this by using a different timing algorithm,
but it will cause Screen('Flip') to report less accurate/robust timestamps
for stimulus timing.
Read 'help BeampositionQueries' for more info and troubleshooting tips.
PTB-INFO: Support for fast OffscreenWindows enabled.
i =
1
Error in function FillOval: Invalid Rect Argument
impossible rect values given
PTB-WARNING: PsychOSCloseWindow: Failed to reenable DWM Aero Windows desktop compositor!
??? Error using ==> Screen
Usage:
Screen('FillOval', windowPtr [,color] [,rect] [,perfectUpToMaxDiameter]);
My Setup:
Dell Precision T7500 running Windows 7 Professional 64-bit
MATLAB Version 7.10.0.499 (R2010a)
32-bit (win32)
Psychtoolbox Version 3.0.9 12 April 2011
I have been through the provided documentation for the fillOval function in MATLAB and on the Psychtoolbox wiki and as far as I can tell I am following the prescribed format for input arguments. I have searched the web and this forum for issues related to use of the fillOval function and have found nothing useful.
In the code I have tried using different values of my index "i", I have tried referencing a transposed version of MyOvals, I have tried "MyOvals" as a cell array, both with cells of one or all four of the coordinate values for the "rect" argument and referenced using either { } or ( ), and I have tried assigning MyOvals(:,i) to a seperate variable and passing that variable as the "rect" argument, all to the same effect. The only thing that doesn't produce this error is using a matrix for MyOvals (as opposed to a cell array) and referencing a range of at least two ovals. It works with two or more ovals at once, but returns the error below whenever referencing a single column in MyOvals.
Below the dashed line is a simplified verision of my code, followed by what is produced in the command window when I run (Note: only the messages at the bottom below the "i = 1" line are unusual for my setup). When I try to run, I see the white "Welcome to psychtoolbox" screen, followed by the "!" in a triangle on red background that I believe is part of the Sync Test, as per normal, and then the screen flashes back to the desktop. The details of my setup appear at the bottom of the post. I am at my wit's end as to how to address this issue and display my ovals one at a time, so any assistance anyone can offer to point me in the right direction would be much appreciated. Thanks.
~ Christopher
My code:
----------------------------------------------------------
BG_COLOR = [128 128 128];
HIGH_COLOR = [255 255 255];
MyOvals = [390 378 416 353 440;
257 361 160 354 169;
429 416 454 391 478;
118 322 122 316 131];
screen = max(Screen('Screens'));
[windowPtr, rect] = Screen('OpenWindow',screen, BG_COLOR);
% I would like to be able to use a loop to iterate across columns in
% "ovals", (by stepping through values of "i") but I get an error
% whenever I reference any less than two columns in "ovals" at a time
i = 1
Screen('FillOval', windowPtr, HIGH_COLOR, MyOvals(:,i), 256);
% It works just fine if the line above is replaced by the line below:
% Screen('FillOval', windowPtr, HIGH_COLOR, MyOvals(:,i:2), 256);
Screen('Flip',windowPtr);
Resulting Command Window Messages:
----------------------------------------------------------
PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab (Version 3.0.9 - Build date: Apr 2 2012).
PTB-INFO: Type 'PsychtoolboxVersion' for more detailed version information.
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with
PTB-INFO: some restrictions. See file 'License.txt' in the Psychtoolbox root folder for the exact licensing conditions.
PTB-INFO: Will disable DWM because a regular fullscreen onscreen window is opened -> We want best timing and performance.
PTB-WARNING: PsychOSOpenOnscreenWindow: Failed to change state of Windows desktop compositor! Expect timing or performance problems!!
PTB-INFO: The detected endline of the vertical blank interval is equal or lower than the startline. This indicates
PTB-INFO: that i couldn't detect the duration of the vertical blank interval and won't be able to correct timestamps
PTB-INFO: for it. This will introduce a very small and constant offset (typically << 1 msec). Read 'help BeampositionQueries'
PTB-INFO: for how to correct this, should you really require that last few microseconds of precision.
PTB-INFO: Btw. this can also mean that your systems beamposition queries are slightly broken. It may help timing precision to
PTB-INFO: enable the beamposition workaround, as explained in 'help ConserveVRAM', section 'kPsychUseBeampositionQueryWorkaround'.
PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: Quadro FX 5800/PCI/SSE2 :: 3.3.0
PTB-INFO: VBL startline = 2400 , VBL Endline = 2399
PTB-INFO: Measured monitor refresh interval from beamposition = 31.627990 ms [31.617564 Hz].
PTB-INFO: Will use beamposition query for accurate Flip time stamping.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.661366 ms [60.019088 Hz]. (50 valid samples taken, stddev=0.053831 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.666667 ms [60.000000 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.
WARNING: Mismatch between measured monitor refresh intervals! This indicates problems with rasterbeam position queries.
----- ! PTB - WARNING: SYNCHRONIZATION TROUBLE ! ----
One or more internal checks (see Warnings above) indicate that
queries of rasterbeam position are not properly working for your setup.
Psychtoolbox will work around this by using a different timing algorithm,
but it will cause Screen('Flip') to report less accurate/robust timestamps
for stimulus timing.
Read 'help BeampositionQueries' for more info and troubleshooting tips.
PTB-INFO: Support for fast OffscreenWindows enabled.
i =
1
Error in function FillOval: Invalid Rect Argument
impossible rect values given
PTB-WARNING: PsychOSCloseWindow: Failed to reenable DWM Aero Windows desktop compositor!
??? Error using ==> Screen
Usage:
Screen('FillOval', windowPtr [,color] [,rect] [,perfectUpToMaxDiameter]);
>>-------------------------------------------------------
My Setup:
Dell Precision T7500 running Windows 7 Professional 64-bit
MATLAB Version 7.10.0.499 (R2010a)
32-bit (win32)
Psychtoolbox Version 3.0.9 12 April 2011