Login  Register

Re: File Conversion bug and Batch Converter

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

Thank you so very much for the plugin update Wayne

That will save me a lot of work!

This community is amazing, great job =]

On Tue, 2009-02-10 at 10:51 -0500, Wayne Rasband wrote:

> >   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 Image>Type>8-bit command converts 16-bit composite color images  
> (e.g., 48-bit RGB TIFFs) into 8-bit composite color images. You can use  
> Image>Type>RGB Color followed by Image>Type>8-bit to convert a  
> composite color image into an 8-bit grayscale image.
>
> > 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:
>
> There is an updated version of the Batch_Converter plugin at
>
>     http://rsb.info.nih.gov/ij/plugins/batch-converter.html
>
> that fixed this bug.
>
> -wayne
>
> > 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)
> >

--
Hugo Arruda de Moura Torres
==================================
Departamento de Biofísica
Universidade Federal de São Paulo
Rua Botucatu 862 7o. andar
CEP 04023-062 Vila Clementino
São Paulo - SP - Brasil
Tel:+55 (11) 5576 4530 r.220
Fax: 55 11 5571 5780