-
etspy.base.TomoStack.reconstruct(method: 'FBP' | 'SIRT' | 'SART' | 'DART' =
'FBP', iterations: int =5, constrain: bool =False, thresh: float =0, cuda: bool | None =None, thickness: int | None =None, show_progressbar: bool =True, p: float =0.99, ncores: int | None =None, sino_filter: 'ram-lak' | 'shepp-logan' | 'cosine' | 'hamming' | 'hann' | 'none' | 'tukey' | 'lanczos' | 'triangular' | 'gaussian' | 'barlett-hann' | 'blackman' | 'nuttall' | 'blackman-harris' | 'blackman-nuttall' | 'flat-top' | 'kaiser' | 'parzen' | 'projection' | 'sinogram' | 'rprojection' | 'rsinogram' ='shepp-logan', dart_iterations: int | None =5, gray_levels: list | ndarray | None =None) RecStack[source] Reconstruct a TomoStack series using one of the available methods.
- Parameters:¶
- method: 'FBP' | 'SIRT' | 'SART' | 'DART' =
'FBP'¶ Reconstruction algorithm to use. Must be one of
"FBP"(default),"SIRT","SART", or"DART"- iterations: int =
5¶ Number of iterations for the SIRT reconstruction (used with
SIRT,SART, andDARTmethods) (default: 5)- constrain: bool =
False¶ If
True, output reconstruction is constrained above value given bythresh- thresh: float =
0¶ Value above which to constrain the reconstructed data
- cuda: bool | None =
None¶ Whether or not to use CUDA-accelerated reconstruction algorithms. If
None(the default), the decision to use CUDA will be left toastra.astra.use_cuda().- thickness: int | None =
None¶ Size of the output volume (in pixels) in the projection direction. If
None, the y-size of the stack is used.- show_progressbar: bool =
True¶ If
True, show a progress bar for the reconstruction. Default isTrue.- p: float =
0.99¶ Probability for setting free pixels in DART reconstruction (only used if the reconstruction method is DART, default: 0.99)
- ncores: int | None =
None¶ Number of cores to use for multithreaded reconstructions.
- sino_filter: 'ram-lak' | 'shepp-logan' | 'cosine' | 'hamming' | 'hann' | 'none' | 'tukey' | 'lanczos' | 'triangular' | 'gaussian' | 'barlett-hann' | 'blackman' | 'nuttall' | 'blackman-harris' | 'blackman-nuttall' | 'flat-top' | 'kaiser' | 'parzen' | 'projection' | 'sinogram' | 'rprojection' | 'rsinogram' =
'shepp-logan'¶ Filter for filtered backprojection. Default is
"shepp-logan". Available options are detailed in the Astra Toolbox documentation under thecfg.FilterTypeoption of FBP_CUDA.- dart_iterations: int | None =
5¶ Number of iterations to employ for DART reconstruction
- gray_levels: list | ndarray | None =
None¶ List of gray levels to use for DART reconstruction
- method: 'FBP' | 'SIRT' | 'SART' | 'DART' =
- Returns:¶
rec – RecStack containing the reconstructed volume
- Return type:¶
Examples¶
- Filtered backprojection (FBP) reconstruction:
>>> import etspy.datasets as ds >>> stack = ds.get_needle_data(aligned=True) >>> slices = stack.isig[:, 120:121].deepcopy() >>> rec = slices.reconstruct('FBP', cuda=False, show_progressbar=False)- Simultaneous iterative reconstruction technique (SIRT) reconstruction:
>>> import etspy.datasets as ds >>> stack = ds.get_needle_data(aligned=True) >>> slices = stack.isig[:, 120:121].deepcopy() >>> rec = slices.reconstruct('SIRT',iterations=5, ... cuda=False, show_progressbar=False)- SIRT reconstruction with positivity constraint:
>>> import etspy.datasets as ds >>> stack = ds.get_needle_data(aligned=True) >>> slices = stack.isig[:, 120:121].deepcopy() >>> iterations = 5 >>> constrain = True >>> thresh = 0 >>> rec = slices.reconstruct('SIRT', iterations, constrain, thresh, ... cuda=False, show_progressbar=False)- Discreate algebraice reconstruction technique (DART) reconstruction:
>>> import etspy.datasets as ds >>> stack = ds.get_needle_data(aligned=True) >>> slices = stack.isig[:, 120:121].deepcopy() >>> gray_levels = [0., slices.data.max()/2, slices.data.max()] >>> rec = slices.reconstruct('DART', iterations=5, cuda=False, ... gray_levels=gray_levels, p=0.99, ... dart_iterations=5, show_progressbar=False)