Skip to content

Commit ad967d5

Browse files
authored
Merge pull request #1283 from arnaudbore/add_save_empty_cut_tractogram
[ENH] Add no empty option
2 parents eaf3b4b + 02b6556 commit ad967d5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/scilpy/cli/scil_tractogram_cut_streamlines.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ def _build_arg_parser():
9797
p.add_argument('--min_length', type=float, default=0,
9898
help='Minimum length of streamlines to keep (in mm) '
9999
'[%(default)s].')
100+
p.add_argument('--no_empty', action='store_true',
101+
help='Do not write file if there is no streamline.')
100102

101103
g = p.add_argument_group('Cutting options', 'Options for cutting '
102104
'streamlines with --mask.')
@@ -191,7 +193,7 @@ def main():
191193
new_sft = StatefulTractogram.from_sft(
192194
compressed_strs, sft, data_per_streamline=sft.data_per_streamline)
193195

194-
save_tractogram(new_sft, args.out_tractogram)
196+
save_tractogram(new_sft, args.out_tractogram, args.no_empty)
195197

196198

197199
if __name__ == "__main__":

0 commit comments

Comments
 (0)