Non linear alignment - warpy
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 394
- Forks
- 95
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 7
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked warpy-image.sc script and attached transform JSON to understand the non-linear coordinate semantics. Then inspect how SpatialData represents transformations and define the supported scope; done means associating this transform with a SpatialData object so fluorescence and H&E data can be related without transforming the entire image.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- bioinformatics, data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100