pytomography.io.shared.dicom_creation#

Module Contents#

Functions#

get_file_meta(SOP_instance_UID, SOP_class_UID)

Creates DICOM file metadata given an SOP instance and class UID.

generate_base_dataset(SOP_instance_UID, SOP_class_UID)

Generates a base dataset with the minimal number of required parameters

add_required_elements_to_ds(ds)

Adds elements to dataset including timing and manufacturer details

add_study_and_series_information(ds, reference_ds)

Adds study and series information to dataset based on reference dataset

add_patient_information(ds, reference_ds)

Adds patient information to dataset based on reference dataset

create_ds(reference_ds, SOP_instance_UID, ...)

Creates a new DICOM dataset based on a reference dataset with all required headers. Because this is potentially used to save images corresponding to different modalities, the UIDs must be input arguments to this function. In addition, since some modalities require saving multiple slices whereby SOP_instance_UIDs may use some convention to specify slice number, these are also input arguments.

pytomography.io.shared.dicom_creation.get_file_meta(SOP_instance_UID, SOP_class_UID)[source]#

Creates DICOM file metadata given an SOP instance and class UID.

Parameters:
  • SOP_instance_UID (str) – Identifier unique to each DICOM file

  • SOP_class_UID (str) – Identifier specifying imaging modality

Returns:

Metadata for DICOM file

Return type:

FileMetaDataset

pytomography.io.shared.dicom_creation.generate_base_dataset(SOP_instance_UID, SOP_class_UID)[source]#

Generates a base dataset with the minimal number of required parameters

Parameters:
  • SOP_instance_UID (str) – Identifier unique to each DICOM file

  • SOP_class_UID (str) – Identifier specifying imaging modality

Returns:

DICOM dataset

Return type:

FileDataset

pytomography.io.shared.dicom_creation.add_required_elements_to_ds(ds)[source]#

Adds elements to dataset including timing and manufacturer details

Parameters:

ds (FileDataset) – DICOM dataset that will be updated

Return type:

None

pytomography.io.shared.dicom_creation.add_study_and_series_information(ds, reference_ds)[source]#

Adds study and series information to dataset based on reference dataset

Parameters:
  • ds (FileDataset) – Dataset for which to add headers

  • reference_ds (FileDataset) – Dataset from which to copy headers

Return type:

None

pytomography.io.shared.dicom_creation.add_patient_information(ds, reference_ds)[source]#

Adds patient information to dataset based on reference dataset

Parameters:
  • ds (FileDataset) – Dataset for which to add headers

  • reference_ds (FileDataset) – Dataset from which to copy headers

pytomography.io.shared.dicom_creation.create_ds(reference_ds, SOP_instance_UID, SOP_class_UID, modality)[source]#

Creates a new DICOM dataset based on a reference dataset with all required headers. Because this is potentially used to save images corresponding to different modalities, the UIDs must be input arguments to this function. In addition, since some modalities require saving multiple slices whereby SOP_instance_UIDs may use some convention to specify slice number, these are also input arguments.

Parameters:
  • reference_ds (FileDataset) – Dataset from which to copy all important headers such as patient information and study UID.

  • SOP_instance_UID (str) – Unique identifier for the particular instance (this is different for every DICOM file created)

  • SOP_class_UID (str) – Unique identifier for the imaging modality

  • modality (str) – String specifying imaging modality

Returns:

_description_

Return type:

_type_