Login  Register

Re: Programatically apply LUT to 16 bit gray image

Posted by Jerome Mutterer-3 on Nov 30, 2014; 8:57am
URL: http://imagej.273.s1.nabble.com/Programatically-apply-LUT-to-16-bit-gray-image-tp5010690p5010692.html

Hi Robert,
Somehow, you should set fi.reds, fi.greens and fi.blues of your FileInfo
object and then create and set a ColorModel as seen at:
https://github.com/imagej/imagej1/blob/master/ij/plugin/LutLoader.java#L90
If you look at further in this class, you'll find various methods to set
r,g,b arrays from different sources (create from scratch, or load from
binary or text file).

Jerome.

On 30 November 2014 at 00:04, Robert Lockwood <[hidden email]> wrote:

> I have dropped a couple of LUT's in the LUT folder of FiJi and want to
> apply them in my Java Application to some test images (RAW) that I've been
> able to read in and display.
>
> My testing code:
>
> fi = new FileInfo();
> fi.fileName = input_file;
> fi.fileType = FileInfo.GRAY16_UNSIGNED;
> fi.width = imgWidth;
> fi.height = imgHeight;
> fi.intelByteOrder = false;
> fo = new FileOpener(fi);
> imp = fo.open(false);
> if (imp != null) {
> ip = (ShortProcessor) imp.getProcessor();
> bi = ip.get16BitBufferedImage();
> new ImagePlus(input_file, bi).show();
> }
>
>
> How to I import the LUT into my code.  It appears that if I have an LUT I
> can set it but I don't know how to import it.
>
> My objective, after a suitable LUT is found, is to save the image as a PNG.
>
>
> --
> When I was 12 I thought I would live forever.
> So far, so good.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Jerome Mutterer
CNRS - Institut de biologie moléculaire des plantes
12, rue du Général Zimmer
67084 Strasbourg Cedex
T 0367155339
www.ibmp.cnrs.fr

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