Open constantinpape opened 2 years ago
1) User collects multiple overlapping 2d / 3d image tiles that are subsets of a whole 2) User performs stitching (e.g., with BigStitcher), and needs to track transforms from all tile spaces to world space
1) User working with an imaging system estimates its lens distortion as a non-linear 2D transform and stores it with NGFF 2) User collects a 3D image 3) User applies the same lens correction transform to all 2d slices of the 3D image
1) User has a large image stored at high resolution 2) User generates a multiscale pyramid by repeatedly downsampling and storing relevant metadata 3) User opens the pyramid with a viewer that can interpret scales correctly, on-the-fly loading works properly a) User can open two individual scales and can view them in the same physical space
1) User collects 2d data with known / specified physical thickness 2) User displays 2d slices in 3d with thickness displayed correctly
Needs ability to apply M-dim transforms to N-dim data (M>N). see https://github.com/ome/ngff/issues/103
1) User collects two datasets for ML training
2) Each has distinct coordinateTransform
for display purposes (e.g. scale [4,4,3.8]
, scale [4,4,4.1]
)
3) They share a coordinateTransform
(e.g. scale [4,4,4]
) to avoid interpolation when passing data to model
This issue has been mentioned on Image.sc Forum. There might be relevant details there:
https://forum.image.sc/t/ome-zarr-chunking-questions/66794/38
1) User collects 2d images but they are written in an unpredictable order 2) After the fact, user writes the correct order of z-slices to transform metadata 3) A transformed view of the volume should display the slices in the correct order
This was initially discussed here,
This issue has been mentioned on Image.sc Forum. There might be relevant details there:
https://forum.image.sc/t/ome-zarr-chunking-questions/66794/41
1) User collects N 2d images each stored as its own array
2) User writes metadata to "stack" the 2d images along a third dimension using coordinateTransformations
and a new coordinateSystem
3) Downstream software makes available a 3d image consisting of the N 2d images.
This issue has been mentioned on Image.sc Forum. There might be relevant details there:
https://forum.image.sc/t/ome-ngff-community-call-transforms-and-tables/71792/1
Similar to Story 4, but the thin-plate-spline parameters are stored in ome-zarr instead of the displacement field. That should save storage space and allow for transformations of annotations that are connected to the image but don't align to the voxel grid.
Extends story 5 and 6. A section tile is divided in a triangle-mesh (i.e. non-overlapping triangles) and each triangle gets an affine transformation attached.
Thanks @normanrz !
Both are important additions.
I'd suggest to wait until the next revision to deal with these, largely because they depend on storing points (landmarks for (13) mesh for (14)), and that's not merged into the spec yet.
@normanrz triangle mesh: storing the affine transformations is not necessary, only source and target coordinates of all vertices are required and three vertex indices per triangle. This is much more compact than storing the 6 value affine explicitly for each triangle because each vertex is used by typically 6 triangles.
Stories motivating the possibility to have transformations that
t
and c
)1) User has a timelapse of a drifting sample. 2) User performs drift correction, obtaining one (linear) transformation per timepoint. 3) User wants to save / visualize the drift corrected timelapse without resampling / transforming the timelapse.
1) User story fits into 5, 6, 16, 17. 2) Typically, resulting registration parameters vary over time (e.g. because of stage positioning errors among others). 3) User wants to save / visualize the registered / reconstructed image dataset without resampling / transforming the timelapse.
1) User has an image dataset exhibiting chromatic misalignment. 2) User performs chromatic correction obtaining one transformation per channel. 3) User wants to save / visualize the channel aligned image without resampling / transforming the image.
Goal: creating multi-channel (3d or 2d) image from multiple rounds of staining/acquisition.
A, B, C
b. second round: markers A, D, E
c. third round: markers A, F, G
A, A', A''
), with elastic/non-linear or linear transformation as needed.CZYX
) with channels A, B, C, D, E, F, G
without re-saving the transformed pixel/voxel data.Combination of Story 6 and Story 22.
(This also requires illumination/shading correction to be applied in step 3, but this correction is an intensity transform rather than a spatial coordinate transform so is not really in scope here. Just thought I'd mention it to get people thinking about it.)
Just a comment - from an outside perspective (I work mostly with MRI), the prospect of having the transform and blending stage of stitching happening on the fly during display is a bit scary. Specifically, if the transforms and raw tile data are stored in a single "image file", I worry about the effects that may have on the library API (what sample grid should the display logic use for such a file? Does the library handle resampling rotated/shifted tiles to a common grid, or just give up and throw the raw tile captures and their transforms at the application? How is lens aberration encoded or otherwise handled? What resampling algorithms are available (and in what color space(s)), and how is multithreading handled?), and on the display performance (how does the library determine which pieces are within a display region, a linear scan over potentially thousands? How well does resampling every frame during panning perform, and does it preserve things like spline coefficients between frames (and if so, how do you control the memory usage)? How do you handle the image pyramid?).
Basically, stitching (which to my mind is just preprocessing to deal with a limitation of microscopes) isn't something I'd want to have to think about (or have the code spending time on) when just trying to view a histology image alongside other datatypes, I'd want the image file to be as simple as possible (so the file reading API and other considerations can be simple). This is one reason we generally keep registration-type transforms out of the image files themselves, in that if you don't want to rewrite the image data for IO reasons, writing the transform(s) to a separate file is a simple solution, and doesn't complicate the image file internals. In practice, for MRI data, once we have all the transforms, we do a final resampling from the original data to the desired grid before processing/display.
If "raw tiles and stitching transforms" are a desired feature for the "basic image" file format, then perhaps there should be a file subtype that restricts the kinds of allowed complications (and perhaps even requires the presence of an image pyramid all the way to, say, 1000 samples or less along each dimension), which enables a set of simpler API functions that are well-suited to display purposes?
Hi @coalsont
Thanks for your comment, I appreciate your feedback and point of view.
having the transform and blending stage of stitching happening on the fly during display is a bit scary.
I get it. What I can try to make clearer in the spec is that you are not required to write code for visualization that applies transformations to images on the fly
That is, you are welcome to work the way you are:
and the spec will not stop you. I.e. you're free to ignore the items on your list of very good questions and considerations. Viewers that try to support on-the-fly transformations will have to tackle those.
The downside is that there will be valid ome-zarrs could look different in a viewer that supports on-the-fly transforms than in another viewer that doesn't. This is totally fine because I'd expect the latter viewer to communicate "I found an extra transformation but can't apply it".
What I'm confident will still find valuable to you:
Methods that produce transformations still have to store them somehow, and standardization there will improve tool interoperability. I've dumped lots of time into converting files storing affines from one format to another :persevere:
once we have all the transforms, we do a final resampling from the original data to the desired grid before processing/display.
Tracking the provenance of image data is very important. In this context, after you've done that final resampling, I sure would like to track 1) what was the original image that was resampled, and 2) what transformation(s) if any were applied in a structured, standard way. (i.e. not in my brain, or even in a lab notebook). The spec tracks that information.
Re: your last paragraph, something that I'll clarify is how a user or consuming software can know if a particular dataset is "basic" or not. Thanks again for posting here, and be in touch if I've not been clear or you're just not convinced.
p.s. I did human MRI work during grad school so was familiar with how analysis was done in that domain (well, a decade ago).
User stories: coordinateTransformations
This is a collection of the example applications / user stories of coordinateTransformations from #57. These examples should be helpful for the next proposal that will cover more advanced transformations.
Story 1: Basic (@jbms)
(Editorial comment: this will be feasible with 0.4)
Story 2: Prediction with cutout (@jbms)
(Editorial comment: also feasible with 0.4 using
translation
)Story 3: affine registration (@jbms)
Story 4: non-rigid registration (@axtimwalde)
Story 5; registration of slices (@satra)
Feel free to collect more examples in this thread :).