Skip to content

Commit

Permalink
Merge pull request #285 from pyplati/fix-neg-z-value
Browse files Browse the repository at this point in the history
Check if z_index less than 0
  • Loading branch information
pchlap authored Aug 20, 2024
2 parents af71bf2 + b14ae8c commit e9ef41f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions platipy/dicom/io/rtstruct_to_nifti.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ def transform_point_set_from_dicom_struct(dicom_image, dicom_struct, spacing_ove
logger.debug("Slice index: %d", z_index)
continue

if z_index < 0:
logger.debug("Warning: Slice index less than zero. Skipping slice.")
logger.debug("Structure: %s", struct_name)
logger.debug("Slice index: %d", z_index)
continue

slice_arr = np.zeros(image_blank.shape[-2:], dtype=np.uint8)

filled_indices_x, filled_indices_y = polygon(
Expand Down

0 comments on commit e9ef41f

Please sign in to comment.