16-bit grayscale from URL?

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

16-bit grayscale from URL?

Zummy
I am using new ImagePlus(url).show().  Will this
display a 16-bit greyscale file with 16-bit values
in ImageJ, or will it convert to 8-bit?  I plan to use
the PNG file format.  We are using ImageMagick
to convert to PNG, so if ImageMagick converts to
8-bit grayscale, let me know that as well.

I don't really want to go through the trouble of reading
the PNG into a short array--I'd rather that ImageJ just
do the right thing when it parses the PNG file.  We
had problems with passing Java 16-bit grayscale
Image objects to ImageJ, so I'm wondering if there
is an issue here as well.

I am using version 1.28.

My users like to see the 16 bit values, hence we don't
want to convert to 8 bit.  We are using a 12-bit camera
to capture the images.  We used to use 8-bit cameras,
so we have mixed data now.

So far, I am seeing 8-bit, but I'm not sure what part of the
application has 16-bit.  We are attempting to get
an image we know is 16-bit to try this experiment on.

Obviously, this is a little premature, but I thought I'd
ask.

John
Reply | Threaded
Open this post in threaded view
|

Re: 16-bit grayscale from URL?

Wayne Rasband
ImageJ can open 16-bit TIFFs using a URL. For example, the  
File>Import>URL command will open the 16-bit TIFF at "http://
rsb.info.nih.gov/ij/images/m51.tif". PNG files open as RGB or 8-bit  
grayscale.

-wayne

On Nov 16, 2005, at 7:42 PM, John Carlson wrote:

> I am using new ImagePlus(url).show().  Will this
> display a 16-bit greyscale file with 16-bit values
> in ImageJ, or will it convert to 8-bit?  I plan to use
> the PNG file format.  We are using ImageMagick
> to convert to PNG, so if ImageMagick converts to
> 8-bit grayscale, let me know that as well.
>
> I don't really want to go through the trouble of reading
> the PNG into a short array--I'd rather that ImageJ just
> do the right thing when it parses the PNG file.  We
> had problems with passing Java 16-bit grayscale
> Image objects to ImageJ, so I'm wondering if there
> is an issue here as well.
>
> I am using version 1.28.
>
> My users like to see the 16 bit values, hence we don't
> want to convert to 8 bit.  We are using a 12-bit camera
> to capture the images.  We used to use 8-bit cameras,
> so we have mixed data now.
>
> So far, I am seeing 8-bit, but I'm not sure what part of the
> application has 16-bit.  We are attempting to get
> an image we know is 16-bit to try this experiment on.
>
> Obviously, this is a little premature, but I thought I'd
> ask.
>
> John
>
Reply | Threaded
Open this post in threaded view
|

Re: 16-bit grayscale from URL?

