IBEX-PyReg lines up the imaging cycles of a multiplex immunofluorescence (IBEX) experiment, so every marker sits on the same cells. It uses the DAPI channel of each cycle as the reference. It first corrects the XY shift by phase cross-correlation, then corrects tissue warping with deformable registration in ANTs.
24 DAPI channels from one mouse brain section, overlaid after registration with IBEX-PyReg.
pyreg.py runs two steps for each cycle after the first:
- Coarse XY translation via phase cross-correlation.
- Deformable refinement via ANTsPyx SyN registration.
Outputs are saved to a reg_output/ subfolder inside each input directory.
- Python packages:
numpy,tifffile,antspyx,scikit-image,scipy
python pyreg.py <input_dir> [<input_dir> ...]input_dir: one or more directories containing cycle TIFF stacks
Examples:
python pyreg.py sample_A
python pyreg.py sample_A sample_B
python pyreg.py data --crop_size 1024 --threads 8
python pyreg.py data --axes ZCYX --dapi_channel 0--crop_size Ncenter crop size for phase-correlation pre-alignment (default:2048)--threads NITK/ANTs thread count (default:4)--axes MODEinput axis mode:auto,ZCYX, orCZYX(default:auto)--dapi_channel Nchannel index used as DAPI reference (default:0)
- The first TIFF stack in each directory is treated as the fixed reference cycle.
- Input stacks must be 4D and represent either
ZCYXorCZYXlayouts. - In
autoaxis mode, ambiguous small-dimension stacks may still require explicit--axes. - Output TIFF is written in ImageJ-compatible
TZCYXlayout.
