pytomography.io#

Submodules#

Package Contents#

Functions#

simind_CT_to_data(headerfile)

Opens attenuation data from SIMIND output

simind_projections_to_data(headerfile[, distance])

Obtains ObjectMeta, ImageMeta, and projections from a SIMIND header file.

simind_MEW_to_data(headerfiles[, distance])

Opens multiple projection files corresponding to the primary, lower scatter, and upper scatter windows

get_SPECT_recon_algorithm_simind(projections_header[, ...])

dicom_projections_to_data(file)

Obtains ObjectMeta, ImageMeta, and projections from a .dcm file.

dicom_CT_to_data(files_CT[, file_NM])

dicom_MEW_to_data(file[, type])

get_SPECT_recon_algorithm_dicom(projections_file[, ...])

pytomography.io.simind_CT_to_data(headerfile)[source]#

Opens attenuation data from SIMIND output

Parameters:

headerfile (str) – Path to header file

Returns:

Tensor containing CT data.

Return type:

torch.tensor[Lx,Ly,Lz]

pytomography.io.simind_projections_to_data(headerfile, distance='cm')[source]#

Obtains ObjectMeta, ImageMeta, and projections from a SIMIND header file.

Parameters:
  • headerfile (str) – Path to the header file

  • distance (str, optional) – The units of measurements in the SIMIND file (this is required as input, since SIMIND uses mm/cm but doesn’t specify). Defaults to ‘cm’.

Returns:

Required information for reconstruction in PyTomography.

Return type:

(ObjectMeta, ImageMeta, torch.Tensor[1, Ltheta, Lr, Lz])

pytomography.io.simind_MEW_to_data(headerfiles, distance='cm')[source]#

Opens multiple projection files corresponding to the primary, lower scatter, and upper scatter windows

Parameters:
  • headerfiles (list[str]) – List of file paths to required files. Must be in order of: 1. Primary, 2. Lower Scatter, 3. Upper scatter

  • distance (str, optional) – The units of measurements in the SIMIND file (this is required as input, since SIMIND uses mm/cm but doesn’t specify). Defaults to ‘cm’.

Returns:

Required information for reconstruction in PyTomography. First returned tensor contains primary data, and second returned tensor returns estimated scatter using the triple energy window method.

Return type:

(ObjectMeta, ImageMeta, torch.Tensor[1, Ltheta, Lr, Lz], torch.Tensor[1, Ltheta, Lr, Lz])

pytomography.io.get_SPECT_recon_algorithm_simind(projections_header, scatter_headers=None, CT_header=None, psf_meta=None, prior=None, object_initial=None, recon_algorithm_class=OSEMOSL)[source]#
Parameters:
Return type:

torch.nn.Module

pytomography.io.dicom_projections_to_data(file)[source]#

Obtains ObjectMeta, ImageMeta, and projections from a .dcm file.

Parameters:

file (str) – Path to the .dcm file

Returns:

Required information for reconstruction in PyTomography.

Return type:

(ObjectMeta, ImageMeta, torch.Tensor[1, Ltheta, Lr, Lz])

pytomography.io.dicom_CT_to_data(files_CT, file_NM=None)[source]#
pytomography.io.dicom_MEW_to_data(file, type='DEW')[source]#
pytomography.io.get_SPECT_recon_algorithm_dicom(projections_file, atteunation_files=None, use_psf=False, scatter_type=None, prior=None, recon_algorithm_class=OSEMOSL, object_initial=None)[source]#
Parameters:
  • projections_file (str) –

  • atteunation_files (Sequence[str]) –

  • use_psf (bool) –

  • scatter_type (str | None) –

  • prior (pytomography.priors.Prior) –

  • recon_algorithm_class (torch.nn.Module) –

  • object_initial (torch.Tensor | None) –

Return type:

torch.nn.Module