pytomography.projectors.CT#
Submodules#
Package Contents#
Classes#
System matrix for a cone beam CT system with a flat detector panel. Backprojection supports FBP, but only for non-helical (i.e. fixed z) geometries. |
|
System matrix for 3rd generation clinical DICOM scanners with cylindrical detector panels. For more information, see the DICOM-CTPD user manual. |
- class pytomography.projectors.CT.CTConeBeamFlatPanelSystemMatrix(object_meta, proj_meta, N_splits=1, device=pytomography.device)[source]#
Bases:
pytomography.projectors.SystemMatrixSystem matrix for a cone beam CT system with a flat detector panel. Backprojection supports FBP, but only for non-helical (i.e. fixed z) geometries.
- Parameters:
object_meta (ObjectMeta) – Metadata for object space
proj_meta (CTConeBeamFlatPanelProjMeta) – Projection metadata for the CT system
N_splits (int, optional) – Splits up computation of forward/back projection to save GPU memory. Defaults to 1.
device (str, optional) – Device on which projections are output. Defaults to pytomography.device.
- set_n_subsets(n_subsets)[source]#
Returns a list where each element consists of an array of indices corresponding to a partitioned version of the projections.
- Parameters:
n_subsets (int) – Number of subsets to partition the projections into
- Returns:
List of arrays where each array corresponds to the projection indices of a particular subset.
- Return type:
list
- get_projection_subset(projections, subset_idx)[source]#
Obtains subsampled projections \(g_m\) corresponding to subset index \(m\). CT conebeam flat panel partitions projections based on angle.
- Parameters:
projections (torch.Tensor) – total projections \(g\)
subset_idx (int) – subset index \(m\)
- Returns:
subsampled projections \(g_m\).
- Return type:
torch.Tensor
- get_weighting_subset(subset_idx)[source]#
Computes the relative weighting of a given subset (given that the projection space is reduced). This is used for scaling parameters relative to \(\tilde{H}_m^T 1\) in reconstruction algorithms, such as prior weighting \(\beta\)
- Parameters:
subset_idx (int) – Subset index
- Returns:
Weighting for the subset.
- Return type:
float
- compute_normalization_factor(subset_idx=None)[source]#
Computes the normalization factor \(H^T 1\)
- Parameters:
subset_idx (int, optional) – Subset index for ths sinogram. If None, considers all elements. Defaults to None..
- Returns:
Normalization factor.
- Return type:
torch.Tensor
- forward(object, subset_idx=None, FBP_post_weight=None, projection_type='matched')[source]#
Computes forward projection
- Parameters:
object (torch.Tensor) – Object to be forward projected
subset_idx (int | None, optional) – Subset index \(m\) of the projection. If None, then projects to entire projection space. Defaults to None.
FBP_post_weight (torch.Tensor, optional) – _description_. Defaults to None.
projection_type (str) – Type of forward projection to use; defaults to mathced. (For implementing the adjoint of FBP, we need the option of using FBP weights in the forward projection).
- Returns:
Projections corresponding to \(\int \mu dx\) along all LORs.
- Return type:
torch.Tensor
- backward(proj, subset_idx=None, projection_type='matched')[source]#
Computes back projection.
- Parameters:
proj (torch.Tensor) – Projections to be back projected
subset_idx (int | None, optional) – Subset index \(m\) of the projection. Defaults to None.
projection_type (str, optional) – Type of back projection to use. To use with filtered back projection, use
'FBP', which weights all LORs accordingly for this geometry. Defaults to'matched'.
- Returns:
_description_
- Return type:
torch.Tensor
- class pytomography.projectors.CT.CTGen3SystemMatrix(object_meta, proj_meta, N_splits=1, device=pytomography.device)[source]#
Bases:
pytomography.projectors.SystemMatrixSystem matrix for 3rd generation clinical DICOM scanners with cylindrical detector panels. For more information, see the DICOM-CTPD user manual.
- Parameters:
object_meta (ObjectMeta) – Metadata for object space
proj_meta (CTConeBeamFlatPanelProjMeta) – Projection metadata for the CT system
N_splits (int, optional) – Splits up computation of forward/back projection to save GPU memory. Defaults to 1.
device (str, optional) – Device on which projections are output. Defaults to pytomography.device.
- get_weighting_subset(subset_idx)[source]#
Computes the relative weighting of a given subset (given that the projection space is reduced). This is used for scaling parameters relative to \(\tilde{H}_m^T 1\) in reconstruction algorithms, such as prior weighting \(\beta\)
- Parameters:
subset_idx (int) – Subset index
- Returns:
Weighting for the subset.
- Return type:
float
- get_projection_subset(projections, subset_idx)[source]#
Obtains subsampled projections \(g_m\) corresponding to subset index \(m\). CT conebeam flat panel partitions projections based on angle.
- Parameters:
projections (torch.Tensor) – total projections \(g\)
subset_idx (int) – subset index \(m\)
- Returns:
subsampled projections \(g_m\).
- Return type:
torch.Tensor
- set_n_subsets(n_subsets)[source]#
Returns a list where each element consists of an array of indices corresponding to a partitioned version of the projections.
- Parameters:
n_subsets (int) – Number of subsets to partition the projections into
- Returns:
List of arrays where each array corresponds to the projection indices of a particular subset.
- Return type:
list
- compute_normalization_factor(subset_idx)[source]#
Computes the normalization factor \(H^T 1\)
- Parameters:
subset_idx (int, optional) – Subset index for ths sinogram. If None, considers all elements. Defaults to None..
- Returns:
Normalization factor.
- Return type:
torch.Tensor
- forward(object, subset_idx=None, *args, **kwargs)[source]#
Computes forward projection
- Parameters:
object (torch.Tensor) – Object to be forward projected
subset_idx (int | None, optional) – Subset index \(m\) of the projection. If None, then projects to entire projection space. Defaults to None.
- Returns:
Projections corresponding to \(\int \mu dx\) along all LORs.
- Return type:
torch.Tensor
- backward(proj, subset_idx=None, *args, **kwargs)[source]#
Computes back projection
- Parameters:
object (torch.Tensor) – Object to be forward projected
subset_idx (int | None, optional) – Subset index \(m\) of the projection. If None, then projects to entire projection space. Defaults to None.
- Returns:
Projections corresponding to \(\int \mu dx\) along all LORs.
- Return type:
torch.Tensor