CIMAS icon indicating copy to clipboard operation
CIMAS copied to clipboard

Replace "prreg" by "mirtk init-dof"

Open schuhschuh opened this issue 8 years ago • 2 comments

The MIRTK "register" command replaces the obsolete IRTK prreg binary:

mirtk register target-landmarks.vtk source-landmarks.vtk \
    -dofout out.dof -model Rigid \
    -par "Point set correspondence" "Closest point"

However, when you have a set of landmarks, you are better off with the "mirtk init-dof" command which uses the closed form solution of the least squares problem:

mirtk init-dof out.dof -displacements target-landmarks.vtk source-landmarks.vtk
-displacements, -disp <pset1> <pset2> [<cor12>]
      Create transformation which minimizes the mean squared distance between pairs
      of fiducial point sets <pset1> and <pset2>. When a single <pset> is given,
      it creates a transformation which approximates the displacement vectors stored
      in the "vectors" point set attributes array. Option can be used multiple times.

schuhschuh avatar Jan 16 '17 00:01 schuhschuh

Running "mirtk init-dof out.dof -displacements target-landmarks.vtk source-landmarks.vtk" produces an affine transformation. To produce a rigid transformation, just add "-rigid" option. Tested on a pair of landmarks, it produced exactly the same results as prreg. Going to change prreg to mirtk init-dof in the future.

baiwenjia avatar Feb 02 '17 12:02 baiwenjia

Ok, forgot the extra option. Glad to hear it gives the same result.

schuhschuh avatar Feb 02 '17 12:02 schuhschuh