Class AlgorithmCrop

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

    public class AlgorithmCrop
    extends AlgorithmBase
    Crops 2D and 3D images using a supplied VOI. Crops 4D images.
    Version:
    1.0 June 11, 1999
    Author:
    Matthew J. McAuliffe, Ph.D.
    • Field Detail

      • cushion

        private int cushion
        Extra space around VOI in x and y dimensions.
      • RGBImage

        private boolean RGBImage
        Flag for color or noncolor image.
      • x

        private int[] x
        Storage for VOI.
      • y

        private int[] y
        Storage for VOI.
      • z

        private int[] z
        Storage for VOI.
    • Constructor Detail

      • AlgorithmCrop

        public AlgorithmCrop​(ModelImage destImg,
                             ModelImage srcImg,
                             int _cushion,
                             int[] _x,
                             int[] _y,
                             int[] _z)
        Creates new algorithms to crop image by specified bounds. Stores in destImg.
        Parameters:
        destImg - image model where result image is to stored, use null to do in-place calculation
        srcImg - source image model
        _cushion - extra space around VOI in x and y dimensions.
        _x - VOI xBounds: x[0] = min. bound and x[1] = max. bound
        _y - VOI yBounds: y[0] = min. bound and y[1] = max. bound
        _z - VOI zBounds: z[0] = min. bound and z[1] = max. bound
    • Method Detail

      • finalize

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

        private void calcStoreInDest2D()
        This function produces a new image that has been cropped!
      • calcStoreInDest3D

        private void calcStoreInDest3D()
        This function produces a new image that has been cropped.
      • calcStoreInDest4D

        private void calcStoreInDest4D()
        This function produces a new image that has been cropped.
      • calcStoreInPlace2D

        private void calcStoreInPlace2D()
        This function crops srcImage Must use getSrcImage after running.
      • calcStoreInPlace3D

        private void calcStoreInPlace3D()
        This function crops srcImage Must use getSrcImage after running.
      • calcStoreInPlace4D

        private void calcStoreInPlace4D()
        This function crops srcImage Must use getSrcImage after running.
      • originImg2LPS

        private float[] originImg2LPS​(float[] origImg,
                                      ModelImage img)
        Switch origin order from image order to LPS order.
        Parameters:
        origImg - DOCUMENT ME!
        img - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • originLPS2Img

        private float[] originLPS2Img​(float[] origLPS,
                                      ModelImage img)
        Switch origin order from LPS order to Img order.
        Parameters:
        origLPS - DOCUMENT ME!
        img - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • updateDICOM

        private void updateDICOM()
        Update special case DICOM format tags.
      • updateFileInfoData

        private void updateFileInfoData()
        Updates important image attributes (start locations, orientation ) for the new cropped file by modifing the fileinfo fo the new ( destination ) image.