pytomography.projectors.shared
#
Submodules#
Package Contents#
Classes#
Given a KEM transform \(K\) and a system matrix \(H\), implements the transform \(HK\) (and backward transform \(K^T H^T\)) |
|
Abstract class for a general system matrix \(H:\mathbb{U} \to \mathbb{V}\) which takes in an object \(f \in \mathbb{U}\) and maps it to corresponding projections \(g \in \mathbb{V}\) that would be produced by the imaging system. A system matrix consists of sequences of object-to-object and proj-to-proj transforms that model various characteristics of the imaging system, such as attenuation and blurring. While the class implements the operator \(H:\mathbb{U} \to \mathbb{V}\) through the |
- class pytomography.projectors.shared.KEMSystemMatrix(system_matrix, kem_transform)[source]#
Bases:
pytomography.projectors.system_matrix.SystemMatrix
Given a KEM transform \(K\) and a system matrix \(H\), implements the transform \(HK\) (and backward transform \(K^T H^T\))
- Parameters:
system_matrix (SystemMatrix) – System matrix corresponding to a particular imaging system
kem_transform (KEMTransform) – Transform used to go from coefficient image to real image of predicted counts.
- compute_normalization_factor(subset_idx=None)[source]#
Function used to get normalization factor \(K^T 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 \(K^T H^T_m 1\)
- Return type:
torch.Tensor
- forward(object, subset_idx=None)[source]#
Forward transform \(HK\)
- Parameters:
object (torch.tensor) – 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:
Corresponding projections generated from forward projection
- Return type:
torch.tensor
- backward(proj, subset_idx=None, return_norm_constant=False)[source]#
Backward transform \(K^T H^T\)
- Parameters:
proj (torch.tensor) – Projection data 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, optional) – Additionally returns \(K^T H^T 1\) if true; defaults to False.
- Returns:
Corresponding object generated from back projection.
- Return type:
torch.tensor
- class pytomography.projectors.shared.MotionSystemMatrix(system_matrices, motion_transforms)[source]#
Bases:
pytomography.projectors.system_matrix.ExtendedSystemMatrix
Abstract class for a general system matrix \(H:\mathbb{U} \to \mathbb{V}\) which takes in an object \(f \in \mathbb{U}\) and maps it to corresponding projections \(g \in \mathbb{V}\) that would be produced by the imaging system. A system matrix consists of sequences of object-to-object and proj-to-proj transforms that model various characteristics of the imaging system, such as attenuation and blurring. While the class implements the operator \(H:\mathbb{U} \to \mathbb{V}\) through the
forward
method, it also implements \(H^T:\mathbb{V} \to \mathbb{U}\) through the backward method, required during iterative reconstruction algorithms such as OSEM.- Parameters:
obj2obj_transforms (Sequence[Transform]) – Sequence of object mappings that occur before forward projection.
im2im_transforms (Sequence[Transform]) – Sequence of proj mappings that occur after forward projection.
object_meta (ObjectMeta) – Object metadata.
proj_meta (ProjMeta) – Projection metadata.
system_matrices (collections.abc.Sequence[pytomography.projectors.SystemMatrix]) –
motion_transforms (collections.abc.Sequence[pytomography.transforms.Transform]) –