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

Support multi-channel OME-Zarr #791

Closed
tischi opened this issue Jun 10, 2022 · 48 comments
Closed

Support multi-channel OME-Zarr #791

tischi opened this issue Jun 10, 2022 · 48 comments
Labels
discussion enhancement New feature or request

Comments

@tischi
Copy link
Contributor

tischi commented Jun 10, 2022

https://forum.image.sc/t/create-plate-view-for-mobie/67795/4

@tischi tischi added enhancement New feature or request discussion labels Jun 10, 2022
@constantinpape
Copy link
Contributor

Quiting @tischi from the forum post: Adding channel to ome.zarr via

"ome.zarr": {
            "relativePath": "images/ome-zarr/HTM.ome.zarr/A/1/0",
            "channel": 0
          },

I think that's a good idea; we could do the same with setup_id in bdv.xml.

@tischi
Copy link
Contributor Author

tischi commented Jun 10, 2022

In fact, it may be super easy:

Just here we would have to fetch the correct setupID, based on (to be added) source.imageData.get( imageDataFormat ).channel:

SourceAndConverter< ? > sourceAndConverter = creator.getSetupIdToSourceAndConverter().values().iterator().next();

@tibuch this could be your first PR 😉

@tibuch
Copy link
Collaborator

tibuch commented Jun 10, 2022

"channel": 0 is exactly what I was looking for!

Currently I can "hack" my way around this by creating a proxy-zarr-file with only one channel using symbolic links to point to the multi-channel sub-directories of the hsc-zarr-file:

/home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/
plate_01.ome.zarr
├── B                                            // Row
│   ├── 02                                     // Column
│   │   ├── 0                                  // First field of view i.e. MIP_OVR with 4 channels
│   │   │   ├── 0                             // Scale level 0
│   │   │   │   ├── 0                        // Channel 0
│   │   │   │   ├── 1                        // Channel 1
│   │   │   │   ├── 2                        // Channel 2
│   │   │   │   └── 3                        // Channel 3
│   │   │   ├── 1                             // Scale level 1
│   │   │   │   ├── 0                        // Channel 0
│   │   │   │   ├── 1                        // ...
│   │   │   │   ├── 2
│   │   │   │   └── 3
│   │   │   ├── 2
│   │   │   │   ├── 0
│   │   │   │   ├── 1
│   │   │   │   ├── 2
│   │   │   │   └── 3
│   │   │   ├── 3
│   │   │   │   ├── 0
│   │   │   │   ├── 1
│   │   │   │   ├── 2
│   │   │   │   └── 3
│   │   │   └── 4
│   │   │       ├── 0
│   │   │       ├── 1
│   │   │       ├── 2
│   │   │       └── 3
│   │   ├── B02_MIP_OVR_C01  // proxy-zarr object with only a single channel pointing to the data above.
│   │   │   ├── 0
│   │   │   │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/0/0
│   │   │   ├── 1
│   │   │   │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/1/0
│   │   │   ├── 2
│   │   │   │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/2/0
│   │   │   ├── 3
│   │   │   │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/3/0
│   │   │   └── 4
│   │   │       └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/4/0
│   │   ├── B02_MIP_OVR_C02
│   │   │   ├── 0
│   │   │   │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/0/1
│   │   │   ├── 1
│   │   │   │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/1/1
│   │   │   ├── 2
│   │   │   │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/2/1
│   │   │   ├── 3
│   │   │   │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/3/1
│   │   │   └── 4
│   │   │       └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/4/1
│   │   ├── B02_MIP_OVR_C03
│   │   │   ├── 0
│   │   │   │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/0/2
│   │   │   ├── 1
│   │   │   │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/1/2
│   │   │   ├── 2
│   │   │   │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/2/2
│   │   │   ├── 3
│   │   │   │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/3/2
│   │   │   └── 4
│   │   │       └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/4/2
│   │   └── B02_MIP_OVR_C04
│   │       ├── 0
│   │       │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/0/3
│   │       ├── 1
│   │       │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/1/3
│   │       ├── 2
│   │       │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/2/3
│   │       ├── 3
│   │       │   └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/3/3
│   │       └── 4
│   │           └── 0 -> /home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/4/3
│   ├── 03
│   │   ├── 0
│   │   │   ├── 0

