pytomography.metadata.SPECT#

Submodules#

Package Contents#

Classes#

SPECTObjectMeta

Metadata for object space in SPECT imaging. Required for padding of object space during the rotate+sum method

SPECTProjMeta

Metadata for projection space in SPECT imaging

SPECTPSFMeta

Metadata for PSF correction. PSF blurring is implemented using Gaussian blurring with \(\sigma(r) = f(r,p)\) where \(r\) is the distance from the detector, \(\sigma\) is the width of the Gaussian blurring at that location, and \(f(r,p)\) is the sigma_fit function which takes in additional parameters \(p\) called sigma_fit_params. (By default, sigma_fit is a linear curve). As such, \(\frac{1}{\sigma\sqrt{2\pi}}e^{-r^2/(2\sigma(r)^2)}\) is the point spread function. Blurring is implemented using convolutions with a specified kernel size.

StarGuideProjMeta

Parent class for all different types of Projection Space Metadata. Implementation and required parameters will differ significantly between different imaging modalities.

class pytomography.metadata.SPECT.SPECTObjectMeta(dr, shape)[source]#

Bases: pytomography.metadata.metadata.ObjectMeta

Metadata for object space in SPECT imaging. Required for padding of object space during the rotate+sum method

Parameters:
  • dr (list[float]) – List of 3 elements specifying voxel dimensions in cm.

  • shape (list[int]) – List of 3 elements [Lx, Ly, Lz] specifying the length of each dimension.

compute_padded_shape()[source]#

Computes the padded shape of an object required when rotating the object (to avoid anything getting cut off).

Return type:

list

class pytomography.metadata.SPECT.SPECTProjMeta(projection_shape, dr, angles, radii=None)[source]#

Bases: pytomography.metadata.metadata.ProjMeta

Metadata for projection space in SPECT imaging

Parameters:
  • projection_shape (Sequence) – 2D shape of each projection

  • dr (Sequence) – Pixel dimensions of projection data in cm

  • angles (Sequence) – The angles for each 2D projection

  • radii (Sequence, optional) – Specifies the radial distance (in cm) of the detector corresponding to each angle in angles; only required in certain cases (i.e. PSF correction). Defaults to None.

compute_padded_shape()[source]#

Computes the padded shape of an object required when rotating the object (to avoid anything getting cut off).

Return type:

list

class pytomography.metadata.SPECT.SPECTPSFMeta(sigma_fit_params, sigma_fit=lambda r, a, b: ..., kernel_dimensions='2D', min_sigmas=3, shape='gaussian')[source]#

Metadata for PSF correction. PSF blurring is implemented using Gaussian blurring with \(\sigma(r) = f(r,p)\) where \(r\) is the distance from the detector, \(\sigma\) is the width of the Gaussian blurring at that location, and \(f(r,p)\) is the sigma_fit function which takes in additional parameters \(p\) called sigma_fit_params. (By default, sigma_fit is a linear curve). As such, \(\frac{1}{\sigma\sqrt{2\pi}}e^{-r^2/(2\sigma(r)^2)}\) is the point spread function. Blurring is implemented using convolutions with a specified kernel size.

Parameters:
  • sigma_fit_params (float) – Parameters to the sigma fit function

  • sigma_fit (function) – Function used to model blurring as a function of radial distance. Defaults to a 2 parameter linear model.

  • kernel_dimensions (str) – If ‘1D’, blurring is done seperately in each axial plane (so only a 1 dimensional convolution is used). If ‘2D’, blurring is mixed between axial planes (so a 2D convolution is used). Defaults to ‘2D’.

  • min_sigmas (float, optional) – This is the number of sigmas to consider in PSF correction. PSF are modelled by Gaussian functions whose extension is infinite, so we need to crop the Gaussian when computing this operation numerically. Note that the blurring width is depth dependent, but the kernel size used for PSF blurring is constant. As such, this parameter is used to fix the kernel size such that all locations have at least min_sigmas of a kernel size.

  • shape (str, optional) – Shape of the PSF. Defaults to ‘gaussian’, in which case sigma is the sigma of the Gaussian. Can also be ‘square’ for square collimators, in this case sigma is half the diameter of the bore.

__repr__()[source]#

Return repr(self).

class pytomography.metadata.SPECT.StarGuideProjMeta(projection_shape, angles, times=None, offsets=None, radii=None)[source]#

Bases: pytomography.metadata.ProjMeta

Parent class for all different types of Projection Space Metadata. Implementation and required parameters will differ significantly between different imaging modalities.

Parameters:
  • projection_shape (Sequence) –

  • angles (Sequence) –

  • radii (Sequence | None) –