Register Virtual Stack Slices

This plugin takes a list of image slices stored in a folder, and delivers a list of registered image slices (with enlarged canvas).

The registration is translation only, or rotation+translation. No scaling, no non-linear deformations.

The process is as follows:

  1. Select "Plugins - Registration - Register Virtual Stack Slices"
  2. Select whether to register with translation only (phase-correlation), or both translation and rotation (SIFT).
    On choosing SIFT one can still constrain the registration to be translation-only in the following dialog.
  3. If SIFT was chosen, specify algorithm parameters.
  4. Select the source directory to read images from. The names must be bit-sortable.
  5. Select the target directory to store registered images to.


Even this sequence of rather noisy transmission electron microscopy images, with considerable variations from slice to slice, get registered properly:


Scripting / PlugIn

You can call the plugin in a non-interactive fashion from java code:

import ini.trakem2.imaging.Registration;
import register_virtual_stack.Register_Virtual_Stack_Slices;


String source_dir = "/path/to/source/";
String target_dir = "/path/to/target/";
int registration_type = Register_Virtual_Stack_Slices.PHASE_CORRELATION;
// Can be null if using PHASE_CORRELATION
Registration.SIFTParameters sp = new Registration.SIFTParameters();
// image scale at which phase-correlation works, for performance
float scale = 0.5f;
// minimum cross-correlation score to accept phase-correlation results, otherwise try pure cross-correlation
// (use as low as 0.4 if images are noisy, or at your discretion)
float min_R = 0.7;

Register_Virtual_Stack_Slices.exec(source_dir, target_dir, registration_type, sp, scale, min_R);

The above can of course be called from any scripting language, such as Jython:

from ini.trakem2.imaging import Registration
from register_virtual_stack import Register_Virtual_Stack_Slices
source_dir = "/path/to/source/"
target_dir = "/path/to/target/"
registration_type = Register_Virtual_Stack_Slices.PHASE_CORRELATION
sp = new Registration.SIFTParameters()
scale = 0.5
min_R = 0.7
Register_Virtual_Stack_Slices.exec(source_dir, target_dir, registration_type, sp, scale, min_R);

See also