mobie / mobie-io

BSD 2-Clause "Simplified" License
4 stars 8 forks source link

Default axis for ilastik hdf5 (exported from Fiji) #163

Closed k-dominik closed 7 months ago

k-dominik commented 7 months ago

Dear @tischi,

the ilastik Fiji plugin ungracefully doesn't save axistags to the dataset. However, the axisorder is always fixed tzyxc.

Would it be possible to add a default to MoBiE, for loading these files?

Example file: export.zip

tischi commented 7 months ago

Thanks, I will work on it this afternoon.

Related, are there any ways to determine from the h5 file (i) the desired contrast limits and (ii) the desired rendering color?

k-dominik commented 7 months ago

Thank you for looking into this!

No, we don't save contrast limits at all :/ What do you think would be a reasonable way to do that? Adding some kind of metadata tag to the file and adhering to the ome spec?

Side note, it would be cool if we could look at this https://github.com/ilastik/ilastik4ij/blob/661310c92c54280218f8af5e849f1539e629e65a/src/main/java/org/ilastik/ilastik4ij/hdf5/Hdf5.java#L230 together to also write the axistags on ours side. My java-fu is a bit rusty ;)

tischi commented 7 months ago

Works now, I also needed to add:

            final N5HDF5Reader n5 = new N5HDF5Reader( uri );
            String dataset = "exported_data";
            if ( ! n5.datasetExists( dataset ) )
                dataset = "data";
k-dominik commented 7 months ago

Hey @tischi, thank you so much for fixing this. In principle the dataset name can be any string, but let's record for now, that only the default strings "data" and "exported_data" are supported.

tischi commented 7 months ago

Hey @k-dominik, could you please

  1. test whether that now also works in Fiji
  2. inform the user on the forum upon success

Thanks!

k-dominik commented 7 months ago

Hi @tischi,

I gave it a go and it doesn't really seem to work:

image

this should be the famous "blobs" image.

Could the axisorder be maybe the other way round? (cxyzt)

tischi commented 7 months ago

Hard to say...

image

Could you create an example that also has a z-dimension?

tischi commented 7 months ago

Got it:

image
tischi commented 7 months ago

@k-dominik can you try again?

k-dominik commented 7 months ago

I tried now also with a 3D image, and it seems to work. However I could not scroll through the volume. Are the shortcuts somehow different than the ones in bdv?

export3d.zip <-- bat cochlea

tischi commented 7 months ago

However I could not scroll through the volume. Are the shortcuts somehow different than the ones in bdv?

Nope, same short-cuts.

tischi commented 7 months ago

Bug on my side; I did not yet implement to check ilastik image dimensions. Will upload fix soon...have to go to gate now...

tischi commented 7 months ago

Should work now.