Class AlgorithmSwapSlicesVolume

java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.utilities.AlgorithmSwapSlicesVolume
All Implemented Interfaces:
ActionListener, WindowListener, Runnable, 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 Details

    • mode

      Swap mode, either 3D or 4D.
    • 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 Details

    • AlgorithmSwapSlicesVolume

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

    • 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.
    • runAlgorithm

      public void runAlgorithm()
      Calculates the final output.
      Specified by:
      runAlgorithm in class AlgorithmBase
    • 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, 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