ThresholdAdjuster
Posted by Piet=?ISO-8859-1?Q?=C3?= Schofield on Feb 12, 2009; 8:48am
URL: http://imagej.273.s1.nabble.com/ThresholdAdjuster-tp3683598.html
Hullo
I am trying to write a plugin which uses the ThresholdAdjuster to permit a
user to set a threshold for a sample image and then retreives the threshold
value they have manually set to process the a set of other images. Naively
I thought I could do something like:
--------
class myplugin ... implements AdjustmentListener..{
private int th_value;
...
ImagePlus im = new ImagePlus("Mask", C3.getProcessor().duplicate());
im.show();
ThresholdAdjuster ta= new ThresholdAdjuster();
ta.addAdjustmentListener(this);
ta.run();
...
private void adjustmentValueChanged(){
// code to get th_value from ThresholdAdjuster
}
}
But this approach fails as ta.addAjustmentListerner(this) is not supported.
My questions are, is there a way to make this approach work, or is there a
better way to let the user interactively set a reference threshold which is
subsequently used for processing the rest of the images.
thanks
Pieta