PyMAIA.utils.volume_utils module#
- PyMAIA.utils.volume_utils.convert_DICOM_folder_to_NIFTI_image(patient_dicom_folder, patient_nifti_folder)[source]#
Converts a given Patient DICOM folder into NIFTI format, saving the DICOM Studies in different folders.
- Parameters:
patient_dicom_folder (
Union[str,PathLike]) – DICOM folder containing a single patient Studies.patient_nifti_folder (
Union[str,PathLike]) – Output NIFTI folder used as stem to save the DICOM Studies. The Study index is appended to this path to create the corresponding NIFTI study folder path.
- Return type:
Dict[str,str]- Returns:
Dictionary mapping each Patient -> Study ID to the corresponding StudyInstanceUID
- PyMAIA.utils.volume_utils.dcm2nii_CT(CT_dcm_path, nii_out_path)[source]#
Conversion of CT DICOM to nifti and save in nii_out_path.
- Parameters:
CT_dcm_path (
Union[str,PathLike]) – CT DICOM folder path.nii_out_path (
Union[str,PathLike]) – Output NIFTI file path.
- PyMAIA.utils.volume_utils.dcm2nii_mask(mask_dcm_path, nii_out_path, ref_nii_path)[source]#
Converts a SEG DICOM volume into NIFTI format. Requires an existing NIFTI file to derive the corresponding affine transform.
- Parameters:
mask_dcm_path (
Union[str,PathLike]) – SEG DICOM folder.nii_out_path (
Union[str,PathLike]) – NIFTI file saved as output.ref_nii_path (
Union[str,PathLike]) – Reference NIFTI used to correctly saved the segmentation volume.
- PyMAIA.utils.volume_utils.dcm2nii_seg(mask_dcm_path, nii_out_path, ref_nii_path)[source]#
Conversion of SEG DICOM to NIFTI, using a reference NIFTI image.
- Parameters:
mask_dcm_path (
Union[str,PathLike]) – SEG DICOM folder.nii_out_path (
Union[str,PathLike]) – NIFTI file saved as output.ref_nii_path (
str) – Reference NIFTI used to correctly saved the segmentation volume.
- PyMAIA.utils.volume_utils.normalize_PET_to_SUV_BW(dicom_pet_series_folder, suv_pet_filename)[source]#
SUV BW Normalization of DICOM PET volume. The resulting normalized PET volume is saved at suv_pet_filename.
- Parameters:
dicom_pet_series_folder (
Union[str,PathLike]) – DICOM PET Folder to be normalized.suv_pet_filename (
Union[str,PathLike]) – Normalized SUV PET file location.
- PyMAIA.utils.volume_utils.resample_image(nii_input_path, nii_ref_path, nii_out_path)[source]#
Resample Input NIFTI to match Reference NIFTI size and spacing.
- Parameters:
nii_input_path (
Union[str,PathLike]) – Input NIFTI File Path.nii_ref_path (
Union[str,PathLike]) – Reference NIFTI File Path.nii_out_path (
Union[str,PathLike]) – Resampled Output NIFTI File Path.