Class AlgorithmRegBSpline2D

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

    public class AlgorithmRegBSpline2D
    extends AlgorithmRegBSpline
    BSpline based registration of 2D images.
    • Constructor Detail

      • AlgorithmRegBSpline2D

        public AlgorithmRegBSpline2D​(ModelImage kImageResult,
                                     ModelImage kImageSource,
                                     ModelImage kImageTarget,
                                     ModelImage kImageDeformation,
                                     RegistrationMeasure kRegMeasure,
                                     AlgorithmRegBSpline.Options kOptionsPass1,
                                     AlgorithmRegBSpline.Options kOptionsPass2)
        Constructor.
        Parameters:
        kImageResult - ModelImage Reference to an image to store the registered source image. This image must have the same dimensions as the registration target image.
        kImageSource - ModelImage Reference to the original input image to use as the registration source. This image does not have to have the same dimensions as the image to be used as the registration target.
        kImageTarget - ModelImage Reference to the original input image to use as the registration target.
        kImageDeformation - ModelImage Reference to an image to store the computed deformation. This may be a null reference to indicate that the deformation is not to be computed. If this reference is not null, then the image must have the same dimensions as the target image.
        kRegMeasure - RegistrationMeasure Reference to the particular cost measure to use for this registration. The cost measure is the same for all passes.
        kOptionsPass1 - Options Options to use for a first pass of registration. This may *not* be a null reference.
        kOptionsPass2 - Options Options to use for a second pass of registration. This may be null to indicate that only a single pass of registration is to be performed.
    • Method Detail

      • runAlgorithm

        public void runAlgorithm()
        AlgorithmBase abstract method implementation which performs the registration.
        Specified by:
        runAlgorithm in class AlgorithmBase
        Throws:
        java.lang.RuntimeException - DOCUMENT ME!
      • transform2DVOI

        private void transform2DVOI​(ModelImage image,
                                    ModelImage destImage,
                                    float[] imgBuffer,
                                    float[] kImageMapX,
                                    float[] kImageMapY)
        Transforms and resamples a 2D VOI using nearest neighbor interpolation.
          For each VOI in VOIVector:
        1. Export VOIs as a mask image
        2. Transform mask
        3. Extract VOI contours from mask image and put in new image.
        Parameters:
        image - Image where VOIs are stored
        imgBuffer - Image array
        xfrm - Transformation matrix to be applied
      • runPass

        protected BSplineRegistration2Df runPass​(ModelSimpleImage kSource,
                                                 ModelSimpleImage kTarget,
                                                 AlgorithmRegBSpline.Options kOptions,
                                                 BSplineRegistration2Df kRegPrev,
                                                 java.lang.String kProgressPrefixString)
        Perform a "pass" of BSpline based registration. A "pass" is defined to be one or more iterations using the BSpline basis parameters, gradient descent parameters, and convergence parameters.
        Parameters:
        kSource - ModelSimpleImage Reference to the original input image to use as the registration source. This image does not have to have the same dimensions as the image to be used as the registration target.
        kTarget - ModelSimpleImage Reference to the original input image to use as the registration target.
        kOptions - Options Options to use for a this registration pass. This may *not* be a null reference.
        kRegPrev - BSplineRegistration2Df Reference to a previous registration which can be used to initialize this registration. This may be a null reference meaning that the this registration uses the default "identity" initialization. If this it not a null reference, then this registration is initialized to provide the a close approximation to the same BSpline mapping as determined by the input registration. The main property of a registration is the position of its control points.
        kProgressPrefixString - String Text to add to the beginning of the progress bar message.
        Returns:
        BSplineRegistration2Df Registration instance resulting from this pass. This may be needed to provide for the initialization of subsequent passes or to compute the deformation image.
      • writeResults

        private void writeResults​(BSplineRegistration2Df kReg)
        Save the registration information to a file. This information includes the BSpline parameters; in particular, the coordinates for the lattice of control points.
        Parameters:
        kReg - BSplineRegistration2Df Contains the parameters which define the BSpline for registering the source image to the targe image.