You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
In using the package I tended to call get_roi_names() to obtain a list of structures that I would like to retrieve a mask for, then retrieved the masks with the function get_roi_mask_by_name(). However, it ran into problems when there are different geometric types in the RTSTRUCT, especially the 'POINT' geometries. Generally if all of the contours are described as 'CLOSED_PLANAR' then the process works fine. But some datasets have these POINT ROIs and it is not always clear that they are from the name. So my proposal is to have another optional argument to get_roi_names() to specify the geometries we want to return. Default behaviour is the original version of listing all names. To get all CLOSED_PLANAR structures only we would call rtstruct_ds.get_roi_names('CLOSED_PLANAR') where rtstruct_ds is the rtstruct object from this repository. Here is the modified function below in rtstruct.py.
defget_roi_names(self, geometry='ALL') ->List[str]:
""" Returns a list of the names of all ROI within the RTStruct Optional argument to return only ROI of specific geometric type. E.g. CLOSED_PLANAR, POINT """ifnotself.ds.StructureSetROISequence:
return []
ifgeometry=='ALL':
return [
structure_roi.ROINameforstructure_roiinself.ds.StructureSetROISequence
]
return [
self.ds.StructureSetROISequence[i].ROINameforiinrange(0,len(self.ds.ROIContourSequence))
ifself.ds.ROIContourSequence[i].ContourSequence[0].ContourGeometricType==geometry
]
Let me know if this is useful to incorporate, it certainly is for my work as I had to do this check separately outside this package.
Best wishes,
Matt
The text was updated successfully, but these errors were encountered:
Hello,
In using the package I tended to call
get_roi_names()
to obtain a list of structures that I would like to retrieve a mask for, then retrieved the masks with the functionget_roi_mask_by_name()
. However, it ran into problems when there are different geometric types in the RTSTRUCT, especially the 'POINT' geometries. Generally if all of the contours are described as 'CLOSED_PLANAR' then the process works fine. But some datasets have these POINT ROIs and it is not always clear that they are from the name. So my proposal is to have another optional argument toget_roi_names()
to specify the geometries we want to return. Default behaviour is the original version of listing all names. To get all CLOSED_PLANAR structures only we would callrtstruct_ds.get_roi_names('CLOSED_PLANAR')
wherertstruct_ds
is thertstruct
object from this repository. Here is the modified function below in rtstruct.py.Let me know if this is useful to incorporate, it certainly is for my work as I had to do this check separately outside this package.
Best wishes,
Matt
The text was updated successfully, but these errors were encountered: