[vtkusers] using vtkLandmarkTransform to align two nii volumes

Jon Haitz Legarreta Gorroño jon.haitz.legarreta at gmail.com
Fri Oct 12 09:04:33 EDT 2018


Hi,
I'd dare to say that the short answer is yes.

Long answer is that VTK deals with world coordinates, and according to
the right hand rule. NIfTI uses RAS convention. According to the
vtkNIFTIImageReader::GetQFormMatrix documentation, NIfTI does not
ensure that coordinates are stored following that convention, so you
should definitely use the matrix given.

The following Slicer 3D wiki page and David Gobbi's document be
helpful to this end:
https://www.slicer.org/wiki/Coordinate_systems
http://calgaryimageanalysis.ca/wiki/images/5/52/Image-orientation.pdf

May be David himself can chime in and be able to provide a better or
cleaner explanation.

HTH,
JON HAITZ

On Thu, Oct 11, 2018 at 11:05 AM The Merper <msmerps at gmail.com> wrote:
>
> Hi VTK experts,
>    I am trying to using vtkLandmarkTransform  to align two nii volumes and am getting puzzling results. I identify the landmarks in the two 3D volumes by visualizing the volumes in VTK and using the GetPickPosition method. The coordinates I get are in units of mm with the origin being one corner of 3D volume.
>     I then use vtkLandmarkTransform to get an affine transformation to align the points. The points align great, but when I apply that same transform to the analogous nii volume via vtkImageReslice, the results are wildly off (e.g., the volume is flipped upside down).
>    Is the qform matrix of each nii file somehow causing this? Do I need to first apply the qform matrix to the landmark points to get them in scanner coordinates before using vtkLandmarkTransform?
>        thank you for any advice you can provide,
>             -Ms. Merps
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtkusers


More information about the vtkusers mailing list