autods_pet.ops.dicom_seg#
Read DICOM SEG segmentation objects as SimpleITK images.
This module lazily imports highdicom and pydicom so that the
optional dependency is only required when a .dcm mask file is
actually encountered.
- autods_pet.ops.dicom_seg.is_dicom_seg(path)[source]#
Check whether path is a DICOM SEG file (header-only read).
- autods_pet.ops.dicom_seg.read_referenced_series_uids(path)[source]#
Read the
ReferencedSeriesSequenceSeriesInstanceUIDs from a DICOM SEG.Header-only read; no
highdicomdependency. Used by mask discovery to match a SEG file against the patient’s PET series.
- autods_pet.ops.dicom_seg.read_dicom_seg(path, segment_label=None)[source]#
Read a DICOM SEG file and return the selected segment as a SimpleITK image.
- Parameters:
- Returns:
Binary
uint8mask in LPS orientation (native DICOM / SimpleITK coordinate system).- Return type:
- Raises:
ModuleNotFoundError – If
highdicomis not installed.ValueError – If the file is not a valid DICOM SEG, the requested label is not found, or a multi-segment file is loaded without specifying a label.