Class AlgorithmSliceAveraging

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

    public class AlgorithmSliceAveraging
    extends AlgorithmBase
    This algorithm averages together slices of a 3D image. The average used here is the mean - the sum of values divided by the number of values. Under Slice Number 3, 5, 7, or All is chosen with All being the default. If All is chosen, then a 2D image is created. If 3, 5, or 7 is chosen, then a 3D image is created. Only New image can be chosen if All is selected since a 2D image cannot meaningfully replace a 3D image. If 3, 5, or 7 is chosen, New image is the default, but either New image or Replace image can be chosen.

    If All is chosen: newValue(x,y) = (sum over all slice of oldValue(x,y,slice))/number of slices

    If 3, 5, or 7 is chosen: offset = (averagingNumber - 1)/2 newValue(x,y,sliceNumber) = (sum from slice = Maximum(first slice number,sliceNumber - offset) to slice = Minimum(last slice number,sliceNumber + offset) of oldValue(x,y,slice))/ number of slices in summation The above equations prevent the inclusion of slice numbers less than the first slice number or greater than the last slice number in the averaging equation. For example, when averaging on the first slice with an averagingNumber = 7, only include the first slice and the three slices above it in the averaging. When averaging on the last slice with averagingNumber = 5, only include the last slice and the two slices below it in the averaging.

    • Field Detail

      • averagingNumber

        private int averagingNumber
        DOCUMENT ME!
      • haveColor

        private boolean haveColor
        DOCUMENT ME!
    • Constructor Detail

      • AlgorithmSliceAveraging

        public AlgorithmSliceAveraging​(ModelImage srcImg,
                                       int averagingNumber)
        Creates a new AlgorithmSliceAveraging object.
        Parameters:
        srcImg - source image model
        averagingNumber - number of slices to average together, if 1 average all slices together
      • AlgorithmSliceAveraging

        public AlgorithmSliceAveraging​(ModelImage destImg,
                                       ModelImage srcImg,
                                       int averagingNumber)
        Creates a new AlgorithmSliceAveraging object.
        Parameters:
        destImg - image model where result image is to stored
        srcImg - source image model
        averagingNumber - number of slices to average together, if 1 average all slices together
    • Method Detail

      • finalize

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

        private void sAveraging()
        Averages image slices together.