Non linear alignment - warpy
Is your feature request related to a problem? Please describe. I am working with two images from adjacent slices of the same tissue: a fluorescence image and an H&E image. The fluorescence image has a GFP channel that indicates where a treatment has penetrated the cells and I would like to incorporate this spatial information into my VisiumHD analysis.
To achieve this, I need to align the fluorescence image to the H&E image. A simple affine transformation is insufficient for this task, so I am using Warpy (a QuPath/Fiji extension) to perform a non-linear transformation, which works surprisingly well.
Warpy returns a JSON file that describes the transformation. While I can use this file within QuPath to align the images and extract the data I need, this manual process is not easily reproducible or convenient. Therefore, I asked the author of Warpy if there was a way to apply the transformation from the JSON file directly in Python. He kindly provided a script to do just that. warpy-image.sc. Or not, because as he wrote: "What the transform is doing is transforming coordinates, not an image array. If you want to transform an image that will require something different, or built on top of that".
Describe the solution you'd like I would like to define the coordinate transformation directly within a SpatialData object. This would allow me to integrate information from the fluorescence image into my analysis without needing to explicitly transform the entire image.