I was wondering what the commands were for creating a set of multi-point selections in the ImageJ API? I feel like I’m missing something obvious.
you can use the
PointRoi(int, int, int) contstructor to create a multi-point selection.
An example Groovy script to create three points along the diagonal on the active image:
import ij.gui.PointRoi; import ij.IJ; pointRoi = new PointRoi([0, 10, 20] as int, [0, 10, 20] as int, 3); imagePlus = IJ.getImage(); imagePlus.setRoi(pointRoi);
You can also record your actions (selections, etc.) with the Macro Recorder to get the required commands easily:
In the case of multi-point selections, this is not true.
Yes multipoint are an exception. However it is easy to create a mutlipoint selection:
makeSelection("point", newArray(50,100,150,140), newArray(40,25,50,100));
Awesome, that’s super easy.