Login  Register

Re: image gets fully white if i set window level

Posted by Prashant-2-3 on Aug 11, 2009; 5:47am
URL: http://imagej.273.s1.nabble.com/image-gets-fully-white-if-i-set-window-level-tp3691515p3691517.html

Thanks Michael,

On my paintComponent function I am doing like this...
Here

Image img;
ImagePlus implus;

Public void paintComponent(Graphicd g)
{
        if (implus == null)
        {
                return;
        }
        img = null;
       
        //getting current image from imageplus
        img = implus.getImage();

        if (img != null)
        {
                g.drawImage(img, drawx, drawy, drawx1, drawy1, null);
        }
}

After any change in window level I call below method.


implus.updateImage();
repaint();

thanks



-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
Michael Schmid
Sent: Monday, August 10, 2009 8:38 PM
To: [hidden email]
Subject: Re: image gets fully white if i set window level

Hi,

to me it looks like a problem with the
  public void paint(Graphics g)
method of your viewer. Probably it does not paint the image (g.drawImage)
except on the first call, so any repaint operation will leave it white.
E.g., do you have the bufferedImage in a class variable, so that it
remains accessible in a separate (repaint) thread)?

Michael
______________________________________________________________________


On Mon, August 10, 2009 12:35, prashant wrote:

> Hi Everyone,
>
>
>
> I am creating a Dicom Image viewer.
>
> I am using Imagej for opening uncompressed images and Loci for Compressed
> images.
>
>
>
> I am opening my compressed images with the help of bio-Formats.jar.
>
> After that I convert this image to Imagej's ImagePlus object and then
> displaying onto my panel.
>
>
>
> Everything is successful but after display when I change a Window level or
> window center with just a fraction
>
> then image gets fully white.
>
>
>
> Is there is any problem in conversion or why image is ok with window level
> and window center.
>
>
>
> Thanks in advance
>
> Prashant
>