alexanderdann commited on
Commit
4225f66
·
verified ·
1 Parent(s): c93004f

Adding debug to loading script

Browse files
Files changed (1) hide show
  1. CTSpine1K.py +5 -4
CTSpine1K.py CHANGED
@@ -1,5 +1,6 @@
1
  """Wrapper to load the actual data using Python."""
2
 
 
3
  from collections.abc import Generator
4
  from functools import lru_cache
5
  from pathlib import Path
@@ -231,11 +232,11 @@ class CTSpine1K(datasets.GeneratorBasedBuilder):
231
  segmentation_slices = self._get_sample_length(segmentation_path)
232
  if image_slices != segmentation_slices:
233
  msg = (
234
- f"Invalid assumptions for {file_path} and {segmentation_path}."
235
- f"Image slices ({image_slices}) are not equal to "
236
- f"segmentation slices ({segmentation_slices})."
237
  )
238
- raise ValueError(msg)
239
 
240
  # convert 'some/path/to/file/dummy_123.nii.gz' to dummy_123.nii.gz
241
  stem = file_path.name
 
1
  """Wrapper to load the actual data using Python."""
2
 
3
+ import warnings
4
  from collections.abc import Generator
5
  from functools import lru_cache
6
  from pathlib import Path
 
232
  segmentation_slices = self._get_sample_length(segmentation_path)
233
  if image_slices != segmentation_slices:
234
  msg = (
235
+ f"Detected files with different slice count for {file_path} "
236
+ f"and {segmentation_path}. Image slices ({image_slices}) are not "
237
+ f"equal to segmentation slices ({segmentation_slices})."
238
  )
239
+ warnings.warn(msg, stacklevel=2)
240
 
241
  # convert 'some/path/to/file/dummy_123.nii.gz' to dummy_123.nii.gz
242
  stem = file_path.name