Radon Projections¶
Parallel Beam¶
- class torch_radon.Radon(resolution: int, angles, det_count=- 1, det_spacing=1.0, clip_to_circle=False)[source]¶
Class that implements Radon projection for the Parallel Beam geometry.
- Parameters
resolution – The resolution of the input images.
angles – Array containing the list of measuring angles. Can be a Numpy array or a PyTorch tensor.
det_count – Number of rays that will be projected. By default it is =
resolutiondet_spacing – Distance between two contiguous rays.
clip_to_circle – If True both forward and backward projection will be restricted to pixels inside the circle (highlighted in cyan).
Note
Currently only support resolutions which are multiples of 16.
- forward(self, x)¶
Radon forward projection.
- Parameters
x – PyTorch GPU tensor with shape \((d_1, \dots, d_n, r, r)\) where \(r\) is the
resolutiongiven to the constructor of this class.- Returns
PyTorch GPU tensor containing sinograms. Has shape \((d_1, \dots, d_n, len(angles), det\_count)\).
- backprojection(self, sinogram)¶
Radon backward projection.
- Parameters
sinogram – PyTorch GPU tensor containing sinograms with shape \((d_1, \dots, d_n, len(angles), det\_count)\).
- Returns
PyTorch GPU tensor with shape \((d_1, \dots, d_n, r, r)\) where \(r\) is the
resolutiongiven to the constructor of this class.
- backward(self, sinogram)¶
Same as backprojection
Fanbeam¶
- class torch_radon.RadonFanbeam(resolution: int, angles, source_distance: float, det_distance: float = - 1, det_count: int = - 1, det_spacing: float = - 1, clip_to_circle=False)[source]¶
Class that implements Radon projection for the Fanbeam geometry.
- Parameters
resolution – The resolution of the input images.
angles – Array containing the list of measuring angles. Can be a Numpy array or a PyTorch tensor.
source_distance – Distance between the source of rays and the center of the image.
det_distance – Distance between the detector plane and the center of the image. By default it is =
source_distance.det_count – Number of rays that will be projected. By default it is =
resolution.det_spacing – Distance between two contiguous rays.
clip_to_circle – If True both forward and backward projection will be restricted to pixels inside the circle (highlighted in cyan).
Note
Currently only support resolutions which are multiples of 16.
- forward(self, x)¶
Radon forward projection.
- Parameters
x – PyTorch GPU tensor with shape \((d_1, \dots, d_n, r, r)\) where \(r\) is the
resolutiongiven to the constructor of this class.- Returns
PyTorch GPU tensor containing sinograms. Has shape \((d_1, \dots, d_n, len(angles), det\_count)\).
- backprojection(self, sinogram)¶
Radon backward projection.
- Parameters
sinogram – PyTorch GPU tensor containing sinograms with shape \((d_1, \dots, d_n, len(angles), det\_count)\).
- Returns
PyTorch GPU tensor with shape \((d_1, \dots, d_n, r, r)\) where \(r\) is the
resolutiongiven to the constructor of this class.
- backward(self, sinogram)¶
Same as backprojection