ewokstomo.tasks.online.preprocessing.FlatFieldCorrection#
- class ewokstomo.tasks.online.preprocessing.FlatFieldCorrection[source]#
Bases:
objectApplies flat field correction to tomographic projections.
Flat field correction normalizes projections by removing detector-specific artifacts using dark (background) and flat (reference) images. This correction is essential for obtaining accurate reconstructions.
Attributes#
- reduced_darksdict[int, np.ndarray]
Dictionary mapping indices to reduced dark frames
- reduced_flatsdict[int, np.ndarray]
Dictionary mapping indices to reduced flat frames
- apply_correction(projections, projections_indices)[source]#
Apply flat field correction to projections.
- Return type:
Parameters#
- projectionsnp.ndarray
Array of projections with shape (n_angles, n_z, n_x)
- projections_indicesnp.ndarray
Indices of the projections in the full scan sequence
Returns#
- np.ndarray
Corrected projections with the same shape as input
- load_reduced_data_from_file(reduced_dark_path, reduced_flat_path, dark_first=True)[source]#
Load reduced darks and flats from HDF5 files.
- Return type:
Parameters#
- reduced_dark_pathstr
Path to the HDF5 file containing reduced dark frames
- reduced_flat_pathstr
Path to the HDF5 file containing reduced flat frames
- dark_firstbool, optional
If True, assign index 0 to darks and len(darks) to flats. If False, assign index 0 to flats and len(flats) to darks. Default is True.