From 02b6556fc76b7e47be5e2afd919e2d0daada4ba0 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Mon, 24 Nov 2025 10:54:06 -0500 Subject: [PATCH] add no empty option --- src/scilpy/cli/scil_tractogram_cut_streamlines.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scilpy/cli/scil_tractogram_cut_streamlines.py b/src/scilpy/cli/scil_tractogram_cut_streamlines.py index eca61c0c9..b127bde4a 100755 --- a/src/scilpy/cli/scil_tractogram_cut_streamlines.py +++ b/src/scilpy/cli/scil_tractogram_cut_streamlines.py @@ -97,6 +97,8 @@ def _build_arg_parser(): p.add_argument('--min_length', type=float, default=0, help='Minimum length of streamlines to keep (in mm) ' '[%(default)s].') + p.add_argument('--no_empty', action='store_true', + help='Do not write file if there is no streamline.') g = p.add_argument_group('Cutting options', 'Options for cutting ' 'streamlines with --mask.') @@ -191,7 +193,7 @@ def main(): new_sft = StatefulTractogram.from_sft( compressed_strs, sft, data_per_streamline=sft.data_per_streamline) - save_tractogram(new_sft, args.out_tractogram) + save_tractogram(new_sft, args.out_tractogram, args.no_empty) if __name__ == "__main__":