Re: ContrastAdjuster plugin
Posted by
Blandine Chanteloup on
Aug 08, 2005; 5:17pm
URL: http://imagej.273.s1.nabble.com/ContrastAdjuster-plugin-tp3705076p3705077.html
It's true the ContrastAdjuster is running on the current displayed image
found by the WindowManager method.
And I think that the ImagePlus I define in my frame corresponds to the
value returned by WindowManager.getCurrentImage() because the histogram
plotted in the B&C window corresponds to the "image.bmp" image ...
Is it possible to add some methods like "update()" rather than modifying
the ImageJ plugin ??
>Hello,
>I suppose the control Adjuster does nothing because it doesn't work with
>your frame.
>The ContrastAdjuster is running on the current displayed image found by
>the WindowManager method:
>ImagePlus imp = WindowManager.getCurrentImage();
>
>It is probably why in your code, the B&C don't know your ImagePlus object.
>If you want to use the ij B&C, you can modify it in order to apply it on
>your own image...
>
>Rémi.
>
>
>Blandine Chanteloup wrote:
>
>>Hello,
>>
>>I would like to use the ContrastAdjuster plugin to process an image
>>displayed in a JFrame.
>>When the program starts, the image is displayed and the window
>>corresponding to the Contrastadjuster plugin correctly appears.
>>But when I''m changing for example the brightness value using the
>>scrollbar, the image is not changed.
>>
>>Any idea ???
>>
>>I'm using the following source code :
>>
>>public class JFrame_TestImageJPlugin extends javax.swing.JFrame {
>>
>> private ij.IJ myImageJ;
>> private ij.ImagePlus myImagePlus;
>> private ij.gui.ImageCanvas myImageCanvas;
>>
>> public static void main(String[] args) {
>> JFrame_TestImageJPlugin inst = new JFrame_TestImageJPlugin();
>> inst.setVisible(true);
>> }
>>
>> public JFrame_TestImageJPlugin() {
>> super();
>> initGUI();
>> }
>>
>> private void initGUI() {
>> try {
>> setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
>> pack();
>> setSize(400, 300);
>>
>> myImageJ = new ij.IJ();
>> myImageJ.open("image.bmp");
>> myImagePlus = myImageJ.getImage();
>> myImageCanvas = new ij.gui.ImageCanvas(myImagePlus);
>> this.add(myImageCanvas);
>>
>> myImageJ.run("Brightness/Contrast...");
>>
>> myImageCanvas.repaint();
>>
>> } catch (Exception e) {
>> e.printStackTrace();
>> }
>> }
>>}