Plugins / FLIMKit-QuPath-Bridge / Co registration · edit on GitHub
Co-registration
FLIMKit expects ROIs in FLIM image-pixel coordinates. Anything drawn on a different image has to be transformed into that space before it is sent, and that happens on the QuPath side.
This is the same division of labour the Fiji bridge uses: the imaging program owns the alignment, FLIMKit receives coordinates it can use directly.
What you need
QuPath's alignment extension. QuPath does not ship it. Neither 0.6.0 nor 0.7.0 bundles interactive image alignment, so it has to be downloaded and installed separately.
This bridge deliberately contains no alignment code of its own. Reimplementing it would mean maintaining a copy of something QuPath's own developers already maintain, and it would drift.
Align on intensity, not lifetime
The alignment extension cannot handle 32-bit float. It does not decline politely either, it throws:
java.lang.ArrayIndexOutOfBoundsException: Index 99521 out of bounds for length 65536
at java.awt.image.ComponentColorModel.getRGBComponent
at qupath.ext.align.gui.ImageAlignmentPane$ImageEntryCell.updateItem
That is the thumbnail renderer reading a float raster through a colour model built for 16 bits.
The lifetime map has to be 32-bit float, because nanoseconds are not integers. Intensity does not: photon counts are whole numbers, so the bridge sends intensity as 16-bit whenever it fits losslessly, and only falls back to float when it cannot. So the intensity image opens in the alignment extension and the lifetime map does not.
Align on intensity. The transform is correct for the lifetime map as well, since every image of that field of view shares one pixel grid. Intensity is the better registration target anyway, because it carries the structure a registration needs while a lifetime map often does not.
The sequence
- Open your brightfield or mIF image in a QuPath project.
Extensions > FLIMKit bridge > Add FLIMKit images to projectto bring the intensity and lifetime maps into the same project.- Align the brightfield against the FLIMKit intensity image, and transfer the annotations onto it.
Extensions > FLIMKit bridge > Send annotations to FLIMKit, with the aligned image active.
The transform you get from step 3 is valid for the lifetime map as well, because every image of that field of view shares the same pixel grid.
Step 4 matters. Send from the FLIM image, not from the brightfield, or the coordinates will be in the wrong space and FLIMKit has no way to tell.
Without alignment
If the two images already share a coordinate system, for example because they came off the same detector at the same magnification, you can skip the alignment extension entirely and send annotations straight across.