ImageProcessor.setLineWidth() isn't changing the line width state
Posted by Junkshops on Apr 03, 2011; 6:46am
URL: http://imagej.273.s1.nabble.com/ImageProcessor-setLineWidth-isn-t-changing-the-line-width-state-tp3685170.html
Hi all,
I must be doing something very wrong here as this seems so simple, but
I'm at a loss to figure out what. I can't seem to set the line thickness
on an ImageProcessor:
import ij.ImagePlus;
import ij.process.ByteProcessor;
public class IJtest {
static int lineWidth = 5;
public static void main(String[] args) {
//ImagePlus newCell = IJ.createImage("", "8-bit", 512, 512, 1);
ImagePlus newCell = new ImagePlus("foo", new ByteProcessor(512,
512));
newCell.getProcessor().setLineWidth(lineWidth);
System.out.println("" + newCell.getProcessor().getLineWidth());
//prints 1
}
}
Obviously if I draw a line on the image and show() it, the line is also
width 1.
The getters and setters in the ImageProcessor code don't do anything
special other than set the line width to 1 if it's < 1, so there's no
reason the state shouldn't be saved that I can see.
Can anyone tell me what I'm doing wrong?
Thanks very much.