Hi there,
When calculating conformity index (CI), I realized some of my data have CI>1.
This happened because the body mask and the PTV mask were none overlapping when the data was exported from the clinical TPS (picture below).
The fix would be to do an “OR” operation between the body mask and the PTV (code after the picture). However, I am not sure that the assumption PTV always being inside the body would apply in all cases? Alternatively, we could leave it to the user to ensure that the body mask is overlapping with all the structure masks inside the body.
Here’s the quick fix:
File:
/OpenTPS-brachyutils/opentps_core/opentps/core/data/_dvh.py
Class:
DVH.conformityIndex()
line 393 to 402
assert self._prescription is not None
percentile = 0.95 # ICRU reference isodose
body_mask = body_contour.getBinaryMask(
self._doseImage.origin,
self._doseImage.gridSize,
self._doseImage.spacing).imageArray
body_mask = np.ma.mask_or(body_mask, self._roiMask.imageArray) # include target volume in body mask
# prescription isodose volume
isodose_prescription_volume = np.sum(
self._doseImage.imageArray[body_mask] >= percentile
* self._prescription) #V_RI
