A pixel-safe Fiji/ImageJ 1.x plugin for subpixel X/Y alignment of 16-bit grayscale TIFF stacks.
The plugin is designed for stacks in which small frame-to-frame translations must be corrected while retaining the original 16-bit image content as closely as practical. It protects isolated bright detector pixels before Fourier translation to avoid the star/cross-shaped ringing that those pixels can produce.
- Aligns the currently active 16-bit grayscale stack in Fiji.
- Corrects X/Y translation only; it does not rotate, scale, crop, denoise, sharpen, or adjust brightness.
- Anchors the result to the first frame and preserves that frame pixel-for-pixel.
- Detects per-frame and persistent isolated bright pixels before shift estimation.
- Uses reflected padding and a Fourier shift for subpixel translation of normal image structure.
- Restores protected detector pixels at their original sensor coordinates after translation.
- Opens the result as a separate stack named
<source>_aligned_<N>frames. - Automatically saves a TIFF beside the source when the source has a known file location. The opened result can also be saved with File > Save As > Tiff.
- Download
Fiji_Subpixel_Stack_Alignment.jar. - Close Fiji completely.
- Copy the JAR into
Fiji.app/plugins/. - Restart Fiji.
- Open the command at Plugins > Registration > Fiji Subpixel Stack Alignment (Pixel-Safe).
- Open a multi-frame, 16-bit grayscale TIFF stack.
- Select Plugins > Registration > Fiji Subpixel Stack Alignment (Pixel-Safe).
- Confirm the dialog.
- Wait for the new aligned stack to open.
The source stack and its pixel arrays are not modified.
- Detect isolated bright outliers in each frame and identify detector-fixed candidates that persist across the stack.
- Replace protected pixels with a robust local background in the registration copy only.
- Downsample and lightly prefilter the registration copies.
- Estimate translation by phase correlation, anchored to frame 1.
- Refine the shifts through three aligned consensus-reference cycles.
- Apply each final shift once to the original 16-bit frame data using reflected padding and separable Fourier translation.
- Restore protected pixels from the original frame at their sensor coordinates.
Requirements:
- JDK 8 or newer
- Maven 3.8 or newer
mvn test
mvn packageThe installable JAR is produced at:
target/Fiji_Subpixel_Stack_Alignment.jar
Automated tests cover integer and fractional translations, first-frame preservation, edge and corner detector-pixel protection, supported stack layouts, and output naming.
For a manual demo based on official ImageJ sample imagery, see examples/README.md.
- Input must be a 16-bit grayscale stack with at least two frames.
- Multidimensional ImageJ hyperstacks are rejected; convert the input to a plain single-channel stack first.
- The model is translation-only. Rotation, scaling, deformation, or strong content changes between frames require another registration method.
- Bright scene details that behave like isolated detector pixels may be protected rather than translated. Inspect important results at full resolution.
- Numerical subpixel estimates are not a universal claim of physical registration accuracy.