Skip to content

Commit 91211e6

Browse files
committed
deal with special prefixes in identify sources
1 parent b9c0218 commit 91211e6

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

src/Mapping.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ function print_mapping(obj, filename)
317317
[obj.smooth, obj.norm, obj.unwarp], ...
318318
[obj.smooth, obj.norm, obj.realign] }, obj.cfg.smooth_norm};
319319

320+
spec_preproc = {{[obj.realign, obj.stc]}, obj.cfg.preproc};
321+
320322
spec_preproc_norm = {{obj.norm, ...
321323
[obj.norm, obj.bias_cor], ...
322324
[obj.norm, obj.stc, obj.unwarp], ...
@@ -329,6 +331,7 @@ function print_mapping(obj, filename)
329331
spec_smooth, ...
330332
spec_smooth_norm, ...
331333
spec_preproc_norm, ...
334+
spec_preproc, ...
332335
spec_mean, ...
333336
spec_norm_mean);
334337

src/utils/identify_sources.m

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,31 @@
102102
else
103103
% remove the prefix of the last step
104104

105-
if bids.internal.starts_with(bf.prefix, 's') || ...
106-
bids.internal.starts_with(bf.prefix, 'u')
105+
if bids.internal.starts_with(bf.prefix, 's') && ...
106+
~bids.internal.starts_with(bf.prefix, 'std_') && ...
107+
~bids.internal.starts_with(bf.prefix, 'segparam_')
108+
109+
% in case we have "s6" for the fwhm
110+
if isnan(str2double(bf.prefix(2)))
111+
bf.prefix = bf.prefix(2:end);
112+
else
113+
bf.prefix = bf.prefix(3:end);
114+
end
115+
116+
elseif bids.internal.starts_with(bf.prefix, 'u') && ...
117+
~bids.internal.starts_with(bf.prefix, 'unwarpparam_')
118+
107119
bf.prefix = bf.prefix(2:end);
108120

121+
add_deformation_field = true;
122+
109123
elseif bids.internal.starts_with(bf.prefix, 'w')
124+
110125
bf.prefix = bf.prefix(2:end);
111126
add_deformation_field = true;
112127

113128
elseif bids.internal.starts_with(bf.prefix, 'rp_a')
129+
114130
bf.prefix = bf.prefix(4:end);
115131

116132
elseif bids.internal.starts_with(bf.prefix, 'mean')

tests/test_spm_2_bids.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ function test_spm_2_bids_func()
239239
'sub-01_task-auditory_motion.tsv'; ...
240240
{'mean', 'meanu', 'meanua', 'meanau'}, ...
241241
'sub-01_task-auditory_space-individual_desc-mean_bold.nii'; ...
242+
{'ra'}, ...
243+
'sub-01_task-auditory_space-individual_desc-preproc_bold.nii'; ...
242244
{'w', 'wua', 'wu', 'wr', 'wra'}, ...
243245
'sub-01_task-auditory_space-IXI549Space_desc-preproc_bold.nii'; ...
244246
{'wmean', 'wmeanu', 'wmeanua', 'wmeanau'}, ...

0 commit comments

Comments
 (0)