Drop TIFF tiles anywhere, or choose an example.
Drop TIFF tiles anywhere, or choose an example.
Stitches a mosaic of overlapping 2D or 3D microscopy tiles into one image, on the CPU in web workers. Tiles are greyscale TIFF or OME-TIFF files, one tile per file (a 3D tile is a z stack), all of the same sample type.
Layout. Tiles start from an approximate layout: a regular grid in file-name order (rows, columns, overlap and acquisition order, as in Fiji's Grid/Collection stitching), a Fiji TileConfiguration.txt in pixels, or the OME stage positions divided by the pixel size. Every pair of tiles that overlaps under that layout is registered, diagonal neighbours included.
Pairwise registration. Written from Preibisch, Saalfeld & Tomancak (2009), not from Fiji's GPL code. The two tiles are cut to the region they share under the layout, and the phase correlation of the two regions gives candidate translations. Each of the strongest peaks stands for 2d translations (the correlation is periodic); each is scored by the Pearson cross-correlation of the overlapping pixels and the best one kept. It is then moved uphill in cross-correlation to its integer maximum, and a parabola through the correlation at that maximum and its neighbours gives the sub-pixel translation.
Global optimisation. Tile translations minimise the squared differences between the measured and implied pairwise offsets, each pair weighted by r × overlapping pixels (least squares, the first tile fixed). Pairs with r below the threshold are not used; after each solve the pair with the largest residual is dropped while it exceeds 2.5 × the mean residual and 0.95 px, or while the mean residual exceeds 3.5 px, as Fiji's Grid/Collection stitching does with its defaults. A tile left without any usable pair keeps its layout position, moved with the rest.
Fusion. Linear blending: each output pixel is the mean of the tiles covering it, sampled by linear interpolation at sub-pixel positions and weighted by the distance to each tile's nearest edge. The fused image keeps the tiles' sample type.
Validation. On the NIST MIST example the registered positions are within 0.31 px of Fiji's Grid/Collection stitching (Stitching 3.1.8) and every pair offset within 0.73 px. On a synthetic 3 × 3 mosaic cut from a real tile with known sub-pixel positions, with the layout up to 25 px off, every tile was found within 0.17 px.
Outputs: the fused image as TIFF and as zipped OME-Zarr (.ozx), Fiji's TileConfiguration.registered.txt, the table of pairs (CSV) and provenance (JSON). Not in this version: illumination correction, multi-channel and time-lapse tiles, rotation or affine models.
Tiles are processed locally in this browser and are never uploaded. Only the example is downloaded, from the Neurodesk dataset on Hugging Face.