pytomography.io.SPECT.simind
#
Module Contents#
Functions#
|
Obtains required metadata from a SIMIND header file. |
|
Gets projection data from a SIMIND header file. |
|
Obtains a triple energy window scatter estimate from corresponding photopeak, lower, and upper energy windows. |
|
Takes in a list of SIMIND headerfiles corresponding to different simulated regions and adds the projection data together based on the weights. |
|
Computes the triple energy window scatter estimate of the sequence of projection data weighted by weights. See combine_projection_data for more details. |
|
Opens attenuation data from SIMIND output |
|
Obtains the SPECTPSFMeta data corresponding to a SIMIND simulation scan from the headerfile |
Attributes#
- pytomography.io.SPECT.simind.get_metadata(headerfile, distance='cm', corrfile=None)[source]#
Obtains required metadata 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’.
corrfile (str, optional) – .cor file used in SIMIND to specify radial positions for non-circular orbits. This needs to be provided for non-standard orbits.
- Returns:
Required information for reconstruction in PyTomography.
- Return type:
(SPECTObjectMeta, SPECTProjMeta, torch.Tensor[1, Ltheta, Lr, Lz])
- pytomography.io.SPECT.simind.get_projections(headerfile)[source]#
Gets projection data 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:
Simulated SPECT projection data.
- Return type:
(torch.Tensor[1, Ltheta, Lr, Lz])
- pytomography.io.SPECT.simind.get_scatter_from_TEW(headerfile_peak, headerfile_lower, headerfile_upper)[source]#
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
- 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)[source]#
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/projections metadata along with the projection data
- Return type:
(SPECTObjectMeta, SPECTProjMeta, torch.Tensor)
- pytomography.io.SPECT.simind.combine_scatter_data_TEW(headerfiles_peak, headerfiles_lower, headerfiles_upper, weights)[source]#
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_attenuation_map(headerfile)[source]#
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)[source]#
Obtains the SPECTPSFMeta data corresponding to a SIMIND simulation scan from the headerfile
- Parameters:
headerfile (str) – SIMIND headerfile.
- Returns:
SPECT PSF metadata required for PSF modeling in reconstruction.
- Return type: