Login  Register

how to use ImageProcessor convertToShortProcessor() ?

Posted by Leon Espinosa-3 on Oct 14, 2014; 7:01am
URL: http://imagej.273.s1.nabble.com/how-to-use-ImageProcessor-convertToShortProcessor-tp5010023.html

Hello, I'm trying to convert a 32bits image processor (float processor) in a 16-bits (short processor) but "it" says that FloatProcessor object has no convertToShortProcessor() method. This script fails :

imp = IJ.createImage("Untitled", "32-bit black", 500, 500, 1);
imp.show();
ip = imp.getProcessor();
ip16b = ip.convertToShortProcessor();

In my script I'm trying to avoid IJ.run(imp, "16-bit", ""); in order to avoid to generate an ImagePlus for each processor that I need to convert...

Thank you very much for any help

Leon

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