nifti2dicom package๏
Submodules๏
nifti2dicom.conf module๏
nifti2dicom.constants module๏
nifti2dicom.converter module๏
- nifti2dicom.converter.check_directory_exists(directory_path: str) None[source][source]๏
Checks if the specified directory exists.
- Parameters:
directory_path (str) โ The path to the directory.
- Raises:
Exception if the directory does not exist.
- nifti2dicom.converter.load_reference_dicom_series(directory_path: str) tuple[source][source]๏
Loads a DICOM series from a directory.
- nifti2dicom.converter.save_dicom_from_nifti_image(ref_dir, nifti_path, output_dir, series_description, vendor, force_overwrite=False)[source][source]๏
Convert a NIfTI image to a DICOM series. :param ref_dir: DICOM series directory which serves as a reference for the conversion :type ref_dir: str :param nifti_path: Path to the nifti file :type nifti_path: str :param output_dir: Output directory to store the converted DICOM series :type output_dir: str :param series_description: Series description to be added to the DICOM header :type series_description: str :param vendor: The vendor from which the DICOM series was obtained (ux or sms) :type vendor: str :param force_overwrite: Force overwrite of the output directory if it already exists :type force_overwrite: bool :return:
- nifti2dicom.converter.save_dicom_from_nifti_seg(nifti_file: str, ref_dicom_series_dir: str, output_path: str, ORGAN_INDEX: dict) None[source][source]๏
Convert a NIFTI segmentation image to a DICOM Segmentation object. :param nifti_file: Path to the NIFTI segmentation file. :type nifti_file: str :param ref_dicom_series_dir: Path to the directory containing the reference DICOM series. :type ref_dicom_series_dir: str :param output_path: Path to the directory where the converted DICOM files will be saved. :type output_path: str :param ORGAN_INDEX: Dictionary containing the organ index. :type ORGAN_INDEX: dict
- nifti2dicom.converter.save_slice(slice_data, normalized_data, series_description, filename, output_dir, modality, vendor)[source][source]๏
Save a DICOM slice to a file. :param slice_data: DICOM slice data :type slice_data: Dataset :param normalized_data: Normalized data from the NIfTI image :type normalized_data: numpy.ndarray :param series_description: Description of the series :type series_description: str :param filename: output filename of the converted DICOM slice :type filename: str :param output_dir: output directory to store the converted DICOM slice :type output_dir: str :param modality: Modality of the image (CT or PT) :type modality: str :param vendor: Vendor from which the DICOM series was obtained (ux or sms) :type vendor: str :return: None