Skip to content

Commit

Permalink
Use ptb's windowsize instead of matlab's in screen fields initializat…
Browse files Browse the repository at this point in the history
…ion.

Typo fix in the fixation generator doc.
  • Loading branch information
Genuster committed Jul 8, 2023
1 parent 71de437 commit 675702c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions +CFSVM/+Element/+Screen/CustomScreen.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
obj.background_color = kwargs.background_color;
obj.fields{1} = CFSVM.Element.Screen.ScreenField(kwargs.initial_rect);
if kwargs.is_stereo
set(0, 'units', 'pixels');
screen_size = get(0, 'ScreenSize');
[screen_width, ~] = Screen('WindowSize', max(Screen('Screens')));
second_rect = [ ...
screen_size(3) - kwargs.initial_rect(3), ...
screen_width - kwargs.initial_rect(3), ...
kwargs.initial_rect(2), ...
screen_size(3) - kwargs.initial_rect(1), ...
screen_width - kwargs.initial_rect(1), ...
kwargs.initial_rect(4)];

obj.fields{2} = CFSVM.Element.Screen.ScreenField(second_rect);
end
obj.shift = kwargs.shift;
Expand Down
2 changes: 1 addition & 1 deletion docs/fixation_generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import CFSVM.Generators.FixationGenerator
```

### Initialize the generator object
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.
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.

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).

Expand Down

0 comments on commit 675702c

Please sign in to comment.