Programmaticly applying an LUT to an ImagePluse

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

Programmaticly applying an LUT to an ImagePluse

Robert Lockwood
I'd like to try to apply an LUT such as "fire" to my very low contrast 16
bit unsigned ImagePlus.  The image displays very well using the below code:

        ContrastEnhancer ce = new ContrastEnhancer();
        ce.equalize(imp);

I've not been able to find an example using Google so have come to drink
from the well of knowledge again, Thanks.

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: Programmaticly applying an LUT to an ImagePluse

Michael Schmid
Hi Nate,

'Fire' (like the other LUT names) is a menu command, so you can use the macro recorder in 'java' mode.  You can also use something like
  IJ.run("Fire");
or, if you want to specify an image (which need not be the foreground image)
  IJ.run(imp, "Fire", null);


With Plugins>Utilities>Find Commands, you can also find the class responsible for this command, which is ij.plugin.LutLoader.  Looking at its source, I suspect that something like the following will also work for the current foreground image:
  new LutLoader.run("fire");

Michael
________________________________________________________________
On Nov 18, 2013, at 22:18, Robert Lockwood wrote:

> I'd like to try to apply an LUT such as "fire" to my very low contrast 16
> bit unsigned ImagePlus.  The image displays very well using the below code:
>
>        ContrastEnhancer ce = new ContrastEnhancer();
>        ce.equalize(imp);
>
> I've not been able to find an example using Google so have come to drink
> from the well of knowledge again, Thanks.
>
> Nate

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

Re: Programmaticly applying an LUT to an ImagePluse

Robert Lockwood
I had found LutLoader but didn't see how to use it.

I think I should have mentioned that I am displaying my images on a
JImagePanel.
This works and the Fire LUT is great for my demonstration until I can
construct a custom LUT.

ContrastEnhancer ce = new ContrastEnhancer();
ce.equalize(imp);
IJ.run(imp, "Fire", null);

Thank you kindly,

Nate



On Tue, Nov 19, 2013 at 1:00 AM, Michael Schmid <[hidden email]>wrote:

> Hi Nate,
>
> 'Fire' (like the other LUT names) is a menu command, so you can use the
> macro recorder in 'java' mode.  You can also use something like
>   IJ.run("Fire");
> or, if you want to specify an image (which need not be the foreground
> image)
>   IJ.run(imp, "Fire", null);
>
>
> With Plugins>Utilities>Find Commands, you can also find the class
> responsible for this command, which is ij.plugin.LutLoader.  Looking at its
> source, I suspect that something like the following will also work for the
> current foreground image:
>   new LutLoader.run("fire");
>
> Michael
> ________________________________________________________________
> On Nov 18, 2013, at 22:18, Robert Lockwood wrote:
>
> > I'd like to try to apply an LUT such as "fire" to my very low contrast 16
> > bit unsigned ImagePlus.  The image displays very well using the below
> code:
> >
> >        ContrastEnhancer ce = new ContrastEnhancer();
> >        ce.equalize(imp);
> >
> > I've not been able to find an example using Google so have come to drink
> > from the well of knowledge again, Thanks.
> >
> > Nate
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



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

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