Skip to content

Commit 6df7295

Browse files
committed
reuse defaults
1 parent 2915825 commit 6df7295

File tree

2 files changed

+31
-23
lines changed

2 files changed

+31
-23
lines changed

demos/MoAE/moae_03_slice_display.m

+27-20
Original file line numberDiff line numberDiff line change
@@ -47,61 +47,68 @@
4747

4848
opt.results(iRes).montage = setMontage(opt.results(iRes));
4949

50+
opt.results(iRes).sdConfig
51+
5052
% we get the con image to extract data
5153
ffxDir = getFFXdir(subLabel, opt);
5254

5355
maskImage = spm_select('FPList', ffxDir, '^.*_mask.nii$');
5456
bf = bids.File(spm_file(maskImage, 'filename'));
55-
conImage = spm_select('FPList', ffxDir, ['^con_' bf.entities.label '.nii$']);
57+
5658

5759
%% Layers to put on the figure
5860
layers = sd_config_layers('init', {'truecolor', 'dual', 'contour'});
5961

6062
% Layer 1: Anatomical map
61-
layers(1).color.file = opt.results(iRes).montage.background{1};
63+
overwrite = true;
64+
layers(1) = setFields(layers(1), opt.results(iRes).sdConfig.layers{1}, overwrite);
6265

63-
hdr = spm_vol(layers(1).color.file);
64-
[max_val, min_val] = slover('volmaxmin', hdr);
65-
layers(1).color.range = [0 max_val];
66+
% layers(1).color.file = opt.results(iRes).montage.background{1};
67+
%
68+
% hdr = spm_vol(layers(1).color.file);
69+
% [max_val, min_val] = slover('volmaxmin', hdr);
70+
% layers(1).color.range = [0 max_val];
6671

67-
layers(1).color.map = gray(256);
6872

6973
%% Layer 2: Dual-coded layer
7074
%
7175
% - contrast estimates color-coded;
76+
layers(2) = setFields(layers(2), opt.results(iRes).sdConfig.layers{2}, overwrite);
7277

78+
conImage = spm_select('FPList', ffxDir, ['^con_' bf.entities.label '.nii$']);
7379
layers(2).color.file = conImage;
7480

7581
color_map_folder = fullfile(fileparts(which('map_luminance')), '..', 'mat_maps');
76-
load(fullfile(color_map_folder, 'diverging_bwr_iso.mat'));
82+
load(fullfile(color_map_folder, layers(2).color.map));
7783
layers(2).color.map = diverging_bwr;
7884

79-
layers(2).color.range = [-4 4];
80-
layers(2).color.label = '\beta_{listening} - \beta_{baseline} (a.u.)';
85+
% layers(2).color.range = [-4 4];
86+
% layers(2).color.label = '\beta_{listening} - \beta_{baseline} (a.u.)';
8187

82-
%% Layer 2: Dual-coded layer
83-
%
84-
% - t-statistics opacity-coded
8588

89+
% - t-statistics opacity-coded
8690
spmTImage = spm_select('FPList', ffxDir, ['^spmT_' bf.entities.label '.nii$']);
8791
layers(2).opacity.file = spmTImage;
8892

89-
layers(2).opacity.range = [0 3];
90-
layers(2).opacity.label = '| t |';
93+
% layers(2).opacity.range = [0 3];
94+
% layers(2).opacity.label = '| t |';
9195

9296
%% Layer 3 and 4: Contour of ROI
97+
layers(3) = setFields(layers(3), opt.results(iRes).sdConfig.layers{3}, overwrite);
98+
9399
contour = spm_select('FPList', ffxDir, ['^sub.*' bf.entities.label '.*_mask.nii']);
100+
94101
layers(3).color.file = contour;
95-
layers(3).color.map = [0 0 0];
96-
layers(3).color.line_width = 2;
102+
% layers(3).color.map = [0 0 0];
103+
% layers(3).color.line_width = 2;
97104

98105
%% Settings
99-
settings = sd_config_settings('init');
106+
settings = opt.results(iRes).sdConfig.settings;
100107

101108
% we reuse the details for the SPM montage
102-
settings.slice.disp_slices = opt.results(1).montage.slices;
103-
settings.slice.orientation = opt.results(1).montage.orientation;
104-
settings.fig_specs.n.slice_column = 4;
109+
% settings.slice.disp_slices = opt.results(1).montage.slices;
110+
% settings.slice.orientation = opt.results(1).montage.orientation;
111+
105112
settings.fig_specs.title = opt.results(1).name;
106113

107114
%% Display the layers

src/defaults/defaultResultsStructure.m

+4-3
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@
3333

3434
layers{2} = struct('color', struct('file', [], ... % con image
3535
'map', 'diverging_bwr_iso', ...
36-
'range', [-4 4]), ...
37-
'label', '\beta_{listening} - \beta_{baseline} (a.u.)', ...
36+
'range', [-4 4], ...
37+
'label', '\beta_{listening} - \beta_{baseline} (a.u.)'), ...
3838
'opacity', struct('file', [], ... % spmT image
3939
'range', [2 3], ...
40-
'label', '| t |'));
40+
'label', '| t |'), ...
41+
'type', 'dual');
4142

4243
layers{3} = struct('color', struct('file', [], ... % spmT mask thresholded at 0.05 FWD
4344
'map', [0 0 0], ...

0 commit comments

Comments
 (0)