pytomography.projectors.SPECT.starguide_system_matrix#
Module Contents#
Classes#
System matrix for the StarGuide SPECT imaging system form General Electric Healthcare. |
- class pytomography.projectors.SPECT.starguide_system_matrix.StarGuideSystemMatrix(object_meta, proj_meta, obj2obj_transforms=[], proj2proj_transforms=[])[source]#
Bases:
pytomography.projectors.system_matrix.SystemMatrixSystem matrix for the StarGuide SPECT imaging system form General Electric Healthcare.
- Parameters:
obj2obj_transforms (Sequence[Transform]) – Sequence of object mappings that occur before forward projection.
proj2proj_transforms (Sequence[Transform]) – Sequence of proj mappings that occur after forward projection.
object_meta (SPECTObjectMeta) – SPECT Object metadata.
proj_meta (StarGuideProjMeta) – Projection metadata pertaining to the StarGuide system.
object_initial_based_on_camera_path (bool) – Whether or not to initialize the object estimate based on the camera path; this sets voxels to zero that are outside the SPECT camera path. Defaults to False.
- forward(object, subset_idx=None)[source]#
Applies forward projection to
object.- Parameters:
object (torch.tensor[Lx, Ly, Lz]) – The object to be forward projected
subset_idx (int, optional) – Only uses a subset of angles \(g_m\) corresponding to the provided subset index \(m\). If None, then defaults to the full projections \(g\).
- Returns:
forward projection estimate \(g_m=H_mf\)
- Return type:
torch.tensor
- backward(proj, subset_idx=None)[source]#
Applies back projection.
- Parameters:
proj (torch.tensor) – projections \(g\) which are to be back projected
subset_idx (int, optional) – Only uses a subset of angles \(g_m\) corresponding to the provided subset index \(m\). If None, then defaults to the full projections \(g\).
return_norm_constant (bool) – Whether or not to return \(H_m^T 1\) along with back projection. Defaults to ‘False’.
- Returns:
the object \(\hat{f} = H_m^T g_m\) obtained via back projection.
- Return type:
torch.tensor
- compute_normalization_factor(subset_idx=None)[source]#
Function used to get normalization factor \(H^T_m 1\) corresponding to projection subset \(m\).
- Parameters:
subset_idx (int | None, optional) – Index of subset. If none, then considers all projections. Defaults to None.
- Returns:
normalization factor \(H^T_m 1\)
- Return type:
torch.Tensor
- set_n_subsets(n_subsets)[source]#
Sets the subsets for this system matrix given
n_subsetstotal subsets.- Parameters:
n_subsets (int) – number of subsets used in OSEM
- Return type:
list
- get_projection_subset(projections, subset_idx)[source]#
Gets the subset of projections \(g_m\) corresponding to index \(m\).
- Parameters:
projections (torch.tensor) – full projections \(g\)
subset_idx (int) – subset index \(m\)
- Returns:
subsampled projections \(g_m\)
- Return type:
torch.tensor
- _translate_object(obj, translations)[source]#
Internal function that applies translations to an object with a batch size dimension.
- Parameters:
obj (torch.Tensor) – Object to be translated
translations (torch.Tensor) – Translations for each object in the batch
- Returns:
Translated object
- Return type:
torch.Tensor