But what @tischi is recommending sounds much nicer and cleaner!

I will have a look (hopefully today) and see if this could become my first PR ;)

@constantinpape
Copy link
Contributor

I will have a look (hopefully today) and see if this could become my first PR ;)

That sounds great! I will also create a small example project for this today, so you would have something easier for development.

@tischi
Copy link
Contributor Author

tischi commented Jun 10, 2022

@tibuch

  1. Awesome!
  2. In general we work against the develop branch, but this is broken right now. So you could use main as a starting point.
  3. If you go to src/**test**/java/projects/... there are tons of examples for how to open a project from within your IDE. That's how I usually do the development or debugging.

@tischi
Copy link
Contributor Author

tischi commented Jun 10, 2022

@tibuch

  1. I (hope I) fixed the develop branch, so you could work against that.
  2. The way we work is that from time to time we compile the develop branch and upload it to MoBIE-beta; I did that just now. Like this we can test/develop the latest features "in the wild" without screwing up the main update site.

@tischi
Copy link
Contributor Author

tischi commented Jun 10, 2022

One more info:

The tests in the github actions are not running stable: #742
So for now don't worry if they fail.
You could mvn test locally if you want to check.

@tischi
Copy link
Contributor Author

tischi commented Jun 10, 2022

Interesting:

/home/tibuch/Data/MoBIE-Test/data/Round1/images/ome-zarr/plate_01.ome.zarr/B/02/0/0/3

Can one can open this (channel?) separately, i.e. does it contain all the metadata to be opened as an individual OME-Zarr image?!

Does that always work or is it just a coincidence that the axis order allows for such a "subsetting-hack'?

@tibuch
Copy link
Collaborator

tibuch commented Jun 10, 2022

The proxy zarr contains .zattrs and .zgroup and one level down is an adapted .zarray file. The only thing that is replaced is the chunked data to avoid duplication.

@tischi
Copy link
Contributor Author

tischi commented Jun 10, 2022

I see, so this does not work "just like this".

@tibuch
Copy link
Collaborator

tibuch commented Jun 10, 2022

Indeed. I wrote a little helper:

def create_proxy_zarr(root, name="0", channel="0", proxy_name="test"):
    scale_levels = [os.path.basename(d) for d in glob(join(root, name, "**"))]
    for s in scale_levels:
        os.makedirs(join(root, proxy_name, s))
        with open(join(root, name, s, ".zarray"), "r") as f:
            zarray = json.load(f)
        zarray["shape"][0] = 1
        with open(join(root, proxy_name, s, ".zarray"), "w") as f:
            json.dump(zarray, f, indent=4)
            
        os.symlink(join(root, name, s, channel), join(root, proxy_name, s, "0"))
        
        
    with open(join(root, name, ".zattrs"), "r") as f:
        zattrs = json.load(f)
    
    zattrs["multiscales"][0]["name"] = proxy_name
    with open(join(root, proxy_name, ".zattrs"), "w") as f:
        json.dump(zattrs, f, indent=4)
    
    with open(join(root, name, ".zgroup"), "r") as f:
        zgroup = json.load(f)
    with open(join(root, proxy_name, ".zgroup"), "w") as f:
        json.dump(zgroup, f, indent=4)

@tibuch
Copy link
Collaborator

tibuch commented Jun 10, 2022

Ah, and Windows will not support this hack with the links. So better to go the way indicated by @tischi.

@constantinpape
Copy link
Contributor

Hey @tibuch, I have added an example project here: https://github.com/mobie/spatial-transcriptomics-example-project
It is already available via s3, so you can directly open it via the github link. Of course mobie needs to be updated in order to understand it since it has the new {"imageData": {"ome.zarr.s3": {"s3Address": "....", "channel": 0}}} feature.
(the dataset contains a single ome.zarr with 4 channels).
Thanks so much for looking into this! And let me know if anything is unclear or you need anything else.

