Class AlgorithmChangeType

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

    public class AlgorithmChangeType
    extends AlgorithmBase
    This is a convenience function to convert from one image type to another and remap the data into a new range. It assumes that that calling function has checked that the range values are in the range of the image type. For example, an Unsigned Byte image type can represent data from 0 - 255 and therefore if converting from a Short type (-32768 to 32767) the range parameters should fall between 0 and 255. This class can also be used to remap data to a different range without changing the data type! In going between COMPLEX and DCOMPLEX the real and imaginary signs should not be changed and the imaginary/real ratios should not be changed so just multiply both the real and imaginary parts by endRange2/endRange1.
    Version:
    0.1 June 15, 1998
    Author:
    Matthew J. McAuliffe, Ph.D.
    See Also:
    ModelImage
    • Field Detail

      • colorFactor

        private int colorFactor
        1 for black and white, 4 for color.
      • complexFactor

        private int complexFactor
        1 for real images, 2 for complex.
      • endRange1

        private double endRange1
        The ending range value of the input image. Typically the image maximum.
      • endRange2

        private double endRange2
        The ending range value of the output image.
      • stRange1

        private double stRange1
        The starting range value of the input image. Typically the image minimum.
      • stRange2

        private double stRange2
        The starting range value of the output image.
    • Constructor Detail

      • AlgorithmChangeType

        public AlgorithmChangeType​(ModelImage destImg,
                                   ModelImage srcImg,
                                   double stRge1,
                                   double endRge1,
                                   double stRge2,
                                   double endRge2,
                                   boolean img25D)
        Creates a new AlgorithmChangeType object.
        Parameters:
        destImg - image model where result image is to stored
        srcImg - source image model
        stRge1 - starting value of intensities of the source image
        endRge1 - ending value of intensities of the source image
        stRge2 - starting value of intensities of the destination image
        endRge2 - ending value of intensities of the destination image
        img25D - DOCUMENT ME!
      • AlgorithmChangeType

        public AlgorithmChangeType​(ModelImage srcImg,
                                   int newType,
                                   double stRge1,
                                   double endRge1,
                                   double stRge2,
                                   double endRge2,
                                   boolean img25D)
        Creates a new AlgorithmChangeType object.
        Parameters:
        srcImg - source image model
        newType - new type that the source image is to become.
        stRge1 - starting value of intensities of the source image
        endRge1 - ending value of intensities of the source image
        stRge2 - starting value of intensities of the destination image
        endRge2 - ending value of intensities of the destination image
        img25D - DOCUMENT ME!
    • Method Detail

      • finalize

        public void finalize()
        Prepares this class for destruction.
        Overrides:
        finalize in class AlgorithmBase
      • calcInPlace2D

        private void calcInPlace2D()
        This function replaces the source image with the new type image and new data range.
      • calcInPlace34D

        private void calcInPlace34D()
        This function replaces the source image with the new type image and new data range.
      • calcStoreInDest2D

        private void calcStoreInDest2D()
        This function produces a new image with the new data type and new data range.
      • calcStoreInDest34D

        private void calcStoreInDest34D()
        This function produces a new image with the new data type and new data range.