Login  Register

ContrastAdjuster plugin

Posted by Blandine Chanteloup on Aug 08, 2005; 3:13pm
URL: http://imagej.273.s1.nabble.com/ContrastAdjuster-plugin-tp3705076.html

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();
                }
        }
}