Jeff Brandenburg
In reply to this post by Zummy
As I recall, ImageJ doesn't yet (as of 1.35a?) support 16-bit PNG
format.  I was looking into this because I'm serving up 16-bit (TIFF)
images over the Web, too.  (I don't use ImagePlus(url).show() because I
need to send a cookie in the HTTP request; there may be a way to do
this with ImagePlus(url), but I don't know how.)

How large are your images?  Is the compression you get with PNG
critical, or are you using a client that can't deal with TIFFs?

On Nov 16, 2005, at 7:42 PM, John Carlson wrote:

> I am using new ImagePlus(url).show().  Will this
> display a 16-bit greyscale file with 16-bit values
> in ImageJ, or will it convert to 8-bit?  I plan to use
> the PNG file format.
--
        -jeffB (Jeff Brandenburg, Duke Center for In-Vivo Microscopy)
Reply | Threaded
Open this post in threaded view
|

Re: 16-bit grayscale from URL?

Zummy
In reply to this post by Wayne Rasband
Hmm.  I am having trouble with TIFF.   I don't know
if it's ImageJ or ImageMagick, or just the size of the
images.  Thanks for the note though.  I will try
our download link to verify that the TIFFs are generated
from ImageMagick.

I think I read somewhere that PNG can support 16-bit
greyscale.  Any hopes of seeing support in ImageJ?

John

At 06:22 PM 11/16/2005, you wrote:

>ImageJ can open 16-bit TIFFs using a URL. For example, the
>File>Import>URL command will open the 16-bit TIFF at "http://
>rsb.info.nih.gov/ij/images/m51.tif". PNG files open as RGB or 8-bit
>grayscale.
>
>-wayne
>
>On Nov 16, 2005, at 7:42 PM, John Carlson wrote:
>
>>I am using new ImagePlus(url).show().  Will this
>>display a 16-bit greyscale file with 16-bit values
>>in ImageJ, or will it convert to 8-bit?  I plan to use
>>the PNG file format.  We are using ImageMagick
>>to convert to PNG, so if ImageMagick converts to
>>8-bit grayscale, let me know that as well.
>>
>>I don't really want to go through the trouble of reading
>>the PNG into a short array--I'd rather that ImageJ just
>>do the right thing when it parses the PNG file.  We
>>had problems with passing Java 16-bit grayscale
>>Image objects to ImageJ, so I'm wondering if there
>>is an issue here as well.
>>
>>I am using version 1.28.
>>
>>My users like to see the 16 bit values, hence we don't
>>want to convert to 8 bit.  We are using a 12-bit camera
>>to capture the images.  We used to use 8-bit cameras,
>>so we have mixed data now.
>>
>>So far, I am seeing 8-bit, but I'm not sure what part of the
>>application has 16-bit.  We are attempting to get
>>an image we know is 16-bit to try this experiment on.
>>
>>Obviously, this is a little premature, but I thought I'd
>>ask.
>>
>>John
Reply | Threaded
Open this post in threaded view
|

Re: 16-bit grayscale from URL?

Wayne Rasband
> Hmm.  I am having trouble with TIFF.   I don't know
> if it's ImageJ or ImageMagick, or just the size of the
> images.  Thanks for the note though.  I will try
> our download link to verify that the TIFFs are generated
> from ImageMagick.
>
> I think I read somewhere that PNG can support 16-bit
> greyscale.  Any hopes of seeing support in ImageJ?

Jarek Sacha's Image I/O plugins read and write 16-bit PNGs.

    http://ij-plugins.sourceforge.net/plugins/imageio/

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: 16-bit grayscale from URL?

Zummy
 From what I've seen of the Image I/O plugins, they work
on Files.  I am trying to read a 16-bit TIFF through
a URL that doesn't end in .tif.  I can download an
equivalent Image from the web site, and it displays fine if
I pass it as a argument to ImageJ.

I believe I am setting the Content-Type to image/tif

I looked through the code, and it looks like it is looking for
.tif or .TIF at the end of the URL.  So if I change
my URL from

http://hostname/dv/no_handler/Archive_Image.html?image_id=130267&type=tif

to

http://hostname/dv/no_handler/Archive_Image.html?image_id=130267&type=.tif

things start working.

I guess my request would be that ImageJ look at the
Content-Type instead of relying on an extension in the URL.
There are several Content-Types for TIFF.

The change would be in Opener.java, in the openURL
method.

As it is, my ImageJ applet hanging, and I have to kill it and my
browser.

I will pursue  adding the . to my code

John

At 09:08 AM 11/18/2005, Wayne Rasband wrote:

>>Hmm.  I am having trouble with TIFF.   I don't know
>>if it's ImageJ or ImageMagick, or just the size of the
>>images.  Thanks for the note though.  I will try
>>our download link to verify that the TIFFs are generated
>>from ImageMagick.
>>
>>I think I read somewhere that PNG can support 16-bit
>>greyscale.  Any hopes of seeing support in ImageJ?
>
>Jarek Sacha's Image I/O plugins read and write 16-bit PNGs.
>
>    http://ij-plugins.sourceforge.net/plugins/imageio/
>
>-wayne