Login  Register

File Conversion bug and Batch Converter

Posted by Hugo A. M. Torres on Feb 10, 2009; 6:10am
URL: http://imagej.273.s1.nabble.com/12-and-14-bit-PNGs-in-imageJ-tp3693766p3693767.html

  Hello again listmates,

If I try to convert 16bit color images into 8bit grayscale by doing
"image>type>8bit" I get an RGB stack instead.

The way I found around that is doing "image, color, stack to rgb"
followed by "image, type, 8bit".

Shouldn't I be able to convert directly? Maybe its a bug...

Also, I tried to apply the batch converter plugin to convert all the
files from a folder to 8bit-TIFF and this is what I get:

java.lang.ClassCastException: [S cannot be cast to [B
        at ij.io.ImageWriter.write8BitStack(ImageWriter.java:38)
        at ij.io.ImageWriter.write(ImageWriter.java:214)
        at ij.io.TiffEncoder.write(TiffEncoder.java:118)
        at ij.io.TiffEncoder.write(TiffEncoder.java:138)
        at ij.io.FileSaver.saveAsTiffStack(FileSaver.java:126)
        at ij.io.FileSaver.saveAsTiff(FileSaver.java:79)
        at ij.plugin.filter.Writer.run(Writer.java:20)
        at
ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:245)
        at
ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:102)
        at ij.IJ.runPlugIn(IJ.java:151)
        at ij.Executer.runCommand(Executer.java:119)
        at ij.Executer.run(Executer.java:58)
        at ij.IJ.run(IJ.java:241)
        at ij.IJ.run(IJ.java:284)
        at ij.IJ.saveAs(IJ.java:1312)
        at ij.IJ.saveAs(IJ.java:1249)
        at Batch_Converter.convert(Batch_Converter.java:59)
        at Batch_Converter.run(Batch_Converter.java:26)
        at ij.IJ.runUserPlugIn(IJ.java:176)
        at ij.IJ.runPlugIn(IJ.java:142)
        at ij.Executer.runCommand(Executer.java:119)
        at ij.Executer.run(Executer.java:58)
        at java.lang.Thread.run(Thread.java:619)