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

SpimDataOpener for BDVHDF5? #44

Closed
tischi opened this issue Jan 10, 2022 · 17 comments
Closed

SpimDataOpener for BDVHDF5? #44

tischi opened this issue Jan 10, 2022 · 17 comments
Labels
question Further information is requested

Comments

@tischi
Copy link
Collaborator

tischi commented Jan 10, 2022

@KateMoreva @K-Meech @constantinpape

I am confused, how do we open BDV HDF5 data?

public SpimData openSpimData( String imagePath, ImageDataFormat imageDataFormat ) {

@tischi tischi added the question Further information is requested label Jan 10, 2022
@constantinpape
Copy link
Collaborator

@tischi that's a good point. It looks like the code currently doesn't support bdv hdf5 any more. But I agree that we should still support it here. I guess that the problem is that we currently don't have an example project for it, so @KateMoreva wasn't really aware that we should still support it.
I will create an example project with bdv.hdf5 later.

@tischi
Copy link
Collaborator Author

tischi commented Jan 10, 2022

like this?
@SerializedName("bdv.hdf5")

@constantinpape
Copy link
Collaborator

like this?
@SerializedName("bdv.hdf5")

I am not sure what you mean by this, but I think there should be a case BdvHDF5. And most likely this can be opened via BdVUtils.openSpimData so it can be just added here.
(The shared queue function of course needs to also be adapted)

@tischi
Copy link
Collaborator Author

tischi commented Jan 10, 2022

That's what's written in the BDV XML in the image loader tag:

public enum ImageDataFormat {
    @SerializedName("bdv.h5") <--- IS THIS CORRECT?
    BdvHDF5,
    @SerializedName("bdv.n5")
    BdvN5,
    @SerializedName("bdv.n5.s3")
    BdvN5S3,
    @SerializedName("openOrganelle.s3")
    OpenOrganelleS3,
    @SerializedName("ome.zarr")
    OmeZarr,
    @SerializedName("ome.zarr.s3")
    OmeZarrS3,
    // OME Zarr with BDV XML
    @SerializedName("bdv.ome.zarr")
    BdvOmeZarr,
    // OME Zarr S3 with BDV XML
    @SerializedName("bdv.ome.zarr.s3")
    BdvOmeZarrS3;

@constantinpape
Copy link
Collaborator

That's what's written in the BDV XML in the image loader tag:

Ah, I see. I think that the correct tag is bdv.hdf5. I will double check this.

@constantinpape
Copy link
Collaborator

I have added an example project with hdf5 here: /g/kreshuk/pape/Work/mobie/hdf5-example-project.
And I also double checked, the tag should indeed be bdv.hdf5.

@KateMoreva
Copy link
Collaborator

KateMoreva commented Jan 10, 2022

/kreshuk/pape/Work/mobie/hdf5-example-project

Thanks, @constantinpape! I made a branch (mobie/mobie-viewer-fiji#565) to test this (opening via BdVUtils.openSpimData)
but faced this

java.util.concurrent.ExecutionException: ncsa.hdf.hdf5lib.exceptions.HDF5DatatypeInterfaceException: Datatype:Can't convert datatypes ["H5Tconv.c line 8180 in H5T__conv_float_short(): can't handle conversion exception"]
	at net.imglib2.cache.ref.SoftRefLoaderCache.get(SoftRefLoaderCache.java:145)
	at net.imglib2.cache.util.LoaderCacheKeyAdapter.get(LoaderCacheKeyAdapter.java:53)
	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: ncsa.hdf.hdf5lib.exceptions.HDF5DatatypeInterfaceException: Datatype:Can't convert datatypes ["H5Tconv.c line 8180 in H5T__conv_float_short(): can't handle conversion exception"]
	at ch.systemsx.cisd.hdf5.hdf5lib.H5.H5Dread(Native Method)
	at ch.systemsx.cisd.hdf5.hdf5lib.H5D.H5Dread(H5D.java:381)
	at bdv.img.hdf5.HDF5AccessHack.readShortMDArrayBlockWithOffset(HDF5AccessHack.java:197)
	at bdv.img.hdf5.HDF5AccessHack.readShortMDArrayBlockWithOffset(HDF5AccessHack.java:182)
	at bdv.img.hdf5.Hdf5VolatileShortArrayLoader.loadArray(Hdf5VolatileShortArrayLoader.java:46)
	at bdv.img.hdf5.Hdf5VolatileShortArrayLoader.loadArray(Hdf5VolatileShortArrayLoader.java:34)
	at bdv.img.cache.VolatileGlobalCellCache.lambda$createImg$0(VolatileGlobalCellCache.java:196)
	at net.imglib2.cache.util.LoaderCacheKeyAdapter.lambda$get$0(LoaderCacheKeyAdapter.java:55)
	at net.imglib2.cache.ref.SoftRefLoaderCache.get(SoftRefLoaderCache.java:135)
	... 7 more

and thinking about solving it.

@constantinpape
Copy link
Collaborator

Thanks! I made a branch (mobie/mobie-viewer-fiji#565) to test this (opening via BdVUtils.openSpimData)
but faced this
and thinking about solving it.

Oh, that's a known issue with datatypes in hdf5 with java ... Please don't do anything about this for now, I will try to fix the data.

@constantinpape
Copy link
Collaborator

@KateMoreva I have removed the h5 volume that causes this issue (I think). Could you please try again and see if it works now?

@KateMoreva
Copy link
Collaborator

KateMoreva commented Jan 10, 2022

@KateMoreva I have removed the h5 volume that causes this issue (I think). Could you please try again and see if it works now?

@constantinpape
Unfortunately, the error is still there.

@constantinpape
Copy link
Collaborator

constantinpape commented Jan 10, 2022

Ok, I will give it another update that will hopefully fix it later (and if that doesn't help we need to think about this closer.)
(I am busy for the next 2 hrs will do it after that and ping you)

@constantinpape
Copy link
Collaborator

@KateMoreva I updated the project again, could you check if you still get the same error?

@KateMoreva
Copy link
Collaborator

@KateMoreva I updated the project again, could you check if you still get the same error?

@constantinpape
No errors this time! 😃
The image with the default brightness:
image

@constantinpape
Copy link
Collaborator

@constantinpape
No errors this time! smiley
The image with the default brightness:

Ok! The image looks a bit weird, but I might know why. I have just replaced the data once more. Could you try to load it again and paste another screenshot?

@KateMoreva
Copy link
Collaborator

KateMoreva commented Jan 10, 2022

@constantinpape
No errors this time! smiley
The image with the default brightness:

Ok! The image looks a bit weird, but I might know why. I have just replaced the data once more. Could you try to load it again and paste another screenshot?

@constantinpape
image

@constantinpape
Copy link
Collaborator

@KateMoreva great, that's how it's supposed to look :).

@constantinpape
Copy link
Collaborator

I think this is done, can we close the issue @tischi ?

@tischi tischi closed this as completed Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants