nabu.reconstruction.mlem
source module nabu.reconstruction.mlem
Classes
-
CCTMLEMReconstructor — A reconstructor for MLEM reconstruction using the CorrCT toolbox.
Functions
-
has_corrct — corrct will create a cuda context upon importing any module. On the other hand, python will crash if creating a subprocess when cuda is already initialized. So to check whether corrct is available, we do the "try import" in a subprocess
source class CCTMLEMReconstructor(data_vwu_shape, angles_rad, shifts_uv=None, cor=None, n_iterations=50, extra_options=None)
A reconstructor for MLEM reconstruction using the CorrCT toolbox.
Parameters
-
data_vwu_shape : tuple — Shape of the input data, expected to be (n_slices, n_angles, n_dets). Raises an error if the shape is not 3D.
-
angles_rad : numpy.ndarray — Angles in radians for the projections. Must match the second dimension of
data_vwu_shape. -
shifts_vu : numpy.ndarray, optional. — Shifts in the v and u directions for each angle. If provided, must have the same number of cols as
angles_rad. Each col is (tv,tu) -
cor : float, optional — Center of rotation, which will be adjusted based on the sinogram width.
-
n_iterations : int, optional — Number of iterations for the MLEM algorithm. Default is 50.
-
extra_options : dict, optional — Additional options for the reconstruction process. Default options include:
- scale_factor (float, default is 1.0): Scale factor for the reconstruction.
- compute_shifts (boolean, default is False): Whether to compute shifts.
- tomo_consistency (boolean, default is False): Whether to enforce tomographic consistency.
- v_min_for_v_shifts (number, default is 0): Minimum value for vertical shifts.
- v_max_for_v_shifts (number, default is None): Maximum value for vertical shifts.
- v_min_for_u_shifts (number, default is 0): Minimum value for horizontal shifts.
- v_max_for_u_shifts (number, default is None): Maximum value for horizontal shifts.
Methods
-
reconstruct — data_align_vwu: numpy.ndarray or cupy array Raw data, with shape (n_sinograms, n_angles, width) output: optional Output array. If not provided, a new numpy array is returned
source method CCTMLEMReconstructor.reset_rot_center(cor)
source method CCTMLEMReconstructor.reconstruct(data_vwu, x0=None)
data_align_vwu: numpy.ndarray or cupy array Raw data, with shape (n_sinograms, n_angles, width) output: optional Output array. If not provided, a new numpy array is returned
source has_corrct(safe=True)
corrct will create a cuda context upon importing any module. On the other hand, python will crash if creating a subprocess when cuda is already initialized. So to check whether corrct is available, we do the "try import" in a subprocess
source class NabuMLEMReconstructor(sino_shape, slice_shape=None, angles=None, rot_center=None, halftomo=False, extra_options=None, cuda_options=None)
Methods
source method NabuMLEMReconstructor.reconstruct(sino, n_iterations=10, output=None, eps=1e-06)