I am a new developer of ImageJ and i would like to open an image and to be able to set an scale and get length of objects from the image.
I am able to do all this in ImageJ, but i cannot from Java. I have this code:
ImageJ imageJApplication = new ImageJ(2);
ij.io.Opener opener = new ij.io.Opener();
this.imp = opener.openImage(imageFilePath);
With this code i open an image an i can paint lines.
Now, i have this code to set the scale, but nothing happens in the form:
IJ.run(“Set Scale…”, “distance=29.0689 known=5 pixel=1 unit=cm global”);
I also have this code to paint the scale in the image, but nothing happens:
IJ.run(“Scale Bar…”, “width=17 height=4 font=14 color=White background=None location=[At Selection] bold”);
How could i set the scale and get the lengh of the new Lines?
Another question, Can i see the StausBar or the main menu from code? I only see the image…
Please, can you help me?
Thanks in advance…