pytomography.corrections.ct_correction
#
Module Contents#
Classes#
Correction network used to correct for attenuation correction in projection operators. In particular, this network is used with other correction networks to model \(c\) in \(\sum_i c_{ij} a_i\) (forward projection) and \(\sum c_{ij} b_j\) (back projection). |
Functions#
|
Converts an attenuation map of \(\text{cm}^{-1}\) to a probability of photon detection matrix (scanner at +x). Note that this requires the attenuation map to be at the energy of photons being emitted. |
- pytomography.corrections.ct_correction.get_prob_of_detection_matrix(CT, dx)#
Converts an attenuation map of \(\text{cm}^{-1}\) to a probability of photon detection matrix (scanner at +x). Note that this requires the attenuation map to be at the energy of photons being emitted.
- Parameters:
CT (torch.tensor) – Tensor of size [batch_size, Lx, Ly, Lz] corresponding to the attenuation coefficient in :math:`{text{cm}^{-1}}
dx (float) – Axial plane pixel spacing.
- Returns:
Tensor of size [batch_size, Lx, Ly, Lz] corresponding to probability of photon being detected at detector at +x axis.
- Return type:
torch.tensor
- class pytomography.corrections.ct_correction.CTCorrectionNet(CT, device='cpu')#
Bases:
pytomography.corrections.CorrectionNet
Correction network used to correct for attenuation correction in projection operators. In particular, this network is used with other correction networks to model \(c\) in \(\sum_i c_{ij} a_i\) (forward projection) and \(\sum c_{ij} b_j\) (back projection).
- Parameters:
CT (torch.tensor) – Tensor of size [batch_size, Lx, Ly, Lz] corresponding to the attenuation coefficient in \({\text{cm}^{-1}}\) at the photon energy corresponding to the particular scan
device (str, optional) – Pytorch computation device. Defaults to ‘cpu’.
- forward(object_i, i, norm_constant=None)#
Applies attenuation correction to an object that’s being detected on the right of its first axis.
- Parameters:
object_i (torch.tensor) – Tensor of size [batch_size, Lx, Ly, Lz] being projected along
axis=1
.i (int) – The projection index: used to find the corresponding angle in image space corresponding to
object_i
. In particular, the x axis (tensor axis=1) of the object is aligned with the detector at angle i.norm_constant (torch.tensor, optional) – A tensor used to normalize the output during back projection. Defaults to None.
- Returns:
Tensor of size [batch_size, Lx, Ly, Lz] such that projection of this tensor along the first axis corresponds to an attenuation corrected projection.
- Return type:
torch.tensor