Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fiji Subpixel Stack Alignment

中文说明

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.

Features

  • 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.

Install

  1. Download Fiji_Subpixel_Stack_Alignment.jar.
  2. Close Fiji completely.
  3. Copy the JAR into Fiji.app/plugins/.
  4. Restart Fiji.
  5. Open the command at Plugins > Registration > Fiji Subpixel Stack Alignment (Pixel-Safe).

Use

  1. Open a multi-frame, 16-bit grayscale TIFF stack.
  2. Select Plugins > Registration > Fiji Subpixel Stack Alignment (Pixel-Safe).
  3. Confirm the dialog.
  4. Wait for the new aligned stack to open.

The source stack and its pixel arrays are not modified.

How it works

  1. Detect isolated bright outliers in each frame and identify detector-fixed candidates that persist across the stack.
  2. Replace protected pixels with a robust local background in the registration copy only.
  3. Downsample and lightly prefilter the registration copies.
  4. Estimate translation by phase correlation, anchored to frame 1.
  5. Refine the shifts through three aligned consensus-reference cycles.
  6. Apply each final shift once to the original 16-bit frame data using reflected padding and separable Fourier translation.
  7. Restore protected pixels from the original frame at their sensor coordinates.

Build and test

Requirements:

  • JDK 8 or newer
  • Maven 3.8 or newer
mvn test
mvn package

The 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.

Example data

For a manual demo based on official ImageJ sample imagery, see examples/README.md.

Limitations

  • 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.

About

Pixel-safe subpixel X/Y alignment plugin for 16-bit TIFF stacks in Fiji/ImageJ.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages