Re: ContrastAdjuster plugin
Posted by
Rémi Cathelin on
Aug 08, 2005; 4:09pm
URL: http://imagej.273.s1.nabble.com/ContrastAdjuster-plugin-tp3705076p3705079.html
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.
----------------------------------------------
Remi CATHELIN
INRA - SIGENAE Team BP 52627 - 31326 CASTANET-TOLOSAN cedex FRANCE
Phone: 33 (0)5 61 28 55 68
Email:
[hidden email]
----------------------------------------------
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();
> }
> }
> }
>
>