Class Algorithm4DImageCalculator

java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.utilities.Algorithm4DImageCalculator
All Implemented Interfaces:
ActionListener, WindowListener, Runnable, EventListener

public class Algorithm4DImageCalculator extends AlgorithmBase
Author:
pandyan algorithm for 4D Image calculation The way this algorithm works is by taking 1 slice at a time from each time point and building an xyt volume. It then does the math on this volume...and in this way builds the result image
  • Field Details

    • ADD

      public static final int ADD
      add
      See Also:
    • AVERAGE

      public static final int AVERAGE
      average
      See Also:
    • MINIMUM

      public static final int MINIMUM
      minimum
      See Also:
    • MAXIMUM

      public static final int MAXIMUM
      maximum
      See Also:
    • STDDEV

      public static final int STDDEV
      std dev
      See Also:
    • NORM

      public static final int NORM
      norm
      See Also:
    • image

      private ModelImage image
      images
    • destImage

      private ModelImage destImage
      images
    • operationType

      private int operationType
      operation type
    • doClip

      private boolean doClip
      whether to clip or promote
    • dataType

      private int dataType
      data type
    • colorFactor

      private int colorFactor
  • Constructor Details

    • Algorithm4DImageCalculator

      public Algorithm4DImageCalculator()
      constructor
    • Algorithm4DImageCalculator

      public Algorithm4DImageCalculator(ModelImage image, ModelImage resultImage, int operationType, boolean doClip)
      constructor
      Parameters:
      image -
      resultImage -
      operationType -
      doClip -
  • Method Details

    • runAlgorithm

      public void runAlgorithm()
      Run algorithm
      Specified by:
      runAlgorithm in class AlgorithmBase
    • doByteMax

      private byte[] doByteMax(byte[] xytBuff)
      Calculates the max between 2 4d-byte-images by doing math on an xyt buffer that is built from both images
      Parameters:
      xytBuff - - the input
      Returns:
      - the xy result slice
    • doByteMin

      private byte[] doByteMin(byte[] xytBuff)
      Calculates the minimum between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doByteAverage

      private byte[] doByteAverage(byte[] xytBuff)
      Calculates the average between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doByteNormClip

      private byte[] doByteNormClip(byte[] xytBuff)
      Calculates the norm between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doByteNormPromote

      private short[] doByteNormPromote(byte[] xytBuff)
      Calculates the norm between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doByteStdDev

      private byte[] doByteStdDev(byte[] xytBuff)
      Calculates the standard deviation between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doByteAddClip

      private byte[] doByteAddClip(byte[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doByteAddPromote

      private short[] doByteAddPromote(byte[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortMax

      private short[] doShortMax(short[] xytBuff)
      Calculates the max between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortMin

      private short[] doShortMin(short[] xytBuff)
      Calculates the minimum between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortAverage

      private short[] doShortAverage(short[] xytBuff)
      Calculates the average between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortNormClip

      private short[] doShortNormClip(short[] xytBuff)
      Calculates the norm between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortNormPromote

      private int[] doShortNormPromote(short[] xytBuff)
      Calculates the norm between 2 short images
      Parameters:
      xytBuff - - the xyt
      Returns:
    • doShortStdDev

      private short[] doShortStdDev(short[] xytBuff)
      Calculates the standard deviation between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortAddClip

      private short[] doShortAddClip(short[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortAddPromote

      private int[] doShortAddPromote(short[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntMax

      private int[] doIntMax(int[] xytBuff)
      Calculates the max between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntMin

      private int[] doIntMin(int[] xytBuff)
      Calculates the minimum between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntAverage

      private int[] doIntAverage(int[] xytBuff)
      Calculates the average between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntNormClip

      private int[] doIntNormClip(int[] xytBuff)
      Calculates the norm between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntNormPromote

      private long[] doIntNormPromote(int[] xytBuff)
      Calculates the norm between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntStdDev

      private int[] doIntStdDev(int[] xytBuff)
      Calculates the standard deviation between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntAddClip

      private int[] doIntAddClip(int[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntAddPromote

      private long[] doIntAddPromote(int[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatMax

      private float[] doFloatMax(float[] xytBuff)
      Calculates the max between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatMin

      private float[] doFloatMin(float[] xytBuff)
      Calculates the minimum between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatAverage

      private float[] doFloatAverage(float[] xytBuff)
      Calculates the average between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatNormClip

      private float[] doFloatNormClip(float[] xytBuff)
      Calculates the norm between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatNormPromote

      private double[] doFloatNormPromote(float[] xytBuff)
      Calculates the norm between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatStdDev

      private float[] doFloatStdDev(float[] xytBuff)
      Calculates the standard deviation between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatAddClip

      private float[] doFloatAddClip(float[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatAddPromote

      private double[] doFloatAddPromote(float[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongAddClip

      private long[] doLongAddClip(long[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongAverage

      private long[] doLongAverage(long[] xytBuff)
      Calculates the average between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongMax

      private long[] doLongMax(long[] xytBuff)
      Calculates the max between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongMin

      private long[] doLongMin(long[] xytBuff)
      Calculates the minimum between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongStdDev

      private long[] doLongStdDev(long[] xytBuff)
      Calculates the standard deviation between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongNormClip

      private long[] doLongNormClip(long[] xytBuff)
      Calculates the norm between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongAddPromote

      private double[] doLongAddPromote(long[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongNormPromote

      private double[] doLongNormPromote(long[] xytBuff)
      Calculates the norm between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doDoubleAddClip

      private double[] doDoubleAddClip(double[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doDoubleAverage

      private double[] doDoubleAverage(double[] xytBuff)
      Calculates the average between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doDoubleMax

      private double[] doDoubleMax(double[] xytBuff)
      Calculates the max between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doDoubleMin

      private double[] doDoubleMin(double[] xytBuff)
      Calculates the minimum between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doDoubleStdDev

      private double[] doDoubleStdDev(double[] xytBuff)
      Calculates the standard deviation between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doDoubleNormClip

      private double[] doDoubleNormClip(double[] xytBuff)
      Calculates the norm between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortAddClipARGB

      private short[] doShortAddClipARGB(short[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortAverageARGB

      private short[] doShortAverageARGB(short[] xytBuff)
      Calculates the average between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortMaxARGB

      private short[] doShortMaxARGB(short[] xytBuff)
      Calculates the max between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortMinARGB

      private short[] doShortMinARGB(short[] xytBuff)
      Calculates the minimum between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortStdDevARGB

      private short[] doShortStdDevARGB(short[] xytBuff)
      Calculates the standard deviation between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortNormClipARGB

      private short[] doShortNormClipARGB(short[] xytBuff)
      Calculates the norm between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortAddPromoteARGB

      private int[] doShortAddPromoteARGB(short[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doShortNormPromoteARGB

      private int[] doShortNormPromoteARGB(short[] xytBuff)
      Calculates the norm between 2 short images
      Parameters:
      xytBuff - - the xyt
      Returns:
    • doIntAddClipARGB

      private int[] doIntAddClipARGB(int[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntAverageARGB

      private int[] doIntAverageARGB(int[] xytBuff)
      Calculates the average between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntMaxARGB

      private int[] doIntMaxARGB(int[] xytBuff)
      Calculates the max between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntMinARGB

      private int[] doIntMinARGB(int[] xytBuff)
      Calculates the minimum between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntStdDevARGB

      private int[] doIntStdDevARGB(int[] xytBuff)
      Calculates the standard deviation between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntNormClipARGB

      private int[] doIntNormClipARGB(int[] xytBuff)
      Calculates the norm between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntAddPromoteARGB

      private long[] doIntAddPromoteARGB(int[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doIntNormPromoteARGB

      private long[] doIntNormPromoteARGB(int[] xytBuff)
      Calculates the norm between 2 short images
      Parameters:
      xytBuff - - the xyt
      Returns:
    • doLongAddClipARGB

      private long[] doLongAddClipARGB(long[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongAverageARGB

      private long[] doLongAverageARGB(long[] xytBuff)
      Calculates the average between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongMaxARGB

      private long[] doLongMaxARGB(long[] xytBuff)
      Calculates the max between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongMinARGB

      private long[] doLongMinARGB(long[] xytBuff)
      Calculates the minimum between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongStdDevARGB

      private long[] doLongStdDevARGB(long[] xytBuff)
      Calculates the standard deviation between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongNormClipARGB

      private long[] doLongNormClipARGB(long[] xytBuff)
      Calculates the norm between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongAddPromoteARGB

      private float[] doLongAddPromoteARGB(long[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doLongNormPromoteARGB

      private float[] doLongNormPromoteARGB(long[] xytBuff)
      Calculates the norm between 2 short images
      Parameters:
      xytBuff - - the xyt
      Returns:
    • doFloatAddClipARGB

      private float[] doFloatAddClipARGB(float[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatAverageARGB

      private float[] doFloatAverageARGB(float[] xytBuff)
      Calculates the average between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatMaxARGB

      private float[] doFloatMaxARGB(float[] xytBuff)
      Calculates the max between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatMinARGB

      private float[] doFloatMinARGB(float[] xytBuff)
      Calculates the minimum between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatStdDevARGB

      private float[] doFloatStdDevARGB(float[] xytBuff)
      Calculates the standard deviation between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatNormClipARGB

      private float[] doFloatNormClipARGB(float[] xytBuff)
      Calculates the norm between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatAddClipComplex

      private float[] doFloatAddClipComplex(float[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatAverageComplex

      private float[] doFloatAverageComplex(float[] xytBuff)
      Calculates the average between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatMaxComplex

      private float[] doFloatMaxComplex(float[] xytBuff)
      Calculates the max between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatMinComplex

      private float[] doFloatMinComplex(float[] xytBuff)
      Calculates the minimum between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doFloatAddPromoteComplex

      private double[] doFloatAddPromoteComplex(float[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doDoubleAddClipComplex

      private double[] doDoubleAddClipComplex(double[] xytBuff)
      Calculates addition between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doDoubleAverageComplex

      private double[] doDoubleAverageComplex(double[] xytBuff)
      Calculates the average between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doDoubleMaxComplex

      private double[] doDoubleMaxComplex(double[] xytBuff)
      Calculates the max between 2 images
      Parameters:
      xytBuff -
      Returns:
    • doDoubleMinComplex

      private double[] doDoubleMinComplex(double[] xytBuff)
      Calculates the minimum between 2 images
      Parameters:
      xytBuff -
      Returns: