Skip to content

Commit eaf3b4b

Browse files
authored
Merge pull request #1281 from levje/stats_fix
ENH: Add option to keep original json structure for one input roi
2 parents 47159d4 + d2b3e25 commit eaf3b4b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/scilpy/cli/scil_volume_stats_in_ROI.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ def _build_arg_parser():
3838
help='ROIs volume filenames.\nCan be binary masks or '
3939
'weighted masks.')
4040

41+
p.add_argument('--keep_unique_roi_name', action='store_true',
42+
help='If set, will keep the same JSON structure even if only '
43+
'one ROI is provided as input.')
44+
4145
g = p.add_argument_group('Metrics input options')
4246
gg = g.add_mutually_exclusive_group(required=True)
4347
gg.add_argument('--metrics_dir', metavar='dir',
@@ -139,7 +143,7 @@ def main():
139143
'Metric {} is not a 3D image ({}D shape).'
140144
.format(f, len(metric_img.shape)))
141145

142-
if len(args.in_rois) == 1:
146+
if len(args.in_rois) == 1 and not args.keep_unique_roi_name:
143147
json_stats = json_stats[roi_name]
144148

145149
# Print results

0 commit comments

Comments
 (0)