Class DemonsRegistrationLite

java.lang.Object
gov.nih.mipav.model.algorithms.registration.DemonsRegistrationLite

public class DemonsRegistrationLite extends Object
This algorithm handles registration algorithms of images with the Demons algorithm and a simple multiscale technique (Demons variant from Tom Vercauteren's 2009 paper, "Diffeomorphic demons: Efficient non-parametric image registration by Tom Vercauteren, Xavier Pennec, Aymeric Perchant, and Nicholas Ayache, NeuroImage, 45, 2009, S61-S72.)
Version:
November 2009
Author:
Pierre-Louis Bazin
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private float[][]
     
    private static final boolean
     
    static final int
     
    private boolean
     
    private float[]
     
    static final int
     
    private float[][]
     
    private float[]
     
    private float
     
    private float
     
    private static final float
     
    private boolean
     
    private boolean
     
    private int
     
    private int
     
    private int
     
    private int
     
    private float[]
     
    private int
     
    private int
     
    private int
     
    private int
     
    private int[]
     
    private int[]
     
    private int[]
     
    private int
     
    private int
     
    private int
     
    private int[]
     
    private int[]
     
    private int[]
     
    private int
     
    private float
     
    private float
     
    private float
     
    private float
     
    private float
     
    private float
     
    private float
     
    private float
     
    private float
     
    private float
     
    private float
     
    private float
     
    private float[][]
     
    private float
     
    private float
     
    private float
     
    private static final int
     
    private float[]
     
    private float
     
    private float
     
    private float[][]
     
    private float[][]
     
    private static final boolean
     
    private static final int
     
    private static final int
     
    private static final int
     
    private static final float
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DemonsRegistrationLite(float[] image_, float[] target_, int nix_, int niy_, int niz_, float rix_, float riy_, float riz_, int ntx_, int nty_, int ntz_, float rtx_, float rty_, float rtz_, float smoothing_, float scale_, int lev_, int Ni_, int reg_, float[][] trans_)
    constructor note: the membership function mems_ must have sum = 0 on the masked areas
  • Method Summary

    Modifier and Type
    Method
    Description
    final float[]
    returns the transformed image
    final float[]
    returns the transform field v defined as X' = X+v (=s)
    final void
     
    final float[][]
     
    final float[][]
     
    private final void
    create an image pyramid from the original data, initialize Jacobians, etc
    private final void
    create an image pyramid from the original data, initialize Jacobians, etc
    private final void
    initialize the transform from previous estimate, if exists
    private final void
    initialize the transform from previous estimate, if exists
    final boolean
     
    final boolean
     
    private float
    linearInterpolation(float[] image, float value, float x, float y, float z, int nx, int ny, int nz)
    linear interpolation, with value outside the image
    private float
    linearInterpolation(float[] image, float value, float x, float y, int nx, int ny)
    linear interpolation, with value outside the image
    private final void
    preprocessInputImages(float[] img, float[] trg)
     
    private final void
    preprocessInputImages2D(float[] img, float[] trg)
     
    final void
    registerImageToTarget(int lvl, int iterations)
    compute the image position given the target for a given level l performs only one iteration
    final void
    registerImageToTarget2D(int lvl, int iterations)
    compute the image position given the target for a given level l performs only one iteration
    final void
    runs the gaussian pyramid algorithm
    private float[]
    separableConvolution(float[] image, int nx, int ny, float[][] kernel, int kx, int ky)
    convolution with a separable kernel (the kernel is 3x{kx,ky,kz})
    private float[]
    separableConvolution(float[] image, int nx, int ny, int nz, float[][] kernel, int kx, int ky, int kz)
    convolution with a separable kernel (the kernel is 3x{kx,ky,kz})
    private float[][]
    separableGaussianKernel(float sx, float sy)
     
    private float[][]
    separableGaussianKernel(float sx, float sy, float sz)
     
    private float[]
    subsample(float[] image, int nx, int ny, int factor)
    scale down by a factor
    private float[]
    subsample(float[] image, int nx, int ny, int nz, int factor)
    scale down by a factor

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INF

      private static final float INF
      See Also:
    • ZERO

      private static final float ZERO
      See Also:
    • X

      private static final int X
      See Also:
    • Y

      private static final int Y
      See Also:
    • Z

      private static final int Z
      See Also:
    • T

      private static final int T
      See Also:
    • FLUID

      public static final int FLUID
      See Also:
    • DIFFUSION

      public static final int DIFFUSION
      See Also:
    • image

      private float[] image
    • target

      private float[] target
    • fixed

      private float[] fixed
    • moving

      private float[] moving
    • c

      private float[][] c
    • s

      private float[][] s
    • u

      private float[][] u
    • nix

      private int[] nix
    • niy

      private int[] niy
    • niz

      private int[] niz
    • ntx

      private int[] ntx
    • nty

      private int[] nty
    • ntz

      private int[] ntz
    • rix

      private float rix
    • riy

      private float riy
    • riz

      private float riz
    • rtx

      private float rtx
    • rty

      private float rty
    • rtz

      private float rtz
    • imin

      private float imin
    • imax

      private float imax
    • tmin

      private float tmin
    • tmax

      private float tmax
    • nmx

      private int nmx
    • nmy

      private int nmy
    • nmz

      private int nmz
    • nfx

      private int nfx
    • nfy

      private int nfy
    • nfz

      private int nfz
    • rmx

      private float rmx
    • rmy

      private float rmy
    • rmz

      private float rmz
    • rfx

      private float rfx
    • rfy

      private float rfy
    • rfz

      private float rfz
    • transform

      private float[][] transform
    • levels

      private int levels
    • Niter

      private int Niter
    • smoothingKernel

      private float smoothingKernel
    • spatialScale

      private float spatialScale
    • regType

      private int regType
    • sigma2

      private float sigma2
    • gaussKernel

      private float[][] gaussKernel
    • kx

      private int kx
    • ky

      private int ky
    • kz

      private int kz
    • isWorking

      private boolean isWorking
    • isCompleted

      private boolean isCompleted
    • debug

      private static final boolean debug
      See Also:
    • verbose

      private static final boolean verbose
      See Also:
    • do2D

      private boolean do2D
  • Constructor Details

    • DemonsRegistrationLite

      public DemonsRegistrationLite(float[] image_, float[] target_, int nix_, int niy_, int niz_, float rix_, float riy_, float riz_, int ntx_, int nty_, int ntz_, float rtx_, float rty_, float rtz_, float smoothing_, float scale_, int lev_, int Ni_, int reg_, float[][] trans_)
      constructor note: the membership function mems_ must have sum = 0 on the masked areas
  • Method Details

    • finalize

      public final void finalize()
      Overrides:
      finalize in class Object
    • getCurrentTransform

      public final float[][] getCurrentTransform()
    • getCurrentUpdate

      public final float[][] getCurrentUpdate()
    • isWorking

      public final boolean isWorking()
    • isCompleted

      public final boolean isCompleted()
    • preprocessInputImages2D

      private final void preprocessInputImages2D(float[] img, float[] trg)
    • preprocessInputImages

      private final void preprocessInputImages(float[] img, float[] trg)
    • initializeImages2D

      private final void initializeImages2D(int lvl)
      create an image pyramid from the original data, initialize Jacobians, etc
    • initializeImages

      private final void initializeImages(int lvl)
      create an image pyramid from the original data, initialize Jacobians, etc
    • initializeTransform2D

      private final void initializeTransform2D(int lvl)
      initialize the transform from previous estimate, if exists
    • initializeTransform

      private final void initializeTransform(int lvl)
      initialize the transform from previous estimate, if exists
    • registerImageToTarget2D

      public final void registerImageToTarget2D(int lvl, int iterations)
      compute the image position given the target for a given level l performs only one iteration
    • registerImageToTarget

      public final void registerImageToTarget(int lvl, int iterations)
      compute the image position given the target for a given level l performs only one iteration
    • runGaussianPyramid

      public final void runGaussianPyramid()
      runs the gaussian pyramid algorithm
    • exportTransformedImage

      public final float[] exportTransformedImage()
      returns the transformed image
    • exportTransformField

      public final float[] exportTransformField()
      returns the transform field v defined as X' = X+v (=s)
    • separableGaussianKernel

      private float[][] separableGaussianKernel(float sx, float sy)
    • separableGaussianKernel

      private float[][] separableGaussianKernel(float sx, float sy, float sz)
    • subsample

      private float[] subsample(float[] image, int nx, int ny, int factor)
      scale down by a factor
    • subsample

      private float[] subsample(float[] image, int nx, int ny, int nz, int factor)
      scale down by a factor
    • linearInterpolation

      private float linearInterpolation(float[] image, float value, float x, float y, int nx, int ny)
      linear interpolation, with value outside the image
    • linearInterpolation

      private float linearInterpolation(float[] image, float value, float x, float y, float z, int nx, int ny, int nz)
      linear interpolation, with value outside the image
    • separableConvolution

      private float[] separableConvolution(float[] image, int nx, int ny, float[][] kernel, int kx, int ky)
      convolution with a separable kernel (the kernel is 3x{kx,ky,kz})
    • separableConvolution

      private float[] separableConvolution(float[] image, int nx, int ny, int nz, float[][] kernel, int kx, int ky, int kz)
      convolution with a separable kernel (the kernel is 3x{kx,ky,kz})