Rtstruct utils
rtstruct_utils
#
Functions:
Name | Description |
---|---|
extract_roi_meta |
Extract ROI metadata from an RTSTRUCT DICOM file. |
extract_roi_names |
Extract a list of ROI names from an RTSTRUCT DICOM file. |
rtstruct_reference_uids |
Retrieve the referenced SeriesInstanceUID and SOP UIDs from an RTSTRUCT. |
RTSTRUCTRefSOP
#
Bases: list[str]
A list subclass representing the SOPInstanceUIDs referenced by an RTSTRUCT file.
Contains the UIDs of individual DICOM instances that the structure set references.
RTSTRUCTRefSeries
#
Bases: str
A string subclass representing the SeriesInstanceUID referenced by an RTSTRUCT file.
Used for type annotations and to distinguish this particular reference type.
extract_roi_meta
#
extract_roi_meta(
rtstruct: pydicom.dataset.Dataset,
) -> list[dict[str, str]]
Extract ROI metadata from an RTSTRUCT DICOM file.
Iterate over the StructureSetROISequence
in the RTSTRUCT file and extract:
- "ROINumber": Unique identifier for the ROI.
- "ROIName": Name of the ROI.
- "ROIGenerationAlgorithm": Algorithm used to generate the ROI.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
`pydicom.dataset.Dataset`
|
|
required |
Returns:
Type | Description |
---|---|
list of dict[str, str]
|
A list of dictionaries, each containing metadata for an ROI. |
Source code in src/imgtools/dicom/dicom_metadata/modality_utils/rtstruct_utils.py
extract_roi_names
#
extract_roi_names(
rtstruct: pydicom.dataset.Dataset,
) -> list[str]
Extract a list of ROI names from an RTSTRUCT DICOM file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
`pydicom.dataset.Dataset`
|
|
required |
Returns:
Type | Description |
---|---|
list of str
|
A list of ROI names extracted from the RTSTRUCT file. |
Source code in src/imgtools/dicom/dicom_metadata/modality_utils/rtstruct_utils.py
rtstruct_reference_uids
#
rtstruct_reference_uids(
rtstruct: pydicom.dataset.Dataset,
) -> tuple[
imgtools.dicom.dicom_metadata.modality_utils.rtstruct_utils.RTSTRUCTRefSeries,
imgtools.dicom.dicom_metadata.modality_utils.rtstruct_utils.RTSTRUCTRefSOP,
]
Retrieve the referenced SeriesInstanceUID and SOP UIDs from an RTSTRUCT.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
pydicom.dataset.Dataset
|
DICOM RTSTRUCT dataset as a pydicom Dataset. |
required |
Returns:
Type | Description |
---|---|
tuple[imgtools.dicom.dicom_metadata.modality_utils.rtstruct_utils.RTSTRUCTRefSeries, imgtools.dicom.dicom_metadata.modality_utils.rtstruct_utils.RTSTRUCTRefSOP]
|
|