BigDataViewer I/O

Hi all, particularly experts in the BigDataViewer,

I would very much appreciate answers to these basic questions:

  1. Having a BigDataViewer open, how do I grab the underlying ImgLib2 “Img” or similar RandomAccessible, or at least a cursor? An equivalent to “IJ.getImage()” would be fantastic, even if only for instances opened via the “Plugins - BigDataViewer - Open Current Image”.

  2. Having saved the view settings to an XML, how do I open that as an ImageJ image? The wiki says to use “File - Import - BigDataViewer…”, but that doesn’t open the XML files generated from the “File - Save Settings” of the BigDataViewer window menu. So how do I generate an XML that works?

  3. The “Tools - Record Movie” and the “Tools - Record Max-Projection Movie” do not seem to do anything sensible when a single stack (a single time point) is loaded. Convenience menu items to store 3D rotating projections would be excellent.

Thanks a lot.

@StephanPreibisch @tpietzsch @axtimwalde



Presently, all I want to do is to, having manually rotated a stack, export a 3D projection.

If I can do this with a plugin, based on launching the BDV using code similar to , that would be fine too.

In the end, I did it with the good old “3D Viewer”, which can export both the transformation and the transformed image as an ImagePlus, so at least there is the possibility of continuing image processing.

It is baffling that a piece of visualization software as useful as the BigDataViewer does not, by default, offer a few exit points, either from a script or from the UI, to continue processing elsewhere. For example, the whole BigDataViewer could in itself be an ij.VirtualStack, so that it would be seen as an image source by the rest of ImageJ/Fiji. And that VirtualStack would have a method or two to grab the transformation and the RandomAccessible, or at least a read-only cursor of the RandomAccessible, both for the plane in the field of view and for the whole 3d/4d data set.

We provide this functionality within the BigStitcher (select Views you like to view > right click > Quick Display Transformed Image > All Views) … will display as Virtual Stack that actually renders it multithreaded


Thanks! So that means the underlying ImgLib2 container (a RandomAccessibleInterval) can be grabbed by getting it from the extended VirtualStack that opens, right? Something like:

imp = IJ.getImage()
stack = imp.getStack()
# Stack is a VirtualStack from imglib2-ij package:
# see
# For unknown reasons the "source" field is private
from net.imglib2.display.image import ImageJVirtualStack
f = AbstractVirtualStack.getDeclaredField("source")
img = f.get(stack) # a RandomAccessibleInterval
# Now use the imglib2 img as desired ...
# E.g.
cursor = img.cursor()
# etc.