Skip to content

Commit 1ff190f

Browse files
marcobarilaripre-commit-ci[bot]Remi-Gausourcery-ai[bot]
authored
Add defaults for transparent plots (#1355)
* add local path * add local path * add chagelog CI script * add code * add mock change * update changelog workflow * fix typo * fix syntax * fix CI error * saved UNDO information for reset changes and discarded files * update bids-matlab submodule to latest commit in main * update gitmodule file to track main branch in bids-matlab * rm files we do not know where they are coming from * add defaults for transparent plots * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update src/defaults/defaultResultsStructure.m Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * Update src/defaults/defaultResultsStructure.m * assign the sd structures to the result one * fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add test and update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Remi Gau <remi_gau@hotmail.com> Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
1 parent b31e664 commit 1ff190f

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

src/defaults/defaultResultsStructure.m

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,35 @@
2323

2424
result.nidm = true();
2525

26+
% transparent plot
27+
layers{1} = struct('color', struct('file', result.montage.background, ...
28+
'range', [0 1], ...
29+
'map', gray(256)));
30+
31+
% color_map_folder = fullfile(fileparts(which('map_luminance')), '..', 'mat_maps');
32+
% load(fullfile(color_map_folder, 'diverging_bwr_iso.mat'));
33+
34+
layers{2} = struct('color', struct('file', [], ... % con image
35+
'map', 'diverging_bwr_iso', ...
36+
'range', [-4 4]), ...
37+
'label', '\beta_{listening} - \beta_{baseline} (a.u.)', ...
38+
'opacity', struct('file', [], ... % spmT image
39+
'range', [2 3], ...
40+
'label', '| t |'));
41+
42+
layers{3} = struct('color', struct('file', [], ... % spmT mask thresholded at 0.05 FWD
43+
'map', [0 0 0], ...
44+
'line_width', 2));
45+
46+
result.sdConfig.layers = layers;
47+
48+
settings = sd_config_settings('init');
49+
50+
settings.slice.orientation = result.montage.orientation;
51+
settings.slice.disp_slices = -50:10:50;
52+
settings.fig_specs.n.slice_column = 4;
53+
settings.fig_specs.title = [];
54+
55+
result.sdConfig.settings = settings;
56+
2657
end

tests/tests_defaults/test_defaultResultsStructure.m

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,35 @@ function test_defaultResultsStructure_basic()
3737

3838
expected.nidm = true();
3939

40+
layers{1} = struct('color', struct('file', expected.montage.background, ...
41+
'range', [0 1], ...
42+
'map', gray(256)));
43+
44+
layers{2} = struct('color', struct('file', [], ... % con image
45+
'map', 'diverging_bwr_iso', ...
46+
'range', [-4 4]), ...
47+
'label', '\beta_{listening} - \beta_{baseline} (a.u.)', ...
48+
'opacity', struct('file', [], ... % spmT image
49+
'range', [2 3], ...
50+
'label', '| t |'));
51+
52+
layers{3} = struct('color', struct('file', [], ... % spmT mask thresholded at 0.05 FWD
53+
'map', [0 0 0], ...
54+
'line_width', 2));
55+
56+
expected.sdConfig.layers = layers;
57+
58+
settings = sd_config_settings('init');
59+
60+
settings = sd_config_settings('init');
61+
62+
settings.slice.orientation = expected.montage.orientation;
63+
settings.slice.disp_slices = -50:10:50;
64+
settings.fig_specs.n.slice_column = 4;
65+
settings.fig_specs.title = [];
66+
67+
expected.sdConfig.settings = settings;
68+
4069
assertEqual(results, expected);
4170

4271
end

0 commit comments

Comments
 (0)