darsia.DriftCorrection#
- class DriftCorrection(base=None, config=None)[source]#
Bases:
BaseCorrectionClass for drift correction of images wrt. a baseline image.
Set up the drift correction.
- Parameters:
- base
numpy.ndarrayordarsia.Image Baseline image.
- config
dict,optional Configuration. Recognised keys:
roi (2-tuple of ranges | ndarray of points) area used for feature detection and alignment padding (float) relative padding factor active (bool) apply the correction (default True)
- base
Methods
correct_array(img[, roi])Main routine for aligning image with baseline image.
correct_metadata([metadata])Correction routine on metadata level.
load(path)Load the drift correction from a file.
Return config file for the drift correction.
save(path)Save the drift correction to a file.
Attributes
Base image array.
Detection of effective translation based on feature detection.
- correct_array(img, roi=None)[source]#
Main routine for aligning image with baseline image.
- Parameters:
- img
np.ndarray Input image, to be aligned.
- roi2-tuple
ofslices,optional ROI to be applied to img; if None the cached roi is used.
- img
- Returns:
np.ndarrayAligned image array.
- base#
Base image array.
- translation_estimator#
Detection of effective translation based on feature detection.