ImageJ cannot open 1-bit LZW compressed TIFFs

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

ImageJ cannot open 1-bit LZW compressed TIFFs

litespeedmarc
Our application allows to view image files, and we reference IJ.jar to display certain TIFF files that jai is unable to.

We have an end-user TIFF file that IJ.jar isn't able to open.  The file is a 1 bit LZW compressed TIFF.

Using latest imagej-IO plugins, I'm still unable to open the file (even using IJ.jar by itself, via file --> open).

I was able to add to ImageReader.java some code to parse the file correctly (essentially a method called readCompressed1BitImage).  But this seems like a hack, possibly re-inventing the wheel, not very forward compatible (as I changed the code directly in ImageReader), and potentially violating license (?) as doing this would require modifying source and embedding it within our app.

Unfortunately, this TIFF image contains private data that cannot be posted here.

I have a couple of questions here:
1) Is there a plugin that can do this?
2) If so, how would this type of call work with the plugin?
                        FileOpener fo = new FileOpener(fileInfoPreviouslyFetched);
                        ImagePlus imagePlus = fo.open(false);
                        RenderedImage ri = imagePlus.getBufferedImage();
                        ...
3) Would modifying source and including it within our app violate public domain license?  My guess is not.
4) Does anyone else out there have other sample of LZW compressed 1 bit TIFF files, as I would like to include in our code base for unit tests, but can't really use the file I've got.
                       


Reply | Threaded
Open this post in threaded view
|

Re: ImageJ cannot open 1-bit LZW compressed TIFFs

ctrueden
Hi litespeedmarc,

> We have an end-user TIFF file that IJ.jar isn't able to open.  The
> file is a 1 bit LZW compressed TIFF.

Did you try opening your file using the Bio-Formats Importer plugin
(bundled with the Fiji distribution of ImageJ: http://fiji.sc/)? It might
support 1-bit data...

If not, you could contribute your 1-bit LZW compressed TIFF support to the
Bio-Formats project, since the Bio-Formats TIFF support is much more robust
and featureful than what is built in to ImageJ 1.x.

You can find the project at:
  https://github.com/openmicroscopy/bioformats
and LZW logic is at:

https://github.com/openmicroscopy/bioformats/blob/develop/components/scifio/src/loci/formats/codec/LZWCodec.java

Regards,
Curtis


On Tue, Jul 2, 2013 at 6:03 PM, litespeedmarc <[hidden email]>wrote:

> Our application allows to view image files, and we reference IJ.jar to
> display certain TIFF files that jai is unable to.
>
> We have an end-user TIFF file that IJ.jar isn't able to open.  The file is
> a
> 1 bit LZW compressed TIFF.
>
> Using latest imagej-IO plugins, I'm still unable to open the file (even
> using IJ.jar by itself, via file --> open).
>
> I was able to add to ImageReader.java some code to parse the file correctly
> (essentially a method called readCompressed1BitImage).  But this seems like
> a hack, possibly re-inventing the wheel, not very forward compatible (as I
> changed the code directly in ImageReader), and potentially violating
> license
> (?) as doing this would require modifying source and embedding it within
> our
> app.
>
> Unfortunately, this TIFF image contains private data that cannot be posted
> here.
>
> I have a couple of questions here:
> 1) Is there a plugin that can do this?
> 2) If so, how would this type of call work with the plugin?
>                         FileOpener fo = new
> FileOpener(fileInfoPreviouslyFetched);
>                         ImagePlus imagePlus = fo.open(false);
>                         RenderedImage ri = imagePlus.getBufferedImage();
>                         ...
> 3) Would modifying source and including it within our app violate public
> domain license?  My guess is not.
> 4) Does anyone else out there have other sample of LZW compressed 1 bit
> TIFF
> files, as I would like to include in our code base for unit tests, but
> can't
> really use the file I've got.
>
>
>
>
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/ImageJ-cannot-open-1-bit-LZW-compressed-TIFFs-tp5003746.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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