Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading OME-Zarr (OME-NGFF) #34

Open
lgeistlinger opened this issue Nov 21, 2022 · 2 comments
Open

Reading OME-Zarr (OME-NGFF) #34

lgeistlinger opened this issue Nov 21, 2022 · 2 comments

Comments

@lgeistlinger
Copy link

lgeistlinger commented Nov 21, 2022

A discussion in the Bioconductor slack channel was wondering whether RBioFormats could already be used to read OME-Zarr format. It seems that with the additional https://github.com/ome/zarrreader jar, RBioFormats would be able to read OME-Zarr (i.e. OME-NGFFs)?

@aoles
Copy link
Owner

aoles commented Jan 10, 2023

Hi Ludwig,

many thanks for reaching out! Indeed, it seems that adding zarrreader java library to the classpath used by RBioFormats is sufficient to enable reading of OME-Zarr file format, see below. The example queries only for image metadata because when trying to read pixel data I've run into an issue described in ome/ZarrReader#45.

library(RBioFormats)
library(rJava)
  
zarrfile = "/Users/oles/Downloads/v0.4/yx.ome.zarr/.zattrs"
zarrreader = "/Users/oles/Projects/ZarrReader/target/OMEZarrReader-0.3.1-SNAPSHOT-jar-with-dependencies.jar"
  
.jaddClassPath(zarrreader, class.loader = .jclassLoader(package="RBioFormats"))

read.metadata(zarrfile)
#> ImageMetadata list of length 3 
#> 
#>  series res sizeX sizeY sizeC sizeZ sizeT total
#>  1      1   1024  930   1     1     1     1    
#>  1      2   512   465   1     1     1     1    
#>  1      3   256   232   1     1     1     1    
#> 
#> globalMetadata:List of 4
#>  $ Axis type:0:0: chr "space"
#>  $ Axis name:0:1: chr "x"
#>  $ Axis name:0:0: chr "y"
#>  $ Axis type:0:1: chr "space"

Created on 2023-01-10 with reprex v2.0.2

AFAIU obtaining the ZarrReader jar file currently requires building it from sources. It would certainly ease things up quite a bit if ZarrReader was available already packaged. @sbesson any plans regarding this?

Cheers,
Andrzej

@joshmoore
Copy link

Hi @aoles! You can see how the jar is pulled into OMERO from Maven here:

https://github.com/ome/openmicroscopy/blob/develop/ivy.xml#L21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants