mobie / mobie-viewer-fiji

BSD 2-Clause "Simplified" License
30 stars 12 forks source link

Opening BdvOmeZarrS3 is not working with current MoBIE-beta #374

Closed constantinpape closed 3 years ago

constantinpape commented 3 years ago

The project at https://s3.embl.de/i2k-2020/project-bdv-ome-zarr can be opened, but no data is loaded. Looks like all blocks are loaded as empty. Maybe this happens because the reader does use the incorrect dimension separator? I will double check that the actual data is ok once I have ome.zarr + napari working (hopefully Monday).

Note that opening the BdvOmeZarr dataset locally at /g/kreshuk/pape/Work/mobie/covid-em-datasets/ngff-example/data works. This should be the same data!

cc @KateMoreva

KateMoreva commented 3 years ago
public class OpenRemoteBdvOmeZarr {
    public static void main(String[] args) throws IOException {
        final ImageJ imageJ = new ImageJ();
        imageJ.ui().showUI();
        new MoBIE("https://s3.embl.de/i2k-2020/project-bdv-ome-zarr", MoBIESettings.settings().gitProjectBranch( "master" ).imageDataFormat(ImageDataFormat.BdvOmeZarrS3));
    }
}

and

`   new MoBIE("https://s3.embl.de/i2k-2020/project-bdv-ome-zarr", MoBIESettings.settings().gitProjectBranch( "master" ).imageDataFormat(ImageDataFormat.BdvOmeZarr));`

works for me

KateMoreva commented 3 years ago

Could you please send the command that you used and the result?

constantinpape commented 3 years ago

I opened via Fiji: Plugins->MoBIE->Open->Open MoBIE project ..., enter https://s3.embl.de/i2k-2020/project-bdv-ome-zarr.

This opens the project, but the image is empty and the log records block misses:

Screenshot from 2021-07-22 20-43-25

KateMoreva commented 3 years ago

Hm, something strange is heppening: image image

edit: Extra image deleted, the last image changed (MoBIE-beta used)

constantinpape commented 3 years ago

Ok, I just tried again and now I can see the data... Indeed very weird. Do you know why it prints all the dataBlockIndices? Is this some left over debug output? (I also see it now). Something else I notice now: the pixel size is not correctly read from the xml metadata and set to "pixel". Instead it should be read from the xml, as for BdvN5.

KateMoreva commented 3 years ago

Yes, I think dataBlockIndices is the leftover from debugging. OMEZarrS3Reader war used for reading this file, and it has:

   public SpimData readKey(String key) throws IOException {
        N5OMEZarrImageLoader.logChunkLoading = true;
        HashMap<String, Integer> axesMap = new HashMap<>();
        N5S3OMEZarrImageLoader imageLoader = new N5S3OMEZarrImageLoader(serviceEndpoint, signingRegion, bucketName, key, ".", axesMap);
        SpimData spimData = new SpimData(null, Cast.unchecked(imageLoader.getSequenceDescription()), imageLoader.getViewRegistrations());
        return spimData;
    }
KateMoreva commented 3 years ago

Something else I notice now: the pixel size is not correctly read from the xml metadata and set to "pixel". Instead it should be read from the xml, as for BdvN5.

Ok, thanks, I will work over it. Is there anything else strange apart from pixel size reading? :)

constantinpape commented 3 years ago

Ok, thanks, I will work over it. Is there anything else strange apart from pixel size reading? :)

No the rest looks good. I guess the issue with the empty data was just some access issues with the s3 bucket, maybe also due to some transient problems with my local connection.

KateMoreva commented 3 years ago

Хорошо, я просто попробовал еще раз, и теперь я вижу данные ... Действительно, очень странно. Вы знаете, почему он все печатает dataBlockIndices? Это какой-то остаток отладочной информации? (Я тоже это сейчас вижу). Я заметил кое-что еще: размер пикселя некорректно считывается из метаданных xml и установлен на «пиксель». Вместо этого его следует читать из xml, как для BdvN5.

@constantinpape , sholud it be like that?

image

KateMoreva commented 3 years ago

Хорошо, я просто попробовал еще раз, и теперь я вижу данные ... Действительно, очень странно. Вы знаете, почему он все печатает dataBlockIndices? Это какой-то остаток отладочной информации? (Я тоже это сейчас вижу). Я заметил кое-что еще: размер пикселя некорректно считывается из метаданных xml и установлен на «пиксель». Вместо этого его следует читать из xml, как для BdvN5.

@constantinpape , должно быть так?

изображение

Does ome.zar (non bdv) have units? I could not find one in examples.

KateMoreva commented 3 years ago

@constantinpape, please check https://github.com/mobie/mobie-viewer-fiji/pull/386, bdv.ome.zarr should have size according to it's in xml.

constantinpape commented 3 years ago

@constantinpape , sholud it be like that?

Yes, this looks good.

Does ome.zar (non bdv) have units? I could not find one in examples.

No,ome.zarr does not have units yet; support for this is still work in progress. (This is one of the reasons we are currently supporting the bdv.ome.zarr version.)

constantinpape commented 3 years ago

This is all fixed now.