getBufferedImage in class ByteProcessor returns a BufferredImage of type = 0

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

getBufferedImage in class ByteProcessor returns a BufferredImage of type = 0

Casqueiro Gilles
Dear all,

When I use the getBufferedImage from the ByteProcessor class, after having used setLut(lut), it returns an BufferredImage with imageType = 0, whereas without setting any LUT, the BufferredImage returned is of type 10.

The LUT seems to be correctly applied, I can see it when I display the corresponding ImagePlus.

I am not sure if this BufferedImage type “0” is correct, regarding to the documentation: http://docs.oracle.com/javase/7/docs/api/java/awt/image/BufferedImage.html.

Gilles



-----------------------------------------------------------------------

Le informazioni contenute in questo messaggio di posta elettronica e relativi allegati sono riservate e confidenziali e ne è vietata la diffusione in qualunque modo eseguita. Qualora Lei non fosse la persona a cui il presente messaggio è destinato, La invitiamo ad eliminarlo e a darcene gentile comunicazione.

The information contained in this e-mail and any attachments is confidential and may also be privileged. If you are not the named recipient please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.

-----------------------------------------------------------------------

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

Re: getBufferedImage in class ByteProcessor returns a BufferredImage of type = 0

John Hayes
Hi Gilles,

Can you say a little more about what you are trying to do?

It sounds like you want the LUT applied to the image you're manipulating but the BufferedImage will not likely be in color unless you have converted to an RGB ImagePlus that uses ColorProcessor. If you're simply wanting to programmatically save the LUT-applied ImagePlus there are better ways than accessing the BufferedImage directly because it's a quite low-level class in the context of ImageJ.

Also, imageType = 0 is BufferedImage.TYPE_CUSTOM and imageType = 10 is BufferedImage.TYPE_BYTE_GRAY, which makes sense in the context I believe.

Best,

John

Le 3 mars 2015 à 12:57, Casqueiro Gilles a écrit :

> Dear all,
>
> When I use the getBufferedImage from the ByteProcessor class, after having used setLut(lut), it returns an BufferredImage with imageType = 0, whereas without setting any LUT, the BufferredImage returned is of type 10.
>
> The LUT seems to be correctly applied, I can see it when I display the corresponding ImagePlus.
>
> I am not sure if this BufferedImage type “0” is correct, regarding to the documentation: http://docs.oracle.com/javase/7/docs/api/java/awt/image/BufferedImage.html.
>
> Gilles
>
>
>
> -----------------------------------------------------------------------
>
> Le informazioni contenute in questo messaggio di posta elettronica e relativi allegati sono riservate e confidenziali e ne è vietata la diffusione in qualunque modo eseguita. Qualora Lei non fosse la persona a cui il presente messaggio è destinato, La invitiamo ad eliminarlo e a darcene gentile comunicazione.
>
> The information contained in this e-mail and any attachments is confidential and may also be privileged. If you are not the named recipient please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.
>
> -----------------------------------------------------------------------
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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