preprocess.flat_fielding¶
Functions:
flat_fielding (im, i, plan, flat_end, ...) |
Process a sinogram with conventional flat fielding plus reference normalization. |
-
stp_core.preprocess.flat_fielding.
flat_fielding
(im, i, plan, flat_end, half_half, half_half_line, norm_sx, norm_dx)[source]¶ Process a sinogram with conventional flat fielding plus reference normalization.
Parameters: - im (array_like) – Image data as numpy array
- i (int) – Index of the sinogram with reference to the height of a projection
- plan (structure) – Structure created by the extract_flatdark function (see extract_flatdark.py). This structure contains the flat/dark images acquired before the acquisition of the projections and the flat/dark images acquired after the acquisition of the projections as well as a few flags.
- flat_end (bool) – True if the process considers the flat/dark images (if any) acquired after the acquisition of the projections.
- half_half (bool) – True if the process has to be separated by processing the first part of the sinogram with the flat/dark images acquired before the acquisition of the projections and the second part with the flat/dark images acquired after the acquisition of the projections.
- half_half_line (int) – Usually this value is equal to the height of the projection FOV / 2 but the two parts of the sinogram to process can have a different size.
- norm_sx (int) – Width in pixels of the left window to be consider for the normalization of the sinogram. This value has to be zero in the case of ROI-CT.
- norm_dx (int) – Width in pixels of the right window to be consider for the normalization of the sinogram. This value has to be zero in the case of ROI-CT.
- Example (using h5py, tdf.py, tifffile.py)
- ————————–
- >>> sino_idx = 512
- >>> f = getHDF5(‘dataset.h5’, ‘r’)
- >>> im = tdf.read_sino(f[‘exchange/data’], sino_idx)
- >>> plan = extract_flatdark(f_in, True, False, False, ‘tomo’, ‘dark’, ‘flat’, ‘logfile.txt’)
- >>> im = flat_fielding(im, sino_idx, plan, True, True, 900, 0, 0)
- >>> imsave(‘sino_corr.tif’, im)