Skip to content

Commit 675702c

Browse files
committed
Use ptb's windowsize instead of matlab's in screen fields initialization.
Typo fix in the fixation generator doc.
1 parent 71de437 commit 675702c

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

+CFSVM/+Element/+Screen/CustomScreen.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@
4444
obj.background_color = kwargs.background_color;
4545
obj.fields{1} = CFSVM.Element.Screen.ScreenField(kwargs.initial_rect);
4646
if kwargs.is_stereo
47-
set(0, 'units', 'pixels');
48-
screen_size = get(0, 'ScreenSize');
47+
[screen_width, ~] = Screen('WindowSize', max(Screen('Screens')));
4948
second_rect = [ ...
50-
screen_size(3) - kwargs.initial_rect(3), ...
49+
screen_width - kwargs.initial_rect(3), ...
5150
kwargs.initial_rect(2), ...
52-
screen_size(3) - kwargs.initial_rect(1), ...
51+
screen_width - kwargs.initial_rect(1), ...
5352
kwargs.initial_rect(4)];
53+
5454
obj.fields{2} = CFSVM.Element.Screen.ScreenField(second_rect);
5555
end
5656
obj.shift = kwargs.shift;

docs/fixation_generator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import CFSVM.Generators.FixationGenerator
1313
```
1414

1515
### Initialize the generator object
16-
The arguments of the object constructor are as follows: first, the path to the parent directory in which the `Fixation/` folder will be created. The generated fixation target will be saved inside this folder. Next, the **radius** argument describes the radius in pixels of the largest shape in the fixation, e.g., radius of the big circle in the "AB" shape or half-width of the cross in "AC" shape, the final image resolution will be (radius\*2+1, radius\*2+1).We suggest using a minimum of 128 pixels and resizing it later in the experiment code, instead of generating an image with low resolution.
16+
The arguments of the object constructor are as follows: first, the path to the parent directory in which the `Fixation/` folder will be created. The generated fixation target will be saved inside this folder. Next, the **radius** argument describes the radius in pixels of the largest shape in the fixation, e.g., radius of the big circle in the "AB" shape or half-width of the cross in "AC" shape, the final image resolution will be (radius\*2+1, radius\*2+1). We suggest using a minimum of 128 pixels and resizing it later in the experiment code, instead of generating an image with low resolution.
1717

1818
After that, the **hex_color** sets the color of the fixation target. If you'd like to smooth the edges of the image, set **is_smooth_edges** to `true` and **smoothing_cycles** to some positive integer (the greater the number, the smoother edges will be). You can also set **is_outline** to `true` to leave only outlines of the fixation (you will need an [installed](https://uk.mathworks.com/matlabcentral/answers/101885-how-do-i-install-additional-toolboxes-into-an-existing-installation-of-matlab#answer_111232) Image Processing Toolbox for outlining).
1919

0 commit comments

Comments
 (0)