nabu.pipeline.estimators module¶
nabu.pipeline.estimators: helper classes/functions to estimate parameters of a dataset (center of rotation, detector tilt, etc).
- nabu.pipeline.estimators.estimate_cor(method, dataset_info, do_flatfield=True, cor_options: str | dict | None = None, logger=None)[source]¶
- class nabu.pipeline.estimators.CORFinderBase(method, dataset_info, do_flatfield=True, cor_options=None, logger=None)[source]¶
Bases:
object
A base class for CoR estimators. It does common tasks like data reading, flatfield, etc.
Initialize a CORFinder object.
- Parameters:
dataset_info (nabu.resources.dataset_analyzer.DatasetAnalyzer) – Dataset information structure
- search_methods = {}¶
- class nabu.pipeline.estimators.CORFinder(method, dataset_info, do_flatfield=True, cor_options=None, logger=None)[source]¶
Bases:
CORFinderBase
Find the Center of Rotation with methods based on two (180-degrees opposed) radios.
Initialize a CORFinder object.
- Parameters:
dataset_info (nabu.resources.dataset_analyzer.DatasetAnalyzer) – Dataset information structure
- search_methods = {'centered': {'class': <class 'nabu.estimation.cor.CenterOfRotation'>}, 'global': {'class': <class 'nabu.estimation.cor.CenterOfRotationAdaptiveSearch'>, 'default_kwargs': {'high_pass': 20, 'low_pass': 1}}, 'growing-window': {'class': <class 'nabu.estimation.cor.CenterOfRotationGrowingWindow'>}, 'sliding-window': {'class': <class 'nabu.estimation.cor.CenterOfRotationSlidingWindow'>, 'default_args': ['center']}}¶
- class nabu.pipeline.estimators.SinoCORFinder(method, dataset_info, slice_idx='middle', subsampling=10, do_flatfield=True, cor_options=None, logger=None)[source]¶
Bases:
CORFinderBase
A class for finding Center of Rotation based on 360 degrees sinograms. This class handles the steps of building the sinogram from raw radios.
Initialize a SinoCORFinder object.
- Parameters:
cor_options. (The following keys can be set in) –
slice_idx (int or str) – Which slice index to take for building the sinogram. For example slice_idx=0 means that we extract the first line of each projection. Value can also be “first”, “top”, “middle”, “last”, “bottom”.
subsampling (int, float) – subsampling strategy when building sinograms. As building the complete sinogram from raw projections might be tedious, the reading is done with subsampling. A positive integer value means the subsampling step (i.e projections[::subsampling]). A negative integer value means we take -subsampling projections in total. A float value indicates the angular step in DEGREES.
- search_methods = {'growing-window': {'class': <class 'nabu.estimation.cor.CenterOfRotationGrowingWindow'>}, 'sino-coarse-to-fine': {'class': <class 'nabu.estimation.cor_sino.SinoCorInterface'>}, 'sliding-window': {'class': <class 'nabu.estimation.cor.CenterOfRotationSlidingWindow'>, 'default_args': ['right']}}¶
- nabu.pipeline.estimators.SinoCOREstimator¶
alias of
SinoCORFinder
- class nabu.pipeline.estimators.CompositeCORFinder(dataset_info, oversampling=4, theta_interval=5, n_subsampling_y=10, take_log=True, cor_options=None, spike_threshold=0.04, logger=None, norm_order=1)[source]¶
Bases:
object
Class and method to prepare sinogram and calculate COR The pseudo sinogram is built with shrinked radios taken every theta_interval degres
- Compared to first writing by Christian Nemoz:
gives the same result of the original octave script on the dataset sofar tested
The meaning of parameter n_subsampling_y (alias subsampling_y)is now the number of lines which are taken from every radio. This is more meaningful in terms of amout of collected information because it does not depend on the radio size. Moreover this is what was done in the octave script
The spike_threshold has been added with default to 0.04
The angular sampling is every 5 degree by default, as it is now the case also in the octave script
- The finding of the optimal overlap is doing by looping over the possible overlap, according to the overlap.
After a first testing phase, this part, which is the time consuming part, can be accelerated by several order of magnitude without modifing the final result
- nabu.pipeline.estimators.CompositeCOREstimator¶
alias of
CompositeCORFinder
- class nabu.pipeline.estimators.DetectorTiltEstimator(dataset_info, do_flatfield=True, logger=None, autotilt_options=None)[source]¶
Bases:
object
Helper class for detector tilt estimation. It automatically chooses the right radios and performs flat-field.
Initialize a detector tilt estimator helper.
- Parameters:
dataset_info (dataset_info object) – Data structure with the dataset information.
do_flatfield (bool, optional) – Whether to perform flat field on radios.
logger (Logger object, optional) – Logger object
autotilt_options (dict, optional) – named arguments to pass to the detector tilt estimator class.
- default_tilt_method = '1d-correlation'¶
- tilt_threshold = 0.25¶
- nabu.pipeline.estimators.TiltFinder¶
alias of
DetectorTiltEstimator