How can I register/align shifted image stacks?

If you just need translation, I’d recommend the pure-Julia register_translate:

julia> using RegisterMismatch

help?> register_translate
search: register_translate

  shift = register_translate(fixed, moving, maxshift, [thresh]) computes the integer-valued translation which best aligns images fixed and moving. All shifts up to size maxshift are considered.
  Optionally specify thresh, the fraction (0<=thresh<=1) of overlap required between fixed and moving (default 0.25).

You’ll want to add HolyLabRegistry (as a registry, not a package) to get it.

1 Like

@tim.holy, I tried instructions you listed for windows, but stack at ]registry add git@github.com:HolyLab/HolyLabRegistry.git as follows:

(@v1.7) pkg> registry add git@github.com:HolyLab/HolyLabRegistry.git
     Cloning registry from "git@github.com:HolyLab/HolyLabRegistry.git"
Private key location for 'git@github.com' [C:\Users\fff00\.ssh\id_rsa]:

and it fails at three attempts.

Use https, not git. (You need commit privileges for git.) How can I register/align shifted image stacks? - #7 by tim.holy

it worked, Thanks.

I have a large dataset of monochrome lunar images (20 GB uncompressed, infrared, red, green, and blue) which I’d like to get registered and stacked to build a lunar mosaic. The images are all distorted by the atmosphere in small but random amounts, so simple shifts and rotations will not suffice. Would BlockRegistration.jl be the best tool to use here?

Ideally, I don’t want to have to rely on a single reference image since every individual image is going to be distorted in some way. However, processing time isn’t a significant issue, and I’d happily use a tool that does global optimization if it produces significantly better results.

A lot of lunar image processing software is geared towards one-shot color cameras, so assembling a Julia pipeline to get all of my infrared (pictured below) and RGB data registered simultaneously, stacked into single-channel images, and composited into IRG/RGB images is the goal.

BlockRegistration might work, but it has mostly been designed to track changes over time in 2d and 3d (volumetric) imaging. Other options include GitHub - timholy/ANTsRegistration.jl: Convenience wrapper for image registration using the Advanced Normalization Tools and surely many others.