Read/Write BigTIFF using BioFormat

144 views Asked by At

I need to I/O large images in TIFF format, so I need to use the BigTIFF format. I tried to use BioFormats (bioformats_package.jar) last version to read an image, using:

ImagePlus[] images = images = BF.openImagePlus(io) ;

Then, I wanted to access the Processor images[0].getProcessor() to modify/access the pixel values, but the result appears to not be any of the classical ImageJ processor: ByteProcessor, ColorProcessor, FloatProcessor, and ShortProcessor. I tested ALL of them using instanceof.

Any idea what type of Processor it could be?

Or how I would access the pixel values?

[EDIT] I still don't know what type of ImageProcessor the result is, but I found out that the saved pixels are encoded using Float, so 32 bits.

This is not ideal as I saved an image using Integer encoding, so there is a loss of precision when values are bigger than 20 millions.

1

There are 1 answers

3
thecarpy On

According to the JavaDocs on ImagePlus, getProcessor() returns an ImageProcessor on which you can perform a convertToByteProcessor() to get a ByteProcessor, you have other converters on ImageProcessor for other subclasses.