[ImageJ-devel] ImageOpener always giving me three channels when these is only one.

Curtis Rueden ctrueden at wisc.edu
Sun Dec 12 15:58:08 CST 2010

Hi Grant,

The image has an 8-bit LUT, which is why it's being read as 3 channels.
Currently ImageOpener expands such lookup tables, since ImgLib does not
explicitly support indexed color. So the behavior is expected.

Also, it's fine to use ImageJFunctions.displayAsVirtualStack(inImg).show()
for testing, but presumably you are not using it in IJX for production? The
work Barry has been doing in ij1bridge is the direction we want to go.


On Sun, Dec 12, 2010 at 1:22 PM, Grant B. Harris <gharris at mbl.edu> wrote:

> I'm having a problem with opening an imglib.Image...
> I'm testing with an image: Cells.tif is an unsigned 8-bit image.
> The Image created by ImageOpener.openImage(file) has 3 channels when it
> should have only one.
> (http://dev.imagejdev.org/svn/imagej/trunk/ijx/Cells.tif)
> The code I am using is:
>        String filename = "Cells.tif";
>        final ImageOpener imageOpener = new ImageOpener();
>        Image<T> inImg = imageOpener.openImage(filename);
>        reportInformation(inImg);
> This outputs:
>        Image 'Cells.tif [X Y Channel]', dim=(617, 460, 3)
>        Type = mpicbg.imglib.type.numeric.integer.UnsignedByteType
>        Container = mpicbg.imglib.container.planar.PlanarContainer
> And when I do ImageJFunctions.displayAsVirtualStack(inImg).show()
> I get an ImageWindow with a slider for 3 channels...
> Is this a bug?  Or am I doing something wrong?
> -- Grant
> _______________________________________________
> ImageJ-devel mailing list
> ImageJ-devel at imagejdev.org
> http://imagejdev.org/mailman/listinfo/imagej-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20101212/e9b7817f/attachment.html>

More information about the ImageJ-devel mailing list