Sikerdebaard / dcmrtstruct2nii

DICOM RT-Struct to mask
MIT License
93 stars 26 forks source link

WARNING:root:Structure ... is out of bounds, ignoring contour! #28

Closed whisney closed 2 years ago

whisney commented 2 years ago

I used dcmrtstruct2nii to convert RS in MR data into NII format. I found that when the length and width of the image are inconsistent, a warning (WARNING:root:Structure ... is out of bounds, ignoring contour!) will appear and the NII result will not be generated. While the length and width of the image are the same, everything is OK. Excuse me, how can I solve this problem?

whisney commented 2 years ago

https://github.com/Sikerdebaard/dcmrtstruct2nii/blob/4f85bccd2d8ee95c34b399950ec5e528baad5e77/dcmrtstruct2nii/adapters/convert/rtstructcontour2mask.py#L47

I have found the solution to the problem. Change 'filled_poly = self._poly2mask(pts[:, 0], pts[:, 1], [shape[0], shape[1]])' here to 'filled_poly = self._poly2mask(pts[:, 0], pts[:, 1], [shape[1], shape[0]])'.