Skip to content

Commit ee05cad

Browse files
committed
deal with multiple iterations renaming
1 parent cc9db49 commit ee05cad

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

demos/lesion_detection/run_lesion.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222

2323
bidsCopyInputFolder(opt);
2424

25-
% Step 1: segmentation
25+
%% Step 1: segmentation
2626
bidsLesionSegmentation(opt);
2727

28-
% % Step 2: lesion abnormalities
28+
%% Step 2: lesion abnormalities
2929
bidsLesionAbnormalitiesDetection(opt);
3030

3131
% % Step 3: overlap map

src/defaults/setRenamingConfig.m

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,24 @@
7777
map = map.add_mapping('prefix', [map.norm 'c4'], ...
7878
'name_spec', nameSpec);
7979

80-
% 4th class prior next iteration
81-
nameSpec = map.cfg.segment.gm_norm;
82-
nameSpec.entities.label = 'PRIOR';
83-
nameSpec.entities.res = 'r1pt5';
84-
nameSpec.entities.desc = 'nextIte';
85-
map = map.add_mapping('prefix', [map.norm 'c4prior1'], ...
86-
'name_spec', nameSpec);
87-
88-
% 4th class at previous iteration
89-
nameSpec = map.cfg.segment.gm_norm;
90-
nameSpec.entities.label = 'PRIOR';
91-
nameSpec.entities.res = 'r1pt5';
92-
nameSpec.entities.desc = 'prevIte';
93-
map = map.add_mapping('prefix', [map.norm 'c4previous1'], ...
94-
'name_spec', nameSpec);
80+
nbIteration = opt.toolbox.ALI.unified_segmentation.step1niti;
81+
for i = 1:(nbIteration - 1)
82+
% 4th class prior next iteration
83+
nameSpec = map.cfg.segment.gm_norm;
84+
nameSpec.entities.label = 'PRIOR';
85+
nameSpec.entities.res = 'r1pt5';
86+
nameSpec.entities.desc = sprintf('nextIte%i', i);
87+
map = map.add_mapping('prefix', sprintf('%sc4prior%i', map.norm, i), ...
88+
'name_spec', nameSpec);
89+
90+
% 4th class at previous iteration
91+
nameSpec = map.cfg.segment.gm_norm;
92+
nameSpec.entities.label = 'PRIOR';
93+
nameSpec.entities.res = 'r1pt5';
94+
nameSpec.entities.desc = sprintf('prevIte%i', i);
95+
map = map.add_mapping('prefix', sprintf('%sc4previous%i', map.norm, i), ...
96+
'name_spec', nameSpec);
97+
end
9598

9699
nameSpec = map.cfg.segment.gm_norm;
97100
nameSpec.entities.res = res;

src/workflows/lesion/bidsLesionSegmentation.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ function bidsLesionSegmentation(opt)
3838
matlabbatch = {};
3939
matlabbatch = setBatchLesionSegmentation(matlabbatch, BIDS, opt, subLabel);
4040

41-
saveAndRunWorkflow(matlabbatch, 'LesionSegmentation', opt, subLabel);
42-
43-
% copyFigures(BIDS, opt, subLabel);
41+
% saveAndRunWorkflow(matlabbatch, 'LesionSegmentation', opt, subLabel);
4442

4543
end
4644

0 commit comments

Comments
 (0)