recently, I have been working to make BigVolumeViewer support more ImgLib2 data structures and pixel types.
Now, simple (small-ish) volumes are supported in addition to the large, GPU-cached multi-resolution stacks. Supported is any
ARGBType (as long as it fits in GPU memory). Multiple small and large volumes of different data types can shown at the same time, possibly transformed with respect to each other, and everything should be blended correctly. Some basic
VolatileViews are handled correctly.
This was done in preparation for scenery/SciView pushing all volumes through a common pipeline, so this should appear in SciView very soon.
To play around, I expose a bigdataviewer-vistools-like API. Basically, in
Bvv and most basic things should work. A lot of copy & paste for which I will hate myself later…, but it’s sooo convenient now. If you clone https://github.com/tpietzsch/jogl-minimal/ you can have a look at the examples.
Example01 shows ImageJ’s 16-bit “t1-head” sample.
final ImagePlus imp = IJ.openImage( "https://imagej.nih.gov/ij/images/t1-head.zip" ); final Img<UnsignedShortType> img = ImageJFunctions.wrapShort( imp ); final BvvSource source = BvvFunctions.show( img, "t1-head" );
Example02 does the same for (RGB) “flybrain” sample.
Example03 shows 2-channel time-series “mitosis” sample.
Example04 shows how to add multiple volumes to the same window (
Bvv.options().addTo(...), analogous to vistools) and that you can transform them using
Views.translate or specifying a source transform.
Example05 shows how to add
SpimData datasets loaded from bdv xml files.
Now it get’s really cool! Example06 illustrates that
CachedCellImgs wrapped as
VolatileViews are correctly recognized and handled as tiled, GPU-cached, multi-resolution stacks (with 1 resolution level).
What we see here is 5 sources. On the left, the flybrain RGB volume.
In the middle the red channel, virtually extracted using
On top of that two Gauss-smoothed versions (in green and blue) that are lazily evaluated by CellLoaders of a CachedCellImg. These are added wrapped in
final BvvStackSource<?> sourceGauss1 = BvvFunctions.show( VolatileViews.wrapAsVolatile( gauss1 ), "gauss1", Bvv.options().sourceTransform( transform ).addTo( sourceRed ) );
and render immediately while missing tiles are requested and uploaded to the GPU cache when they become available.
On the right is the absolute difference between the two Gauss-smoothed versions (also lazily computed).
(If you run the example, note that the smoothing is slowed down artificially, so that you can see how the tiles come in…)
Example07 shows a cube in a head
One thing to note: Once your RAI uploads to a texture, changes to the RAI will not be reflected, obviously.
You need to explicitly trigger re-upload using the
I’m currently having problem releasing maven artefacts, once that is sorted out, I’ll make a release so that you can easily integrate