From e57153b2afc4e5813b3e388fef4a315a5b988818 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Tue, 1 Oct 2024 15:37:47 -0400 Subject: [PATCH] fix condition resampling and compressing --- dwi_ml/data/processing/streamlines/data_augmentation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dwi_ml/data/processing/streamlines/data_augmentation.py b/dwi_ml/data/processing/streamlines/data_augmentation.py index 18428cb9..cd46a185 100644 --- a/dwi_ml/data/processing/streamlines/data_augmentation.py +++ b/dwi_ml/data/processing/streamlines/data_augmentation.py @@ -17,15 +17,15 @@ def resample_or_compress(sft, step_size_mm: float = None, nb_points: int = None, compress: float = None, remove_invalid: bool = False): - if step_size_mm is not None: + if step_size_mm: # Note. No matter the chosen space, resampling is done in mm. logging.debug(" Resampling (step size): {}mm".format(step_size_mm)) sft = resample_streamlines_step_size(sft, step_size=step_size_mm) - elif nb_points is not None: + elif nb_points: logging.debug(" Resampling: " + "{} points per streamline".format(nb_points)) sft = resample_streamlines_num_points(sft, nb_points) - elif compress is not None: + elif compress: logging.debug(" Compressing: {}".format(compress)) sft = compress_sft(sft, compress)