tomobar.supp.suppTools
#
Supplementary data tools:
List of functions:
normaliser - to normalise the raw data and take the negative log (if needed). Options are: ‘mean’, ‘median’ and ‘dynamic’.
autocropper - automatically crops the 3D projection data to reduce its size.
- tomobar.supp.suppTools.autocropper(data, addbox, backgr_pix1)[source]#
The method crops 3D projection data in order to reduce the total data size. Method assumes that the object is positioned vertically around the central point of the horizontal detector. It is important since the vertical mid ROI of each projection is used to estimate the background noise levels.
- Parameters
data (np.ndarray) – [Projections, detectorsVertical, detectorsHoriz] !
addbox – (int) to add additional pixels in addition to automatically found cropped values, i.e. increasing the cropping region (safety option)
backgr_pix1 (int) – to create rectangular ROIs to collect noise statistics on both (vertical) sides of each 2D projection
- tomobar.supp.suppTools.normaliser(data: numpy.array, flats: numpy.array, darks: numpy.array, log: bool = True, method: str = 'mean', axis: int = 0, **kwargs) numpy.ndarray [source]#
Data normalisation module
- Parameters
data (np.array) – 3d numpy array of raw data.
flats (np.array) – 2d numpy array for flat field.
darks (np.array) – 2d numpy array for darks field.
log (bool, optional) – Take negative log. Defaults to True.
method (str, optional) – Normalisation method, choose “mean”, “median” or “dynamic”. Defaults to “mean”.
axis (int, optional) – Define the ANGLES axis.
dyn_downsample (int, optional) – Parameter for “dynamic” method. Defaults to 2.
dyn_iterations (int, optional) – Parameter for “dynamic” method. Defaults to 10.
- Raises
NameError – method error
- Returns
3d numpy array of normalised data
- Return type
np.ndarray