BigDataViewer, smart way to use 2D images

Dear all, @tpietzsch, @NicoKiaru

when playing further with throwing different types of data into BDV, we (+@Christian_Tischer) came across the issue that 2D image data is currently not supported.

Our current workaround would be:

  • duplicate image into a two-slice z-Stack
  • abuse the pixelsize/AffineTransformation tags in the XML to inflate it in Z.

This obviously generates unnecessarily large H5 containers.
What would be a good/elegant way of getting 2D data into BDV to coexist with 3D+ datasets?

Cheers,
Martin

1 Like

Mixing 2D and 3D in BigDataViewer can work but I went into some troubles as well…

Could you share a minimal example of the problems you encountered ?

Cheers,

Nicolas

1 Like

@schorb,

Agree w/ @NicoKiaru that your approach should depend on the way in which you’re mixing 2d and 3d.

John

Quick aside on bdv 2d support

Just to be clear (and so you know about it, in case you don’t already), you can do this:

BdvFunctions.show( <source>, BdvOptions.options().is2D() );

but it’s not what you need if mixing 2D and 3D.

I think Martin’s issue is not so much displaying the data once we have them but writing it in the first place. The UI in Fiji for saving images as in bdv format does not support saving 2D images, but says that the images should be “at least 3D”. Does one of you have Java code for writing 2D images as bdv? If so, maybe we could provide this as a patch to the code that is currently shipped with Fiji UI?

1 Like

You can create a “3D” image with Views.addDimension without increasing the memory demand. Something similar may work for ImageJ1 data structures, going from an ImageProcessor to an ImageStack, but I am not familiar enough with ImageJ1 to give a concrete example for that.

1 Like

@Christian_Tischer @schorb The “at least 3D” message was over-protective of the user. Actually the code supports writing 2D images. I’m removing the warning and releasing a new version of bigdataviewer_fiji

3 Likes

@Christian_Tischer @schorb

Actually, I’m not releasing it yet, because I don’t know whether this solves your problem.
Could you try with the latest snapshot https://maven.scijava.org/service/local/repositories/snapshots/content/sc/fiji/bigdataviewer_fiji/6.0.1-SNAPSHOT/bigdataviewer_fiji-6.0.1-20190926.103620-4.jar
(replace the bigdataviewer_fiji-6.0.0.jar in your Fiji.app/plugins/) and tell me whether that is what you need?

Hi Tobias,

The export works. Opening the resulting 2D dataset in BDV works as well. What is still giving an error is “Open current image” when applied to a 2D image.

Thanks a lot,
Martin

2 Likes

@schorb Can you try again with
https://maven.scijava.org/service/local/repositories/snapshots/content/sc/fiji/bigdataviewer_fiji/6.0.1-SNAPSHOT/bigdataviewer_fiji-6.0.1-20190927.125226-5.jar
for plugins/bigdataviewer_fiji-....jar
and also
https://maven.scijava.org/service/local/repositories/snapshots/content/sc/fiji/bigdataviewer-core/7.0.1-SNAPSHOT/bigdataviewer-core-7.0.1-20190927.125106-4.jar
for jars/bigdataviewer-core-....jar

“Open current image” should be fixed now,
And also the initial transform is now set such that it should look correct immediately for 2D images.

Please let me know whether that works for you…

3 Likes

Hi Tobias,

thanks a lot. I have tested all scenarios and it works fine.

Best,
Martin

1 Like