Also one note: on the python site we had a check that the name in the ome.zarr metadata (multiscales:name) is the same as the source name in MoBIE. This is not possible any more, becasue one ome.zarr file now corresponds to multiple sources in MoBIE. It was easy to disable the check in python (https://github.com/mobie/mobie-utils-python/blob/channel/mobie/validation/metadata.py#L112-L113), but there might be some logic in the Fiji plugin also depending on it that needs to be adapted.

@tibuch
Copy link
Collaborator

tibuch commented Jun 10, 2022

Awesome! I will setup my IDE and start looking into. However, I don't think I will manage to finish today ;)

@constantinpape
Copy link
Contributor

However, I don't think I will manage to finish today ;)

Of course! I am available next week, so just let me know if you run into any issues :).
And have a nice weekend!

@tibuch
Copy link
Collaborator

tibuch commented Jun 15, 2022

Hi @constantinpape,

Does this dataset work: https://github.com/mobie/spatial-transcriptomics-example-project

I think some data is not available.

Cheers

@tibuch
Copy link
Collaborator

tibuch commented Jun 15, 2022

Hey @tischi and @constantinpape,

I made some progress and it works for single MoBIE sources, but it does not work for sourceTransforms (mergedGrid). In the second case it ends up here: https://github.com/fmi-faim/mobie-viewer-fiji/blob/develop/src/main/java/org/embl/mobie/viewer/transform/MergedGridSource.java#L438 when it adds the images. Which is probably where it should end up. However, when it tries to display the data it throws continuously ArrayIndexOutOfBound exceptions:

java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException
	at net.imglib2.cache.ref.SoftRefLoaderCache.get(SoftRefLoaderCache.java:145)
	at net.imglib2.cache.util.LoaderCacheAsCacheAdapter.get(LoaderCacheAsCacheAdapter.java:76)
	at net.imglib2.cache.ref.WeakRefVolatileCache.getBlocking(WeakRefVolatileCache.java:484)
	at net.imglib2.cache.ref.WeakRefVolatileCache.access$000(WeakRefVolatileCache.java:53)
	at net.imglib2.cache.ref.WeakRefVolatileCache$FetchEntry.call(WeakRefVolatileCache.java:531)
	at net.imglib2.cache.ref.WeakRefVolatileCache$FetchEntry.call(WeakRefVolatileCache.java:508)
	at net.imglib2.cache.queue.FetcherThreads$Fetcher.run(FetcherThreads.java:181)
Caused by: java.lang.ArrayIndexOutOfBoundsException

Maybe I forgot to update something? Or is there something else broken in the branch? Just asking because @tischi mentioned that he hopes that he fixed the branch.

My changes are here: https://github.com/fmi-faim/mobie-viewer-fiji/tree/develop
Additionally some changes on mobie-io: https://github.com/fmi-faim/mobie-io/tree/develop

Would be awesome if someone of you finds time to have a look and help me carry it over the finish line :shipit:

Cheers!

@constantinpape
Copy link
Contributor

Hi @tibuch,
first of all, thanks for working on this!

Does this dataset work: https://github.com/mobie/spatial-transcriptomics-example-project
I think some data is not available.

I think all data is available, at least my python validation tool says it's there (can't open it directly in MoBIE, because we need the changes you're working on for this). Do you get some error message when trying to load it?

Maybe I forgot to update something? Or is there something else broken in the branch? Just asking because @tischi mentioned that he hopes that he fixed the branch.

I assume that the grid somehow needs this information beforehand... I will take a quick look later, but that's probably something @tischi has to check.

@tibuch
Copy link
Collaborator

tibuch commented Jun 15, 2022

Should I be able to see/download the data from here: https://s3.embl.de/i2k-2020/spatial-transcriptomics-example/pos42/images/ome-zarr

@constantinpape
Copy link
Contributor

Should I be able to see/download the data from here: https://s3.embl.de/i2k-2020/spatial-transcriptomics-example/pos42/images/ome-zarr

Sort of, but you need to give the address for an actual file, the "fake directories" in s3 don't work, so you can't actually list anything like this (you would need to do s3 api requests for this).
This works: https://s3.embl.de/i2k-2020/spatial-transcriptomics-example/pos42/images/ome-zarr/MMStack_Pos42.ome.zarr/.zattrs

@constantinpape
Copy link
Contributor

