antsApplyRegistrationToPoints and non LPS images

  • Thanks in advance - any help will be very appreciated. I did read the discussion you mentioned - hence the LIP->LPS conversion and application of reverse transform.

    What are the "debugging" options you mention?

  • Oh my crusade is finally over! Let me record for the posterity how I managed to do this.

    Basically there are many ways to represent images inside a nifti file. There are also many terms that mean different things in different communities (for example what LPS in ITK world is RAI in nipy, FreeSurfer world). Therefore the most effective way to figure out how to convert your coordinates to what antsApplyTransformsToPoints expects is by a test case. Here are the steps:

    1. Create a fake label volume based on your moving image. You can use ITK Snap or FSLView to do this. You basically need one point set to 1 and all others set to zero. Write down the coordinates (in mm) of that point.
    2. Use ImageMaths LabelStats on the label volume to figure out what are the coordinates of that point according to ANTs.
    3. Comparing the coordinates from step 1 and 2 you can figure out what conversion (swapping order, multiplying by -1) you need to apply to your list of points before feeding them to antsApplyTransformsToPoints

    You probably will have to go through a similar process to convert coordinates outputed by antsApplyTransformsToPoints to something compatible with the space your fixed image is in.

    I hope this helps!