pyanno4rt.patient.import_functions
Import functions module.
This module aims to provide import functions to extract computed tomography (CT) and segmentation data from the external data file(s).
Overview
|
Generate the CT dictionary from a folder with DICOM (.dcm) files. |
|
Generate the CT dictionary from a MATLAB (.mat) file. |
|
Generate the CT dictionary from a Python binary (.p) file. |
|
Generate the segmentation dictionary from a folder with DICOM (.dcm) files. |
|
Generate the segmentation dictionary from a MATLAB (.mat) file. |
|
Generate the segmentation dictionary from a Python binary (.p) file. |
|
Import the patient data from a folder with DICOM (.dcm) files. |
|
Import the patient data from a MATLAB (.mat) file. |
|
Import the patient data from a Python (.p) file. |
|
Read the DICOM data from the path. |
|
Read the MATLAB data from the path. |
|
Read the Python data from the path. |
Functions
- pyanno4rt.patient.import_functions.generate_ct_from_dcm(data, resolution)[source]
Generate the CT dictionary from a folder with DICOM (.dcm) files.
- Parameters:
data (tuple) – Tuple of
pydicom.dataset.FileDatasetobjects with information on the CT slices.resolution (None or list) – Imaging resolution for post-processing interpolation of the CT and segmentation data.
- Returns:
computed_tomography – Dictionary with information on the CT images.
- Return type:
dict
- Raises:
ValueError – If either the grid resolutions, the image positions or the dimensionalities are inconsistent.
- pyanno4rt.patient.import_functions.generate_ct_from_mat(data, resolution)[source]
Generate the CT dictionary from a MATLAB (.mat) file.
- Parameters:
data (dict) – Dictionary with information on the CT slices.
resolution (None or list) – Imaging resolution for post-processing interpolation of the CT and segmentation data.
- Returns:
computed_tomography – Dictionary with information on the CT images.
- Return type:
dict
- pyanno4rt.patient.import_functions.generate_ct_from_p(data, resolution)[source]
Generate the CT dictionary from a Python binary (.p) file.
- Parameters:
data (dict) – Dictionary with information on the CT slices.
resolution (None or list) – Imaging resolution for post-processing interpolation of the CT and segmentation data.
- Returns:
Dictionary with information on the CT images.
- Return type:
dict
- pyanno4rt.patient.import_functions.generate_segmentation_from_dcm(data, ct_slices, computed_tomography)[source]
Generate the segmentation dictionary from a folder with DICOM (.dcm) files.
- Parameters:
data (object of class
pydicom.dataset.FileDataset) – Thepydicom.dataset.FileDatasetobject with information on the segmented structures.slices (tuple) – Tuple of
pydicom.dataset.FileDatasetobjects with information on the CT slices.computed_tomography (dict) – Dictionary with information on the CT images.
- Returns:
segmentation – Dictionary with information on the segmented structures.
- Return type:
dict
- Raises:
ValueError – If the contour sequence for a segment includes out-of-slice points.
- pyanno4rt.patient.import_functions.generate_segmentation_from_mat(data, computed_tomography)[source]
Generate the segmentation dictionary from a MATLAB (.mat) file.
- Parameters:
data (ndarray) – Array with information on the segmented structures.
computed_tomography (dict) – Dictionary with information on the CT images.
- Returns:
segmentation – Dictionary with information on the segmented structures.
- Return type:
dict
- pyanno4rt.patient.import_functions.generate_segmentation_from_p(data, computed_tomography)[source]
Generate the segmentation dictionary from a Python binary (.p) file.
- Parameters:
data (dict) – Dictionary with information on the segmented structures.
computed_tomography (dict) – Dictionary with information on the CT images.
- Returns:
Dictionary with information on the segmented structures.
- Return type:
dict
- pyanno4rt.patient.import_functions.import_from_dcm(path, resolution)[source]
Import the patient data from a folder with DICOM (.dcm) files.
- Parameters:
path (str) – Path to the DICOM folder.
resolution (None or list) – Imaging resolution for post-processing interpolation of the CT and segmentation data.
- Returns:
dict – Dictionary with information on the CT images.
dict – Dictionary with information on the segmented structures.
- pyanno4rt.patient.import_functions.import_from_mat(path, resolution)[source]
Import the patient data from a MATLAB (.mat) file.
- Parameters:
path (str) – Path to the MATLAB file.
resolution (None or list) – Imaging resolution for post-processing interpolation of the CT and segmentation data.
- Returns:
dict – Dictionary with information on the CT images.
dict – Dictionary with information on the segmented structures.
- pyanno4rt.patient.import_functions.import_from_p(path, resolution)[source]
Import the patient data from a Python (.p) file.
- Parameters:
path (str) – Path to the Python file.
resolution (None or list) – Imaging resolution for post-processing interpolation of the CT and segmentation data.
- Returns:
dict – Dictionary with information on the CT images.
dict – Dictionary with information on the segmented structures.
- pyanno4rt.patient.import_functions.read_data_from_dcm(path)[source]
Read the DICOM data from the path.
- Parameters:
path (str) – Path to the DICOM folder.
- Returns:
computed_tomography_data (tuple) – Tuple of
pydicom.dataset.FileDatasetobjects with information on the CT slices.segmentation_data (object of class
pydicom.dataset.FileDataset) – The object representation of the segmentation data.