save 16 bit tif
Posted by alessandra griffa on Jun 06, 2008; 8:39am
URL: http://imagej.273.s1.nabble.com/save-16-bit-tif-tp3695929.html
Good morning!
I have an ImagePlus stack ('impoutstack'), 32 bit, and I would like to save
it as a 16 bit tif stack.
I did this:
*ImageProcessor ip = impoutstack.getProcessor();
impoutstack.setProcessor(null, ip.convertToShort(true)); // conversion
impoutstack.setCalibration(impoutstack.getCalibration()); // update
calibration
FileSaver saverstack = new FileSaver(impoutstack);*
*saverstack.saveAsTiffStack(pathout + "/" + filename + ".tif");*
but at run time I get the exception
*java.lang.ClassCastExceprion at ij.io.ImageWriter.write16BitStack*
Does anyone know how to easily save as 16 bit tif stack?
Thanks a lot,
Alessandra