Skip to content

Commit

Permalink
second round answer Em comments
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudbore committed Sep 27, 2024
1 parent 5596680 commit f94453f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions dwi_ml/data/hdf5/hdf5_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,11 @@ def _create_streamline_groups(self, ref, subj_input_dir, subj_id,
logging.debug('sft contained data_per_point. Data not kept.')

for dps_key in self.dps_keys:
if dps_key not in sft.data_per_streamline:
raise ValueError(
"The data_per_streamline key '{}' was not found in "
"the sft. Check your tractogram file.".format(dps_key))

logging.debug(" Include dps \"{}\" in the HDF5.".format(dps_key))
streamlines_group.create_dataset('dps_' + dps_key,
data=sft.data_per_streamline[dps_key])
Expand Down Expand Up @@ -675,10 +680,6 @@ def _process_one_streamline_group(
The Euclidean length of each streamline
"""
tractograms = self.groups_config[group]['files']
if self.step_size and self.compress:
raise ValueError(
"Only one option can be chosen: either resampling to "
"step_size, nb_points or compressing, not both.")

# Silencing SFT's logger if our logging is in DEBUG mode, because it
# typically produces a lot of outputs!
Expand Down

0 comments on commit f94453f

Please sign in to comment.