/** Returns a 32-bit float version of this image as a FloatProcessor. For byte and short images, converts using a calibration function if a calibration table has been set using setCalibrationTable(). */ public ImageProcessor convertToFloat() { TypeConverter tc = new TypeConverter(this, false); return tc.convertToFloat(cTable); }
/** Returns an 8-bit version of this image as a ByteProcessor. */ public ImageProcessor convertToByte(boolean doScaling) { TypeConverter tc = new TypeConverter(this, doScaling); return tc.convertToByte(); }
/** Returns a 16-bit version of this image as a ShortProcessor. */ public ImageProcessor convertToShort(boolean doScaling) { TypeConverter tc = new TypeConverter(this, doScaling); return tc.convertToShort(); }
/** Returns an RGB version of this image as a ColorProcessor. */ public ImageProcessor convertToRGB() { TypeConverter tc = new TypeConverter(this, true); return tc.convertToRGB(); }
/** Returns an RGB version of this image as a ColorProcessor. */ public ImageProcessor convertToRGB() { TypeConverter tc = new TypeConverter(this, true); return tc.convertToRGB(); }
/** Returns a 32-bit float version of this image as a FloatProcessor. For byte and short images, converts using a calibration function if a calibration table has been set using setCalibrationTable(). */ public ImageProcessor convertToFloat() { TypeConverter tc = new TypeConverter(this, false); return tc.convertToFloat(cTable); }
/** Returns an 8-bit version of this image as a ByteProcessor. */ public ImageProcessor convertToByte(boolean doScaling) { TypeConverter tc = new TypeConverter(this, doScaling); return tc.convertToByte(); }
/** Returns a 16-bit version of this image as a ShortProcessor. */ public ImageProcessor convertToShort(boolean doScaling) { TypeConverter tc = new TypeConverter(this, doScaling); return tc.convertToShort(); }
private ImageProcessor getProcessor() { imp.setPositionWithoutUpdate(channel, slice, frame); final ImageProcessor ip = imp.getChannelProcessor(); if (ip instanceof FloatProcessor || ip instanceof ColorProcessor) return new TypeConverter(ip, false).convertToShort(); return ip; } }
ImageProcessor convertType(ImageProcessor ip1,ImageProcessor ip,boolean doScaling){ ImageProcessor result = null; TypeConverter tc = new TypeConverter(ip1,doScaling); if(ip instanceof ByteProcessor) result = tc.convertToByte(); else if(ip instanceof FloatProcessor) result = ip1.convertToFloat(); else if(ip instanceof ColorProcessor) result = tc.convertToRGB(); else if(ip instanceof ShortProcessor) result = tc.convertToShort(); else result = ip1; return result; } void del() {
(ColorProcessor) (new TypeConverter(montage.getProcessor(), bDoScaling)).convertToRGB(); final int[] rgb = new int[3];
(ColorProcessor) (new TypeConverter(proj.getProcessor(), bDoScaling)) .convertToRGB();