ij.process
Class TypeConverter

java.lang.Object
  extended by ij.process.TypeConverter

public class TypeConverter
extends java.lang.Object

This class converts an ImageProcessor to another data type.


Field Summary
(package private)  boolean doScaling
           
(package private)  int height
           
(package private)  int width
           
 
Constructor Summary
TypeConverter(ImageProcessor ip, boolean doScaling)
           
 
Method Summary
(package private)  FloatProcessor convertByteToFloat(float[] cTable)
          Converts a ByteProcessor to a FloatProcessor.
(package private)  ShortProcessor convertByteToShort()
          Converts a ByteProcessor to a ShortProcessor.
(package private)  ByteProcessor convertFloatToByte()
          Converts a FloatProcessor to a ByteProcessor.
(package private)  ShortProcessor convertFloatToShort()
          Converts a FloatProcessor to a ShortProcessor.
(package private)  ByteProcessor convertRGBToByte()
          Converts a ColorProcessor to a ByteProcessor.
(package private)  ByteProcessor convertShortToByte()
          Converts a ShortProcessor to a ByteProcessor.
(package private)  FloatProcessor convertShortToFloat(float[] cTable)
          Converts a ShortProcessor to a FloatProcessor.
 ImageProcessor convertToByte()
          Converts processor to a ByteProcessor.
 ImageProcessor convertToFloat(float[] ctable)
          Converts processor to a FloatProcessor.
 ImageProcessor convertToRGB()
          Converts processor to a ColorProcessor.
 ImageProcessor convertToShort()
          Converts processor to a ShortProcessor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

doScaling

boolean doScaling

width

int width

height

int height
Constructor Detail

TypeConverter

public TypeConverter(ImageProcessor ip,
                     boolean doScaling)
Method Detail

convertToByte

public ImageProcessor convertToByte()
Converts processor to a ByteProcessor.


convertShortToByte

ByteProcessor convertShortToByte()
Converts a ShortProcessor to a ByteProcessor.


convertFloatToByte

ByteProcessor convertFloatToByte()
Converts a FloatProcessor to a ByteProcessor.


convertRGBToByte

ByteProcessor convertRGBToByte()
Converts a ColorProcessor to a ByteProcessor. The pixels are converted to grayscale using the formula g=r/3+g/3+b/3. Call ColorProcessor.setWeightingFactors() to do weighted conversions.


convertToShort

public ImageProcessor convertToShort()
Converts processor to a ShortProcessor.


convertByteToShort

ShortProcessor convertByteToShort()
Converts a ByteProcessor to a ShortProcessor.


convertFloatToShort

ShortProcessor convertFloatToShort()
Converts a FloatProcessor to a ShortProcessor.


convertToFloat

public ImageProcessor convertToFloat(float[] ctable)
Converts processor to a FloatProcessor.


convertByteToFloat

FloatProcessor convertByteToFloat(float[] cTable)
Converts a ByteProcessor to a FloatProcessor. Applies a calibration function if the calibration table is not null.

See Also:
ImageProcessor.setCalibrationTable

convertShortToFloat

FloatProcessor convertShortToFloat(float[] cTable)
Converts a ShortProcessor to a FloatProcessor. Applies a calibration function if the calibration table is not null.

See Also:
ImageProcessor.setCalibrationTable

convertToRGB

public ImageProcessor convertToRGB()
Converts processor to a ColorProcessor.