Closed fcjxxl closed 4 years ago
I have the exact same issue. Please let me know if you or anyone has found a solution.
Most likely this occurs because no 'ContourSequence' is found for a specific contour (within the list ROIContourSequence) in the RTStruct.
If this is the case this check will probably fail so that the 'sequence'-key is not available: https://github.com/Sikerdebaard/dcmrtstruct2nii/blob/master/dcmrtstruct2nii/adapters/input/contours/rtstructinputadapter.py#L54
try:
rtstruct['sequence']
try:
mask = dcm_patient_coords_to_mask.convert(rtstruct['sequence'], dicom_image, mask_background_value, mask_foreground_value)
except ContourOutOfBoundsException:
logging.warning(f'Structure {rtstruct["name"]} is out of bounds, ignoring contour!')
continue
except:
continue
@dlabella29 I tried it and it seems to work! It would be nice to add this in the repo @Sikerdebaard .
A fix was added to the new 1.0.19 release and was validated against the example image from @fcjxxl. You can upgrade using pip install --upgrade dcmrtstruct2nii==1.0.19
RectumTest.zip Data attached