ome / napari-ome-zarr

A napari plugin for zarr backed OME-NGFF images
https://www.napari-hub.org/plugins/napari-ome-zarr
BSD 3-Clause "New" or "Revised" License
27 stars 21 forks source link

coordinateTransformations scale list #32

Closed will-moore closed 2 years ago

will-moore commented 2 years ago

This uses the updated coordinateTransformations format for scale and translate, implemented in https://github.com/ome/ome-zarr-py/pull/162

To test, using idr0101 where we have smaller images "cropped" from larger images, we can overlay them using the translate transformation. I have manually edited the 13457537.zarr/.zattrs and the /labels/0/.zattrs to add translate, based on the rectangle 'crop' ROIs on the larger image.

First, open the larger image in napari:

$ napari https://minio-dev.openmicroscopy.org/idr/v0.4/2022-02-03/idr0101/13457227.zarr

Then, in napari terminal, open the smaller one (also contains labels):

viewer.open("https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0101A/13457537.zarr", plugin="napari-ome-zarr")

Screenshot 2022-02-04 at 11 47 47

Also:

$ napari https://minio-dev.openmicroscopy.org/idr/v0.4/2022-02-03/idr0062/6001240.zarr
codecov-commenter commented 2 years ago

Codecov Report

Merging #32 (13d1c96) into main (08c3fa4) will increase coverage by 5.35%. The diff coverage is 71.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #32      +/-   ##
==========================================
+ Coverage   85.92%   91.28%   +5.35%     
==========================================
  Files           3        3              
  Lines         199      195       -4     
==========================================
+ Hits          171      178       +7     
+ Misses         28       17      -11     
Impacted Files Coverage Δ
napari_ome_zarr/_reader.py 86.53% <71.42%> (+9.68%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 08c3fa4...13d1c96. Read the comment docs.

jburel commented 2 years ago

tested on M1 and everything is displayed

Screenshot 2022-02-08 at 11 56 33
sbesson commented 2 years ago

As discussed with @will-moore, the samples created for testing this PR raised additional questions outside the scope of this PR:

  1. how to create such samples and notably how to update the metadata without editing it
  2. how to write, read and consume coordinateTransformations defined at the multiscales level rather than the datasets level.

Solving these issues will require some API thoughts across the various ome-zarr Python repositories. This should not block this from being merged as it allows to consume transformations introduced in the 0.4 version of the specification at the datasets level.