|
12 | 12 | checker_length=30, ...
|
13 | 13 | checker_width=15);
|
14 | 14 |
|
15 |
| -% import CFSVM.MondrianGenerator |
16 |
| -% % Will generate Mondrians inside dirpath/Masks |
17 |
| -% generator = MondrianGenerator( ... |
18 |
| -% '../Stimuli/', ... |
19 |
| -% type='rectangle', ... |
20 |
| -% x_pixels=512, ... |
21 |
| -% y_pixels=512, ... |
22 |
| -% min_fraction=1/20, ... |
23 |
| -% max_fraction=1/8, ... |
24 |
| -% n_figures=1000); |
25 |
| -% |
26 |
| -% generator.set_physical_properties(60, 1920, 33.5, 1080, 45); |
27 |
| -% |
| 15 | +import CFSVM.MondrianGenerator |
| 16 | +% Will generate Mondrians inside dirpath/Masks |
| 17 | +generator = MondrianGenerator( ... |
| 18 | + '../Stimuli/', ... |
| 19 | + type='rectangle', ... |
| 20 | + x_pixels=512, ... |
| 21 | + y_pixels=512, ... |
| 22 | + min_fraction=1/20, ... |
| 23 | + max_fraction=1/8, ... |
| 24 | + n_figures=1000); |
| 25 | + |
| 26 | +generator.set_physical_properties(60, 1920, 33.5, 1080, 45); |
| 27 | + |
| 28 | +generator.set_cmap('grayscale', n_tones=5) |
28 | 29 | % generator.set_shades([0,0,0], 5);
|
29 |
| -% |
30 |
| -% generator.generate(51); |
| 30 | +% generator.cmap = [0 0 0 |
| 31 | +% 0.25 0.25 0.25 |
| 32 | +% 0.5 0.5 0.5 |
| 33 | +% 0.75 0.75 0.75 |
| 34 | +% 1 1 1] |
| 35 | + |
| 36 | +generator.generate(51); |
31 | 37 |
|
32 | 38 | experiment.masks = Mondrians( ...
|
33 | 39 | dirpath='../Stimuli/Masks', ...
|
|
72 | 78 | n_images = 2;
|
73 | 79 | for block = 1:n_blocks
|
74 | 80 | for trial = 1:n_trials(block)
|
75 |
| - exp = copy(experiment); |
76 |
| - exp.stimulus_1.index = randi(n_images); |
77 |
| - exp.stimulus_1.rotation = orientations(randi(length(orientations), 1)); |
78 |
| - exp.stimulus_2.index = randi(n_images); |
79 |
| - exp.stimulus_2.rotation = orientations(randi(length(orientations), 1)); |
| 81 | + exp_copy = copy(experiment); |
| 82 | + exp_copy.stimulus_1.index = randi(n_images); |
| 83 | + exp_copy.stimulus_1.rotation = orientations(randi(length(orientations), 1)); |
| 84 | + exp_copy.stimulus_2.index = randi(n_images); |
| 85 | + exp_copy.stimulus_2.rotation = orientations(randi(length(orientations), 1)); |
80 | 86 | if trial >= 20
|
81 |
| - exp.stimulus_2.contrast = 0; |
| 87 | + exp_copy.stimulus_2.contrast = 0; |
82 | 88 | end
|
83 |
| - trial_matrix{block}{trial} = exp; |
| 89 | + trial_matrix{block}{trial} = exp_copy; |
84 | 90 | end
|
85 | 91 | trial_matrix{1} = trial_matrix{1}(randperm(numel(trial_matrix{1})));
|
86 | 92 | end
|
|
0 commit comments