(but it shouldn't really matter in MoBIE, all the loading from s3 should work)

@tibuch
Copy link
Collaborator

tibuch commented Jun 15, 2022

Just wanted to check if I can see it, which I can.

MoBIE also starts without errors, but BDV looks pretty black and empty...I guess there are still some bugs/issues.

@constantinpape
Copy link
Contributor

MoBIE also starts without errors, but BDV looks pretty black and empty...I guess there are still some bugs/issues.

There might also be some issue with contrast limits ...

I will try to check out your branch later and see if I can build from it and adjust contrast limits.

@tibuch
Copy link
Collaborator

tibuch commented Jun 15, 2022

If I click show raw images I am getting a stack with all zeros.

@constantinpape
Copy link
Contributor

I opened #797 and mobie/mobie-io#98 to discuss the code changes. There are some changes in mobie-io that I am not so sure about and that might explain some of the issues we see here.
@KateMoreva could you have a look at the PR in mobie-io as well?
(@tibuch not sure I will have time to compile from your branches today to test it more, will ping you if I find the time later)

@tischi
Copy link
Contributor Author

tischi commented Jun 15, 2022

@tibuch Thanks for giving this a shot ❤️ I am currently on holidays and can help from middle of next week on.

@tischi
Copy link
Contributor Author

tischi commented Jun 15, 2022

@tibuch For debugging this you could first try opening the multi-channel OME-Zarr with the OMEZarrViewer class that is also in this repo. There it should open all the channels. I think @constantinpape could point you to some "positive controls", i.e. multi-channel OME-Zarr that do open correctly there.

@constantinpape
Copy link
Contributor

I think @constantinpape could point you to some "positive controls", i.e. multi-channel OME-Zarr that do open correctly there.

Sorry, I overlooked that comment. The examples that should work when opening the ome-zarr directly are here:

@tischi
Copy link
Contributor Author

tischi commented Jun 21, 2022

I am getting an error:

        final OpenOMEZARRFromS3Command command = new OpenOMEZARRFromS3Command();
        command.s3URL = "https://s3.embl.de/i2k-2020/ngff-example-data/v0.4/czyx.ome.zarr";
        command.run();

throws:

Exception in thread "main" java.lang.UnsupportedOperationException: Could not find multiscales at service endpoint: https://s3.embl.de; bucket: i2k-2020; container path: ngff-example-data/v0.4/czyx.ome.zarr; path: ; attribute: multiscales
	at org.embl.mobie.io.ome.zarr.loaders.N5OMEZarrImageLoader.getMultiscale(N5OMEZarrImageLoader.java:281)
	at org.embl.mobie.io.ome.zarr.loaders.N5OMEZarrImageLoader.initSetups(N5OMEZarrImageLoader.java:183)
	at org.embl.mobie.io.ome.zarr.loaders.N5OMEZarrImageLoader.fetchSequenceDescriptionAndViewRegistrations(N5OMEZarrImageLoader.java:134)
	at org.embl.mobie.io.ome.zarr.loaders.N5OMEZarrImageLoader.<init>(N5OMEZarrImageLoader.java:122)
	at org.embl.mobie.io.ome.zarr.loaders.N5S3OMEZarrImageLoader.<init>(N5S3OMEZarrImageLoader.java:59)
	at org.embl.mobie.io.ome.zarr.openers.OMEZarrS3Opener.readKey(OMEZarrS3Opener.java:41)
	at org.embl.mobie.io.ome.zarr.openers.OMEZarrS3Opener.readURL(OMEZarrS3Opener.java:24)
	at org.embl.mobie.viewer.command.OpenOMEZARRFromS3Command.openAndShow(OpenOMEZARRFromS3Command.java:51)
	at org.embl.mobie.viewer.command.OpenOMEZARRFromS3Command.run(OpenOMEZARRFromS3Command.java:60)
	at projects.OpenRemoteOMEZarr.main(OpenRemoteOMEZarr.java:48)

This is with <mobie-io.version>1.2.11</mobie-io.version>.

Any ideas?

@tischi
Copy link
Contributor Author

tischi commented Jun 21, 2022

Is there also an v0.4 image without multiple channels that we can use as a control?

@tischi
Copy link
Contributor Author

tischi commented Jun 21, 2022

In the tests of mobie-io I found: https://s3.embl.de/i2k-2020/ngff-example-data/v0.4/zyx.ome.zarr
and this works.

@constantinpape
Copy link
Contributor

I am getting an error:

        final OpenOMEZARRFromS3Command command = new OpenOMEZARRFromS3Command();
        command.s3URL = "https://s3.embl.de/i2k-2020/ngff-example-data/v0.4/czyx.ome.zarr";
        command.run();

throws:

Exception in thread "main" java.lang.UnsupportedOperationException: Could not find multiscales at service endpoint: https://s3.embl.de; bucket: i2k-2020; container path: ngff-example-data/v0.4/czyx.ome.zarr; path: ; attribute: multiscales
	at org.embl.mobie.io.ome.zarr.loaders.N5OMEZarrImageLoader.getMultiscale(N5OMEZarrImageLoader.java:281)
	at org.embl.mobie.io.ome.zarr.loaders.N5OMEZarrImageLoader.initSetups(N5OMEZarrImageLoader.java:183)
	at org.embl.mobie.io.ome.zarr.loaders.N5OMEZarrImageLoader.fetchSequenceDescriptionAndViewRegistrations(N5OMEZarrImageLoader.java:134)
	at org.embl.mobie.io.ome.zarr.loaders.N5OMEZarrImageLoader.<init>(N5OMEZarrImageLoader.java:122)
	at org.embl.mobie.io.ome.zarr.loaders.N5S3OMEZarrImageLoader.<init>(N5S3OMEZarrImageLoader.java:59)
	at org.embl.mobie.io.ome.zarr.openers.OMEZarrS3Opener.readKey(OMEZarrS3Opener.java:41)
	at org.embl.mobie.io.ome.zarr.openers.OMEZarrS3Opener.readURL(OMEZarrS3Opener.java:24)
	at org.embl.mobie.viewer.command.OpenOMEZARRFromS3Command.openAndShow(OpenOMEZARRFromS3Command.java:51)
	at org.embl.mobie.viewer.command.OpenOMEZARRFromS3Command.run(OpenOMEZARRFromS3Command.java:60)
	at projects.OpenRemoteOMEZarr.main(OpenRemoteOMEZarr.java:48)

This is with <mobie-io.version>1.2.11</mobie-io.version>.

Any ideas?

Maybe there's something wrong on the server side. I can check later.

@constantinpape
Copy link
Contributor

Hey @tischi,
there was an issue with czyx.ome.zarr, it's fixed now and the data is available again at https://s3.embl.de/i2k-2020/ngff-example-data/v0.4/zyx.ome.zarr.

@tibuch
Copy link
Collaborator

tibuch commented Jun 22, 2022

I can use this (https://s3.embl.de/i2k-2020/ngff-example-data/v0.4/zyx.ome.zarr https://s3.embl.de/i2k-2020/ngff-example-data/v0.4/czyx.ome.zarr) example dataset with the new channel attribute 🙂
image

This (https://github.com/mobie/spatial-transcriptomics-example-project) does not show me anything. I tried playing around with the contrast limits, but it looks very empty.

@tischi
Copy link
Contributor Author

tischi commented Jun 22, 2022

The file name suggests that this only has one channel?!
https://s3.embl.de/i2k-2020/ngff-example-data/v0.4/zyx.ome.zarr

@tibuch
Copy link
Collaborator

tibuch commented Jun 22, 2022

Sorry, it was https://s3.embl.de/i2k-2020/ngff-example-data/v0.4/czyx.ome.zarr

@tibuch
Copy link
Collaborator

tibuch commented Jun 22, 2022

If I open https://s3.embl.de/i2k-2020/spatial-transcriptomics-example/pos42/images/ome-zarr/MMStack_Pos42.ome.zarr (the one from the spatial-transcriptomics-example-project) with the OME-Zarr command I can see 6 channels (4 image channels, 2 segmentations). However, I am only able to get some signal for the cell-segmentation channel. Everything else looks empty to me. Could that be?

@tischi
Copy link
Contributor Author

tischi commented Jun 22, 2022

OK!

Using this code (@tibuch you could also try this) in the develop branch

        final ImageJ imageJ = new ImageJ();
        imageJ.ui().showUI();
        final OpenOMEZARRFromS3Command command = new OpenOMEZARRFromS3Command();
        command.s3URL = "https://s3.embl.de/i2k-2020/ngff-example-data/v0.4/czyx.ome.zarr";
        command.run();

It does open:

image

The channel naming needs fixing in mobie-io: mobie/mobie-io#103

In fact in MoBIE, sources MUST have different names.

@tischi
Copy link
Contributor Author

tischi commented Jun 22, 2022

@tibuch to me that seems to suggest that in principle it can work.
I think a next step could be to make it work for your data.
Can you maybe share a (zip) of one multi-channel file that you generate for your data?

@constantinpape
Copy link
Contributor

constantinpape commented Jun 22, 2022

Just fyi, the data at https://s3.embl.de/i2k-2020/spatial-transcriptomics-example/pos42/images/ome-zarr/MMStack_Pos42.ome.zarr contains data for all channels; here's what I see when opening it in napari (using the napari ome zarr plugin):
image

But I think everything might still work correctly, and you just don't see anything due to issues with the contrast limits.
I am at CVPR this week, but I can have another look at this next week.

@constantinpape
Copy link
Contributor

Hi @tibuch,

just a quick update for you: we merged #797 today and pushed it to mobie-beta so I can test it.
I tested it for https://s3.embl.de/i2k-2020/spatial-transcriptomics-example/. I also couldn't get any of the data to show, even setting the same contrast limits as in napari. However, I also tried to open https://s3.embl.de/i2k-2020/spatial-transcriptomics-example/pos42/images/ome-zarr/MMStack_Pos42.ome.zarr directly in BDV (BDV->Ome Zarr) and it also didn't open correctly there; and we haven't merged any of your changes in mobie-io yet. So there seems to be some issue with this data in mobie.io! (The data itself can be loaded in napari, see my post above).

I will go ahead and create another project with the data from https://s3.embl.de/i2k-2020/ngff-example-data/v0.4/czyx.ome.zarr (which can be opened via BDV->Ome Zarr) for testing. However, to check this I need the fix from #806.

@tischi
Copy link
Contributor Author

tischi commented Jun 29, 2022

Ok, so I guess the TODO for me is?!

@constantinpape
Copy link
Contributor

Ok, so I guess the TODO for me is?!

* [ ]  Correctly open https://s3.embl.de/i2k-2020/spatial-transcriptomics-example/pos42/images/ome-zarr/MMStack_Pos42.ome.zarr  in mobie-io

Yes, that would be great!

But first, please check and release #806, then I can continue with creating an example project that should work.

@KateMoreva
Copy link
Collaborator

Ok, so I guess the TODO for me is?!

I can help if you wish.

@tischi
Copy link
Contributor Author

tischi commented Jun 29, 2022

@KateMoreva

If you have time that would be very helpful, indeed!
Please start from here: mobie/mobie-io#98

Please also have a look here https://github.com/mobie/mobie-io/blob/multi-channel-fix/src/test/java/spimdata/OmeZarrV4S3SpimDataTests.java
There I added a Test to extract the min and max values from the channels.
Those should return the correct values!

@constantinpape
Copy link
Contributor

@tischi @tibuch
I created a simpler example now, you can find it here:

Opening the project works, and when opening it from the filesystem everything works correctly:
nuclei-fs

But when opening from s3, it seems to always load channel 0:
mobie-nuclei-fs

Both images show the viewer when displaying nuclei, which is channel 1 in the ome.zarr. Filesystem shows it correctly, but s3 shows the membrane channel (channel 0).

@tischi
Copy link
Contributor Author

tischi commented Oct 13, 2022

@tibuch This works now in the mobie3 branch. If you want to develop/test things you should use the mobie3 branch from now on. Thanks!

@tischi tischi closed this as completed Oct 13, 2022
@constantinpape
Copy link
Contributor

@tibuch: just fyi: the spec has changed a bit as well, the updated version of the python library is here: mobie/mobie-utils-python#85. I will look into merging this into main next week. And there is also a converter functions to get projects to the new spec in there if you need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants