Skip to content

Commit

Permalink
Use XOR when combining masks to support multiple contours which defin…
Browse files Browse the repository at this point in the history
…e holes
  • Loading branch information
pchlap committed Jun 12, 2024
1 parent cd18a39 commit 28e9e4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion platipy/dicom/io/crawl.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def transform_point_set_from_dicom_struct(image, dicom_struct, spacing_override=
xVertexArr_image, yVertexArr_image, shape=sliceArr.shape
)
sliceArr[filledIndicesX, filledIndicesY] = 1
image_blank[zIndex] += sliceArr.T
image_blank[zIndex] ^= sliceArr.T

struct_image = sitk.GetImageFromArray(1 * (image_blank > 0))
struct_image.CopyInformation(image)
Expand Down
2 changes: 1 addition & 1 deletion platipy/dicom/io/rtstruct_to_nifti.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def transform_point_set_from_dicom_struct(dicom_image, dicom_struct, spacing_ove
)
slice_arr[filled_indices_y, filled_indices_x] = 1

image_blank[z_index] += slice_arr
image_blank[z_index] ^= slice_arr

if not skip_contour:
struct_image = sitk.GetImageFromArray(1 * (image_blank > 0))
Expand Down

0 comments on commit 28e9e4d

Please sign in to comment.