Running a command plugin on multiple datasets



I am working on a simple command plugin for Fiji that needs to run on multiple stacks. It processes each stack frame by frame and then feed them to the pipeline (which requires conversion to float).

My first idea, and because I don’t want to deal with the image importing (we have for instance micro-manager stacks that can be mutli-stacks themselves…), was simply to grab the stacks opened in Fiji.

When developing the plugin under Eclipse and launching Fiji from there, I could use the DatasetService to access the Datasets representing each stacks. However, after activating the dev.fiji maven profile or importing the compiled version into a Fiji installation, the DatasetService finds no stack while the IJ.WindowManager() has access to them…

So now I am confused on which works when. So two questions:

  1. Why is it that I sometimes can access the stacks through an imglib2 representation (Dataset) or through the good old WindowManager (which gives ImagePlus) ?

  2. Any idea how to robustly achieve what I want to do?

I have to admit I would be very happy to write the plugin with ImagePlusses representation has this gives me access to the pixels as a float array directly. I am not very comfortable with imglib2 yet…