|
47 | 47 |
|
48 | 48 | opt.results(iRes).montage = setMontage(opt.results(iRes));
|
49 | 49 |
|
| 50 | +opt.results(iRes).sdConfig |
| 51 | + |
50 | 52 | % we get the con image to extract data
|
51 | 53 | ffxDir = getFFXdir(subLabel, opt);
|
52 | 54 |
|
53 | 55 | maskImage = spm_select('FPList', ffxDir, '^.*_mask.nii$');
|
54 | 56 | bf = bids.File(spm_file(maskImage, 'filename'));
|
55 |
| -conImage = spm_select('FPList', ffxDir, ['^con_' bf.entities.label '.nii$']); |
| 57 | + |
56 | 58 |
|
57 | 59 | %% Layers to put on the figure
|
58 | 60 | layers = sd_config_layers('init', {'truecolor', 'dual', 'contour'});
|
59 | 61 |
|
60 | 62 | % 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); |
62 | 65 |
|
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]; |
66 | 71 |
|
67 |
| -layers(1).color.map = gray(256); |
68 | 72 |
|
69 | 73 | %% Layer 2: Dual-coded layer
|
70 | 74 | %
|
71 | 75 | % - contrast estimates color-coded;
|
| 76 | +layers(2) = setFields(layers(2), opt.results(iRes).sdConfig.layers{2}, overwrite); |
72 | 77 |
|
| 78 | +conImage = spm_select('FPList', ffxDir, ['^con_' bf.entities.label '.nii$']); |
73 | 79 | layers(2).color.file = conImage;
|
74 | 80 |
|
75 | 81 | 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)); |
77 | 83 | layers(2).color.map = diverging_bwr;
|
78 | 84 |
|
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.)'; |
81 | 87 |
|
82 |
| -%% Layer 2: Dual-coded layer |
83 |
| -% |
84 |
| -% - t-statistics opacity-coded |
85 | 88 |
|
| 89 | +% - t-statistics opacity-coded |
86 | 90 | spmTImage = spm_select('FPList', ffxDir, ['^spmT_' bf.entities.label '.nii$']);
|
87 | 91 | layers(2).opacity.file = spmTImage;
|
88 | 92 |
|
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 |'; |
91 | 95 |
|
92 | 96 | %% Layer 3 and 4: Contour of ROI
|
| 97 | +layers(3) = setFields(layers(3), opt.results(iRes).sdConfig.layers{3}, overwrite); |
| 98 | + |
93 | 99 | contour = spm_select('FPList', ffxDir, ['^sub.*' bf.entities.label '.*_mask.nii']);
|
| 100 | + |
94 | 101 | 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; |
97 | 104 |
|
98 | 105 | %% Settings
|
99 |
| -settings = sd_config_settings('init'); |
| 106 | +settings = opt.results(iRes).sdConfig.settings; |
100 | 107 |
|
101 | 108 | % 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 | + |
105 | 112 | settings.fig_specs.title = opt.results(1).name;
|
106 | 113 |
|
107 | 114 | %% Display the layers
|
|
0 commit comments