Skip to content

Commit 8ec594d

Browse files
committed
refactor
1 parent 3dd2b3b commit 8ec594d

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/defaults/setRenamingConfig.m

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,36 @@
1111

1212
opt = set_spm_2_bids_defaults(opt);
1313

14+
map = opt.spm_2_bids;
15+
1416
switch lower(workflowName)
1517

1618
case 'spatialprepro'
1719

1820
if ~opt.realign.useUnwarp
19-
opt.spm_2_bids = opt.spm_2_bids.add_mapping('prefix', opt.spm_2_bids.realign, ...
20-
'name_spec', opt.spm_2_bids.cfg.preproc);
21+
map = map.add_mapping('prefix', map.realign, ...
22+
'name_spec', map.cfg.preproc);
2123

22-
opt.spm_2_bids = opt.spm_2_bids.add_mapping('prefix', [opt.spm_2_bids.realign 'mean'], ...
23-
'name_spec', opt.spm_2_bids.cfg.mean);
24-
opt.spm_2_bids = opt.spm_2_bids.flatten_mapping();
24+
map = map.add_mapping('prefix', [map.realign 'mean'], ...
25+
'name_spec', map.cfg.mean);
2526
end
2627

2728
case 'realignreslice'
2829

29-
opt.spm_2_bids = opt.spm_2_bids.add_mapping('prefix', opt.spm_2_bids.realign, ...
30-
'name_spec', opt.spm_2_bids.cfg.preproc);
30+
map = map.add_mapping('prefix', map.realign, ...
31+
'name_spec', map.cfg.preproc);
3132

32-
opt.spm_2_bids = opt.spm_2_bids.add_mapping('prefix', [opt.spm_2_bids.realign 'mean'], ...
33-
'name_spec', opt.spm_2_bids.cfg.mean);
33+
map = map.add_mapping('prefix', [map.realign 'mean'], ...
34+
'name_spec', map.cfg.mean);
3435

3536
case 'reslicetpmtofunc'
3637

3738
name_spec.entities.res = 'bold';
38-
opt.spm_2_bids = opt.spm_2_bids.add_mapping('prefix', opt.spm_2_bids.realign, ...
39-
'name_spec', name_spec);
39+
map = map.add_mapping('prefix', map.realign, ...
40+
'name_spec', name_spec);
4041

4142
case 'lesionsegmentation'
4243

43-
map = opt.spm_2_bids;
44-
4544
res = opt.toolbox.ALI.unified_segmentation.step1vox;
4645
res = ['r' convertToStr(res)];
4746
fwhm = opt.toolbox.ALI.unified_segmentation.step1fwhm;
@@ -110,7 +109,9 @@
110109

111110
end
112111

113-
opt.spm_2_bids = map.flatten_mapping();
112+
map = map.flatten_mapping();
113+
114+
opt.spm_2_bids = map;
114115

115116
end
116117

0 commit comments

Comments
 (0)