Series Information Module#
Module: pyradise.fileio.series_info
General#
The series_info module provides functionality to hold and retrieve information about data
entities which are required during the loading procedure for Subject and
Image creation. The base class of this module is the SeriesInfo which is named
in accordance with the DICOM Standard because it manages information about a single data entity (e.g. a DICOM-RTSS) or
a series of associated data entities (e.g. a series of image slices). For each supported type of data this module
provides separate classes because the information required for loading varies between the different types of data.
The SeriesInfo instances are typically generated automatically during crawling (see
Crawling Module) and render the selection (see Selection Module)
of appropriate SeriesInfo instances feasible before executing the time consuming loading procedure. This is
especially useful if the user wants to process specific data exclusively and wants to keep the computation time and
the memory footprint low. Afterwards, the SeriesInfo instances are used to load the data (see
Loading Module) and to create the Subject instance.
Class Overview#
The following SeriesInfo classes are provided:
Class |
Description |
|---|---|
Base class for all |
|
Base class for all discrete image file format |
|
Base class for all DICOM format |
|
|
|
|
|
|
|
|
|
|
Details#
- class SeriesInfo(path)[source]#
Bases:
ABCAn abstract base class for all
SeriesInfoclasses. ASeriesInfoclass is used to retrieve and store content-specific information which is required by theSubjectLoaderin order to correctly load the data and to construct aSubject.Depending on the type of data, the
SeriesInfosubclasses retrieve different information which is essential for loading andSubjectconstruction. For example, theDicomSeriesImageInforetrieves and holds data about theModalitywhereas theDicomSeriesRTSSInfomanages information about theAnnotatorand information about the referenced DICOM image series.- Parameters:
path (Union[str, Tuple[str, ...]]) – The path or paths to the files to load.
- get_path()[source]#
Get the file paths assigned to the
SeriesInfoinstance.- Returns:
The file paths assigned to the
SeriesInfoinstance.- Return type:
Tuple[str]
- is_updated()[source]#
Check if is updated.
- Returns:
True if is updated, False otherwise.
- Return type:
bool
- abstract update()[source]#
Update the
SeriesInfoinstance.- Return type:
None- Returns:
None
- class FileSeriesInfo(path, subject_name)[source]#
Bases:
SeriesInfoAn abstract base
SeriesInfoclass for all discrete image files (e.g. NIFTI, NRRD, MHA, etc.).Important
For DICOM files use a
DicomSeriesInfosubclass instead.- Parameters:
path (str) – The path to the discrete image file to load.
subject_name (str) – The name of the subject.
- abstract update()[source]#
Update the
FileSeriesInfoinstance.- Return type:
None- Returns:
None
- get_path()#
Get the file paths assigned to the
SeriesInfoinstance.- Returns:
The file paths assigned to the
SeriesInfoinstance.- Return type:
Tuple[str]
- get_patient_id()#
Get the patient ID.
- Returns:
The patient ID.
- Return type:
str
- get_patient_name()#
Get the patient name.
- Returns:
The patient name.
- Return type:
str
- is_updated()#
Check if is updated.
- Returns:
True if is updated, False otherwise.
- Return type:
bool
- class IntensityFileSeriesInfo(path, subject_name, modality)[source]#
Bases:
FileSeriesInfoA
FileSeriesInfoclass for intensity images. In addition to the information provided by theFileSeriesInfoclass, this class contains also aModalityinstance.- Parameters:
path (str) – The path to the discrete intensity image file to load.
subject_name (str) – The name of the subject.
modality (Union[str, Modality]) – The modality of the intensity image.
- update()[source]#
Update the
IntensityFileSeriesInfo.- Return type:
None- Returns:
None
- get_path()#
Get the file paths assigned to the
SeriesInfoinstance.- Returns:
The file paths assigned to the
SeriesInfoinstance.- Return type:
Tuple[str]
- get_patient_id()#
Get the patient ID.
- Returns:
The patient ID.
- Return type:
str
- get_patient_name()#
Get the patient name.
- Returns:
The patient name.
- Return type:
str
- is_updated()#
Check if is updated.
- Returns:
True if is updated, False otherwise.
- Return type:
bool
- class SegmentationFileSeriesInfo(path, subject_name, organ, annotator)[source]#
Bases:
FileSeriesInfoA
FileSeriesInfoclass for segmentation images. In addition to the information provided by theFileSeriesInfoclass, this class contains also anOrganinstance and aAnnotatorinstance.Note
We assume that the segmentation image is a binary image with the foreground having the value 1 and the background being 0. If your images are different we recommend to separate the segmentation masks into separate files because in RT practice segmentations may overlap.
- Parameters:
- update()[source]#
Update the
SegmentationFileSeriesInfoinstance.- Return type:
None- Returns:
None
- get_path()#
Get the file paths assigned to the
SeriesInfoinstance.- Returns:
The file paths assigned to the
SeriesInfoinstance.- Return type:
Tuple[str]
- get_patient_id()#
Get the patient ID.
- Returns:
The patient ID.
- Return type:
str
- get_patient_name()#
Get the patient name.
- Returns:
The patient name.
- Return type:
str
- is_updated()#
Check if is updated.
- Returns:
True if is updated, False otherwise.
- Return type:
bool
- class DicomSeriesInfo(path)[source]#
Bases:
SeriesInfoAn abstract base
SeriesInfoclass for all DICOM data (i.e. DICOM image, DICOM registration, DICOM-RTSS).Important
For discrete image files use a
FileSeriesInfosubclass instead.- Parameters:
path (Union[str, Tuple[str, ...]]) – The path or paths specifying DICOM files to load.
- abstract update()[source]#
Update the
DicomSeriesInfoinstance.- Return type:
None- Returns:
None
- get_path()#
Get the file paths assigned to the
SeriesInfoinstance.- Returns:
The file paths assigned to the
SeriesInfoinstance.- Return type:
Tuple[str]
- get_patient_id()#
Get the patient ID.
- Returns:
The patient ID.
- Return type:
str
- get_patient_name()#
Get the patient name.
- Returns:
The patient name.
- Return type:
str
- is_updated()#
Check if is updated.
- Returns:
True if is updated, False otherwise.
- Return type:
bool
- class DicomSeriesImageInfo(paths)[source]#
Bases:
DicomSeriesInfoA
DicomSeriesInfoclass for DICOM images. In addition to the information provided by theDicomSeriesInfoclass, this class contains also aModalityinstance.- Parameters:
paths (Tuple[str, ...]) – The paths to the DICOM image files to load.
- update()[source]#
Update the
DicomSeriesImageInfoinstance.- Return type:
None- Returns:
None
- get_path()#
Get the file paths assigned to the
SeriesInfoinstance.- Returns:
The file paths assigned to the
SeriesInfoinstance.- Return type:
Tuple[str]
- get_patient_id()#
Get the patient ID.
- Returns:
The patient ID.
- Return type:
str
- get_patient_name()#
Get the patient name.
- Returns:
The patient name.
- Return type:
str
- is_updated()#
Check if is updated.
- Returns:
True if is updated, False otherwise.
- Return type:
bool
- class DicomSeriesRegistrationInfo(path, image_infos, persistent_image_infos=False)[source]#
Bases:
DicomSeriesInfoA
DicomSeriesInfoclass for DICOM registrations. In addition to the information provided by theDicomSeriesInfoclass, this class contains transformation parameters and references to the pair of DICOM images associated with the registration.- Parameters:
path (str) – The path to the DICOM registration file to load.
image_infos (Tuple[DicomSeriesImageInfo, ...]) – The
DicomSeriesImageInfoused.persistent_image_infos (bool) – If True the class holds to the image_infos after updating, otherwise not (default: False).
- static get_referenced_series_info(registration_dataset)[source]#
Get the
ReferenceInfoentries from a dataset.- Parameters:
registration_dataset (Dataset) – The registration dataset to extract the infos from.
- Returns:
The
ReferenceInforetrieved from the Dataset.- Return type:
Tuple[ReferenceInfo, …]
- static get_registration_infos(registration_dataset, image_infos)[source]#
Extract the
RegistrationInfoentries with the correspondingReferenceInfo.- Parameters:
registration_dataset (Dataset) – The registration dataset to extract the registration infos from.
image_infos (Union[Tuple[DicomSeriesImageInfo, ...], Tuple[Dataset, ...]]) – The image infos or datasets to use for the combination.
- Returns:
The combined
RegistrationInfo.- Return type:
Tuple[RegistrationInfo, …]
- set_image_infos(image_infos)[source]#
Set the
DicomSeriesImageInfoentries.- Parameters:
image_infos (Tuple[DicomSeriesImageInfo, ...]) – The
DicomSeriesImageInfoentries to set.- Return type:
None- Returns:
None
- get_image_infos()[source]#
Get the
DicomSeriesImageInfoentries.- Returns:
The
DicomSeriesImageInfoentries.- Return type:
Tuple[DicomSeriesImageInfo, …]
- update()[source]#
Update the
DicomSeriesRegistrationInfo.- Return type:
None- Returns:
None
- get_path()#
Get the file paths assigned to the
SeriesInfoinstance.- Returns:
The file paths assigned to the
SeriesInfoinstance.- Return type:
Tuple[str]
- get_patient_id()#
Get the patient ID.
- Returns:
The patient ID.
- Return type:
str
- get_patient_name()#
Get the patient name.
- Returns:
The patient name.
- Return type:
str
- is_updated()#
Check if is updated.
- Returns:
True if is updated, False otherwise.
- Return type:
bool
- class DicomSeriesRTSSInfo(path)[source]#
Bases:
DicomSeriesInfoA
DicomSeriesInfoclass for DICOM-RTSS. In addition to the information provided by theDicomSeriesInfoclass, this class contains aAnnotatorinstance and a reference to the DICOM image associated with the DICOM-RTSS.- Parameters:
path (str) – The path to the DICOM-RTSS file to load.
- get_path()#
Get the file paths assigned to the
SeriesInfoinstance.- Returns:
The file paths assigned to the
SeriesInfoinstance.- Return type:
Tuple[str]
- get_patient_id()#
Get the patient ID.
- Returns:
The patient ID.
- Return type:
str
- get_patient_name()#
Get the patient name.
- Returns:
The patient name.
- Return type:
str
- is_updated()#
Check if is updated.
- Returns:
True if is updated, False otherwise.
- Return type:
bool
- update()[source]#
Update the
DicomSeriesRTSSInfo.- Return type:
None- Returns:
None
- class ReferenceInfo(series_instance_uid, study_instance_uid, is_same_study)[source]#
Bases:
objectA class storing one of multiple reference infos from a DICOM registration file.
Warning
This class is intended for internal use only.
- Parameters:
series_instance_uid (str) – The SeriesInstanceUID.
study_instance_uid (str) – The StudyInstanceUID.
is_same_study (bool) – Indicates if the series is from the same study as the reference.
- class RegistrationInfo(registration_info, reference_info, is_reference_image)[source]#
Bases:
objectA class storing all necessary infos for applying a registration transformation to a DICOM image.
Warning
This class is intended for internal use only.
- Parameters:
registration_info (RegistrationSequenceInfo) – The registration sequence info.
reference_info (ReferenceInfo) – The reference info.
is_reference_image (bool) – Indicates if the image is the reference image.
- class RegistrationSequenceInfo(frame_of_reference_uid, transforms, transform_parameters)[source]#
Bases:
objectA class storing one of multiple registration sequence infos from a DICOM registration file.
Warning
This class is intended for internal use only.
- Parameters:
frame_of_reference_uid (str) – The FrameOfReferenceUID.
transforms (Tuple[sitk.AffineTransform, ...]) – The transforms.
transform_parameters (Tuple[List, ...]) – The transformation parameters.