coding a contrast stretch.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

coding a contrast stretch.

Robert Lockwood
I have a ByteBuffer with an image (16 bits per pixel and monochrome) that I
can display in my UI and I can save as a TIFF file using ImageJ.

I've just written code to read a saved TIFF from a file using ImagePlus,
get the BufferedImage and both display it in my UI and as an ImageJ window.

My test images have absolutely rotten contrast so I need to do a linear
stretch but have not found it in the DOCS yet and Google has been no help.

How do I do this?

TIA

Nate



--
When I was 12 I thought I would live forever.
So far, so good.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: coding a contrast stretch.

dscho
Hi Nate,

On Thu, 26 Sep 2013, Robert Lockwood wrote:

> I have a ByteBuffer with an image (16 bits per pixel and monochrome)
> that I can display in my UI and I can save as a TIFF file using ImageJ.
>
> I've just written code to read a saved TIFF from a file using ImagePlus,
> get the BufferedImage and both display it in my UI and as an ImageJ
> window.
>
> My test images have absolutely rotten contrast so I need to do a linear
> stretch but have not found it in the DOCS yet and Google has been no
> help.

Probably use the setDisplayRange() method on the ImagePlus before
extracting the AWT Image to display?

http://jenkins.imagej.net/job/ImageJ1-javadoc/javadoc/ij/ImagePlus.html#setDisplayRange%28double,%20double%29

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html