ImageJ BeakerX notebooks with 3D image data

For documentation and education purposes, I’d like to create a Jupyter notebook that explains how to detect auto-fluorescent beads in a two-channel XYZ image, using Groovy and the BeakerX kernel (as the most recent notebooks in imagej/tutorials).

I noticed that for multi-dimensional image-type data, the cell output gets rendered by taking the first slice, which in my case (xyz, 16-bit, 2-channel) usually means just a black square.

What’s the current state? Are there methods to adjust what is displayed? Any plans to support interactive sliders (I think ipywidgets was discussed, right?)


Here’s what I’d like to have in my notebook:

  • Load image data using ij.io()

    • Display a maximum projection, with the two channels e.g. overlaid in green and magenta
  • Split channels using ij.op().run("hyperSliceView", ...)

  • DoG spot detection using ij.op().run("dog", ...)

  • Get a list of local maxima for both channels using ImgLib2’s LocalExtrema, or a to-be-created op ij.op().run("localExtrema", ...)

    • Plot the coordinates of the detected points (what plotting library is accessible from BeakerX Groovy?)
  • Use the API of the Descriptor-based registration plugin (Matching etc.) to find correspondences between the two sets of detected points.

  • Correct the original image using an AffineTransform (2D and/or 3D)

    • Display the corrected image (both channels overlaid) next to the original for comparison.

Any suggestions regarding the display and plot steps are highly appreciated. Do these methods go into imagej/imagej-notebook or anywhere else?

2 Likes

Hi,
if you’re interested in using 3D volume rendering, you could try ipyvolume. The project seems to be alpha so no guarantee that it works, but it seems to be interesting.

When I tried I had to use the python-kernel as base and use the beakerx magic for the groovy cells in which I used ImageJ2 (couldn’t get it to work the other way round). You can see an example which does projections (inspired from the Stack Projectsions script here: signal_processing_02.ipynb.

I use ImageJ2 to open a stack, move the image over to python via the beakerx object, render it with ipyvolume, do the projections with ij2 in groovy and display the java buffered-image of the projections in groovy.
There are probably better ways to do this now.

I would be very interested in your progress/results on this.

Best regards,
Volker

1 Like

It’s a very nice project.

ipyvolume is a nice library but you should also give a try to itk-jupyter-widgets which is somehow similar to ipyvolume.

Let us know which one works best for you.

3 Likes