users > RE: landmarks, subsampling and .xform data
Dec 17, 2012  06:12 PM | Torsten Rohlfing
RE: landmarks, subsampling and .xform data
Hi Ruben.
Originally posted by Ruben Portugues:
Hi,

I have 3 questions about cmtk alignment.

1) Landmark Alignments
Is there a workflow example on using landmark based alignments?  I did not find one on the documentation pdf and was wondering about this.

There isn't really a workflow for landmark-based alignment. There is a tool to fit linear transformations to landmarks: fit_affine_xform_landmarks

Nonrigid fitting (using multi-level B-spline) is supported by the library, but the command line tool that makes this available is very specific to using the fitted transformation for unwarping images using a reference scan of the ADNI phantom (in other words: that tool takes a phantom description in XML format rather than two landmark lists as its input).
 
2) What is the output of the .xform files
I was hoping to understand the output of the .xform files that get generated with the transformations.  The ultimate aim would be to be able to generate a movie of one brain transforming into another and I was hoping to be able to create a one-parameter flow between the sample and the reference brain.  is there a way of doing this?

Now this really depends on whether you mean linear (affine, rigid) xform files, or nonrigid (B-spline).

For the linear transformations, you can use the "dof2mat" tool to convert the xform representation (which uses canonical transformation parameters, e.g., translation, rotation, scales) into a transformation matrix.

But from what you are saying, it seems you are more interested in the nonrigid transformations. The bad news is, that the B-spline transformation is more complex than the linear transformation, and that is reflected in a more complex file format. I would advise against trying to read this format.

The good news is - there is a tool that should do almost exactly what you are asking: the "convert_warp" tool has a "--fractional" option, which takes a real number between 0 and 1. It will then read a nonrigid xform and write out a transformation that is either the full nonrigid transformation ("--fractional 1"), only the initial linear transformation ("--fractional 0"), or something in between (any value between 0 and 1).

This should allow you to create the intermediate transformations you are looking for, which you can then feed into the "reformatx" tool to create the animated brain deformation.


3) Is it possible to use a subsampled stack to find a transformation between two brains and then apply this to the original stack?  I am thinking about ease (and possibility) of computation without running into out of memory errors.

In general, yes (all command line tools involved will let you do this), but in practice probably not. The problem is that subsampling will change the field of view of the images, and thus their intrinsic coordinate systems.

This is specifically a problem with the nonrigid transformations, because the B-spline control point grid has to cover the image field of view. If you compute a deformation with a subsampled image (which has a smaller field of view) then the resulting control point grid will not cover the entire FOV of the original image.

You can instead control whether the original image data are used in the registration or not (the "warp" tool, for example, has a "--omit-original-data" command line options), but this only helps with speed of the computation, not with lack of memory.

Best,
  Torsten

Threaded View

TitleAuthorDate
Ruben Portugues Dec 17, 2012
RE: landmarks, subsampling and .xform data
Torsten Rohlfing Dec 17, 2012
Ruben Portugues Jan 8, 2013
Torsten Rohlfing Jan 8, 2013
Ruben Portugues Jan 8, 2013
Torsten Rohlfing Jan 8, 2013
Torsten Rohlfing Jan 9, 2013
Ruben Portugues Jan 9, 2013
Torsten Rohlfing Jan 9, 2013
Ruben Portugues Jan 10, 2013
Torsten Rohlfing Jan 10, 2013
Ruben Portugues Jan 10, 2013
Torsten Rohlfing Jan 10, 2013
Ruben Portugues Jan 10, 2013
Torsten Rohlfing Jan 10, 2013
Ruben Portugues Jan 10, 2013
Torsten Rohlfing Jan 10, 2013
Ruben Portugues Jan 10, 2013
Torsten Rohlfing Jan 10, 2013
Ruben Portugues Jan 10, 2013
Torsten Rohlfing Jan 10, 2013
Ruben Portugues Jan 11, 2013
Torsten Rohlfing Jan 11, 2013
Ruben Portugues Jan 11, 2013
Torsten Rohlfing Jan 11, 2013
Ruben Portugues Jan 11, 2013
Torsten Rohlfing Jan 11, 2013
Ruben Portugues Jan 12, 2013
Ruben Portugues Jan 8, 2013