pytomography.io.SPECT.simind — PyTomography 0.8.0 documentation

Skip to main content
`Ctrl`+`K`

# `pytomography.io.SPECT.simind`

## Module Contents

### Functions

`find_first_entry_containing_header`(list_of_attributes, ...) | Finds the first entry in a SIMIND Interfile output corresponding to the header (header).
`get_projections`(headerfile[, distance]) | Obtains ObjectMeta, ImageMeta, and projections from a SIMIND header file.
`get_scatter_from_TEW`(headerfile_peak, ...[, distance]) | Obtains a triple energy window scatter estimate from corresponding photopeak, lower, and upper energy windows.
`combine_projection_data`(headerfiles, weights) | Takes in a list of SIMIND headerfiles corresponding to different simulated regions and adds the projection data together based on the weights.
`combine_scatter_data_TEW`(headerfiles_peak, ...) | Computes the triple energy window scatter estimate of the sequence of projection data weighted by weights. See combine_projection_data for more details.
`get_atteuation_map`(headerfile) | Opens attenuation data from SIMIND output
`get_psfmeta_from_header`(headerfile) | Obtains the PSFMeta data corresponding to a SIMIND simulation scan from the headerfile
`get_SPECT_recon_algorithm_simind`(projections_header[, ...]) |

### Attributes

`relation_dict` |

pytomography.io.SPECT.simind.relation_dict

pytomography.io.SPECT.simind.find_first_entry_containing_header(list_of_attributes, header, dtype=np.float32)

  Finds the first entry in a SIMIND Interfile output corresponding to the header (header).

  Parameters:

    - list_of_attributes (list[str]) – Simind data file, as a list of lines.

    - header (str) – The header looked for

    - dtype (type, optional) – The data type to be returned corresponding to the value of the header. Defaults to np.float32.

  Returns:

    The value corresponding to the header (header).

  Return type:

    float|str|int

pytomography.io.SPECT.simind.get_projections(headerfile, distance='cm')

  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.SPECT.simind.get_scatter_from_TEW(headerfile_peak, headerfile_lower, headerfile_upper, distance='cm')

  Obtains a triple energy window scatter estimate from corresponding photopeak, lower, and upper energy windows.

  Parameters:

    - headerfile_peak (str) – Headerfile corresponding to the photopeak

    - headerfile_lower (str) – Headerfile corresponding to the lower energy window

    - headerfile_upper (str) – Headerfile corresponding to the upper energy window

    - 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:

    Estimated scatter from the triple energy window.

  Return type:

    torch.Tensor[1, Ltheta, Lr, Lz]

pytomography.io.SPECT.simind.combine_projection_data(headerfiles, weights)

  Takes in a list of SIMIND headerfiles corresponding to different simulated regions and adds the projection data together based on the weights.

  Parameters:

    - headerfiles (Sequence[str]) – List of filepaths corresponding to the SIMIND header files of different simulated regions

    - weights (Sequence[str]) – Amount by which to weight each projection relative.

  Returns:

    Returns necessary object/image metadata along with the projection data

  Return type:

    (ObjectMeta, ImageMeta, torch.Tensor)

pytomography.io.SPECT.simind.combine_scatter_data_TEW(headerfiles_peak, headerfiles_lower, headerfiles_upper, weights)

  Computes the triple energy window scatter estimate of the sequence of projection data weighted by weights. See combine_projection_data for more details.

  Parameters:

    - headerfiles_peak (Sequence[str]) – List of headerfiles corresponding to the photopeak

    - headerfiles_lower (Sequence[str]) – List of headerfiles corresponding to the lower scatter window

    - headerfiles_upper (Sequence[str]) – List of headerfiles corresponding to the upper scatter window

    - weights (Sequence[float]) – Amount by which to weight each set of projection data by.

  Returns:

    _description_

  Return type:

    _type_

pytomography.io.SPECT.simind.get_atteuation_map(headerfile)

  Opens attenuation data from SIMIND output

  Parameters:

    headerfile (str) – Path to header file

  Returns:

    Tensor containing attenuation map required for attenuation correction in SPECT/PET imaging.

  Return type:

    torch.Tensor[batch_size, Lx, Ly, Lz]

pytomography.io.SPECT.simind.get_psfmeta_from_header(headerfile)

  Obtains the PSFMeta data corresponding to a SIMIND simulation scan from the headerfile

  Parameters:

    headerfile (str) – SIMIND headerfile.

  Returns:

    PSF metadata required for PSF modeling in reconstruction.

  Return type:

    PSFMeta

pytomography.io.SPECT.simind.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)
  Parameters:

    - projections_header (str) –

    - scatter_headers (Sequence[str] | None) –

    - CT_header (str) –

    - psf_meta (pytomography.metadata.PSFMeta) –

    - prior (pytomography.priors.Prior) –

    - object_initial (torch.Tensor | None) –

    - recon_algorithm_class (torch.nn.Module) –

  Return type:

    torch.nn.Module