FFT-based image mismatch computation for translation-based image registration. This package is the CPU backend in the HolyLab image registration stack; a GPU counterpart is provided by RegisterMismatchCuda.jl.
This package is registered in the HolyLabRegistry. Add the registry once, then install as usual:
using Pkg
pkg"registry add General https://github.com/HolyLab/HolyLabRegistry.git"
Pkg.add("RegisterMismatch")using RegisterMismatch
# Two images, moving shifted by (2, 3) relative to fixed
fixed = zeros(Float32, 32, 32); fixed[10:22, 10:22] .= 1f0
moving = circshift(fixed, (2, 3))
# Find the optimal integer-pixel shift
shift = register_translate(fixed, moving, (5, 5))
# CartesianIndex(2, 3)For non-uniform or large displacements, use mismatch_apertures to obtain a
grid of local mismatches and recover a smooth displacement field.
See the documentation
for a full guide, including preprocessing (highpass, nanpad),
aperture-based registration, bias correction, and the low-level CMStorage
workflow for repeated computations against the same fixed image.