pytomography.io.CT#

Input/output functions for the CT imaging modality. Currently, the data types supported are DICOM files.

Submodules#

Package Contents#

Functions#

open_CT_file(files_CT)

Given a list of seperate DICOM files, opens them up and stacks them together into a single CT image.

compute_max_slice_loc_CT(files_CT)

Obtains the maximum z-location from a list of CT DICOM files

compute_slice_thickness_CT(files_CT)

Compute the slice thickness for files that make up a CT scan. Though this information is often contained in the DICOM file, it is sometimes inconsistent with the ImagePositionPatient attribute, which gives the true location of the slices.

get_HU2mu_conversion(files_CT, CT_kvp, E_SPECT)

Obtains the HU to mu conversion function that converts CT data to the required linear attenuation value in units of 1/cm required for attenuation correction in SPECT/PET imaging.

pytomography.io.CT.open_CT_file(files_CT)[source]#

Given a list of seperate DICOM files, opens them up and stacks them together into a single CT image.

Parameters:

files_CT (Sequence[str]) – List of CT DICOM filepaths corresponding to different z slices of the same scan.

Returns:

CT scan in units of Hounsfield Units at the effective CT energy.

Return type:

np.array

pytomography.io.CT.compute_max_slice_loc_CT(files_CT)[source]#

Obtains the maximum z-location from a list of CT DICOM files

Parameters:

files_CT (Sequence[str]) – List of CT DICOM filepaths corresponding to different z slices of the same scan.

Returns:

Maximum z location

Return type:

float

pytomography.io.CT.compute_slice_thickness_CT(files_CT)[source]#

Compute the slice thickness for files that make up a CT scan. Though this information is often contained in the DICOM file, it is sometimes inconsistent with the ImagePositionPatient attribute, which gives the true location of the slices.

Parameters:

files_CT (Sequence[str]) – List of CT DICOM filepaths corresponding to different z slices of the same scan.

Returns:

Slice thickness of CT scan

Return type:

float

pytomography.io.CT.get_HU2mu_conversion(files_CT, CT_kvp, E_SPECT)[source]#

Obtains the HU to mu conversion function that converts CT data to the required linear attenuation value in units of 1/cm required for attenuation correction in SPECT/PET imaging.

Parameters:
  • files_CT (Sequence[str]) – CT data files

  • CT_kvp (float) – kVp value for CT scan

  • E_SPECT (float) – Energy of photopeak in SPECT scan

Returns:

Conversion function from HU to mu.

Return type:

function