So I have a big question because I am quite confused about how plugins / services should work…
Here’s my problem :
I wrote a segmentation plugin “IJ1 style” with many static classes (so sad!). The MySeg class is a static class that contains the current state of my segmentation (meshes and point clouds, with some data attached). It also contains functions to work with a number of other static classes I wrote : an Optimizer class (actually doing the segmentation job), a Viewer class (3D), a GUI class, an Input/Output class.
SO. I want to rewrite all of this IJ2 style. How should I do ?
If that can clarify a bit, I’d like the user to be able to write scripts a bit like this :
ij.myseg.setOptimizerImage("myimage.tif"); // image to work with ij.myseg.putSeed(x,y,z); // seed for the segmentation ij.myseg.optimize(numberOfSteps); // processes a number of optimisation steps ij.myseg.viewCurrentSegState(); // launch a 3D viewer with current meshes (maybe SciView!) ij.myseg.saveState("myfile"); // saves the state into an output file
Should I write a MySeg service, and then commands for setOptimizerImage, putSeed, optimize, viewCurrentState, saveState ( that take a MySeg service as an input)?
I looked at this (https://github.com/imagej/tutorials/tree/master/maven-projects/create-a-new-plugin-type/src/main/java) but I can’t relate easily with what I want to do… I also looked quickly at the TrackMate source code but it looks like IJ1 code if I’m not mistaken.
Thanks for your time!