Overlays in BigDataViewer


I would need a bit of help with some scripting with BigDataViewer (BDV).

I have a BDV HDF5 file containing a single view (consecutive electron microscopy images). I would like to overlay binary 2D areas similarly to the blob example in Figure 2.2 in the supplementary of the BDV publication. My areas can be defined by discs (radius, center) or by contours.
Could someone outline the main steps to create such additional channels ? I will try to make a simple python script out of it.

Thank you for your help

1 Like

I think, scripting this in python will not work currently. You need to do it in Java.
There are in general two options:

  1. Create a Source<T> that procedurally generates data and is sliced and rendered along with the other Sources.

  2. Create an Overlay that renders 2D stuff on top of the sliced images. You can register that Overlay for listening to render transform changes, then do your own transformations, etc.

An example for both is bdv.tools.boundingbox.BoundingBoxDialog. This overlays a modifiable bounding box, both as a wireframe 2D overlay and a continuous procedurally generated source.

This is an example that uses it: https://gist.github.com/tpietzsch/a2066fb2ee7b868b98a5
Can you start digging from there?

best regards,