Class AlgorithmSwapSlicesVolume

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

    public class AlgorithmSwapSlicesVolume
    extends AlgorithmBase

    Title: AlgorithmSwapSlicesVolume

    Description: Allows user to re-slice/re-volume and associates fileInfo. This allows for slice/volume duplication, deletion, or insertion.

    Version:
    0.9
    Author:
    Justin Senseney
    • Field Detail

      • nSlices

        private int nSlices
        Number of slices in mode.
      • sliceRenum

        private int[][] sliceRenum
        Reordering of slices/volumes.
      • sliceSize

        private int sliceSize
        Number of pixels used by a slice/volume, includes colorFactor.
      • sliceTouched

        private boolean[] sliceTouched
        Slices that have been examined in recursive structure for swapping slices.
      • extentSrc

        private int extentSrc
        Internal sorting variables for sorting slices on images of greater than 3 dimensions
      • extentDest

        private int extentDest
        Internal sorting variables for sorting slices on images of greater than 3 dimensions
      • srcFileInfos

        private FileInfoBase[] srcFileInfos
        Original FileInfoBase array.
      • srcExtents

        private int[] srcExtents
        Original extents array
    • Constructor Detail

      • AlgorithmSwapSlicesVolume

        public AlgorithmSwapSlicesVolume​(ModelImage destImage,
                                         JDialogSwapSlicesVolumes.SwapMode mode,
                                         int[][] sliceRenum,
                                         ModelImage srcImage)
        Import source and destination images into the class.
        Parameters:
        destImage - destination image
        srcImage - source image (image to extract from)
        sliceRenum - list of locations for slices that should be extracted/moved
        mode - type of swapping operation
    • Method Detail

      • finalize

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

        public ModelImage getSwappedVolume()
        Return the images extracted from the source image.
        Returns:
        The extracted images.
      • getColorFactor

        protected int getColorFactor()
        Calculates and returns the color factor based on the srcImage.
        Returns:
        DOCUMENT ME!
      • allSlicesTouched

        private boolean allSlicesTouched()
      • collectFileInfos

        private FileInfoBase[] collectFileInfos​(int in,
                                                int tDim)
        Gets the fileInfos from the specified position.
      • importFileInfos

        private void importFileInfos​(ModelImage destImage,
                                     FileInfoBase[] fileIn,
                                     int in,
                                     int tDim)
        Inserts the fileInfos into the specified position.
      • reallocate

        private void reallocate​(ModelImage image)
        Reallocate destImage so that fileInfo and buffer equal required length
        Parameters:
        image - ModelImage
      • swapSlices

        private void swapSlices()
        Calculates the final output and stores it in the source image.
      • transferIn

        private boolean transferIn​(int in)
        Starts method of file/image transferring
        Parameters:
        in - location to import data
        Returns:
        whether import was successful
      • transferIn

        private boolean transferIn​(FileInfoBase[] fileIn,
                                   java.lang.Number[] bufferIn,
                                   int in,
                                   int tDim)
        Transfers the given buffer into the given location. Also recursively transfers all the old data to the location(s) where the old data is used.
        Parameters:
        bufferIn - relieves the symptoms of arthritis
        in - location to import data
        Returns:
        whether import was successful