[ITK-users] SpatialOrientationAdapter

Budin, Francois fbudin at email.unc.edu
Tue May 26 09:55:34 EDT 2015


Thank you Bill. Let me know if you find anything.

Francois
On May 22, 2015, at 4:43 PM, Bill Lorensen <bill.lorensen at gmail.com<mailto:bill.lorensen at gmail.com>> wrote:


It is possible that the adaptor uses a different notation. I'll have to check.

On May 22, 2015 3:59 PM, "Francois Budin" <fbudin at email.unc.edu<mailto:fbudin at email.unc.edu>> wrote:
Hello Everybody,

I was trying to use itk::SpatialOrientationAdapter. As a simple example, I wrote the following code:

#include <iostream>
#include <itkSpatialOrientationAdapter.h>
#include <itkMatrix.h>
#include <itkImage.h>

int main( int argc, char* argv[] )
{
  typedef itk::Image< float , 3 > ImageType ;
  typedef ImageType::DirectionType DirectionType ;
  DirectionType direction ;
  direction.SetIdentity() ;
  typedef itk::SpatialOrientation::ValidCoordinateOrientationFlags CoordinateOrientationCode ;
  CoordinateOrientationCode orientation ;
  orientation = itk::SpatialOrientationAdapter().FromDirectionCosines( direction ) ;
  if( orientation == itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_LPS )
  {
     std::cout <<  "LPS" << std::endl ;
  }
  else if( orientation == itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RAI )
  {
     std::cout <<  "RAI" << std::endl ;
  }
  else
  {
     std::cout <<  "Unknown" << std::endl ;
  }
  return 0 ;
}

I wanted to make sure that since ITK is using LPS as its default orientation, if I were to give the identity matrix as an orientation matrix to itk::SpatialOrientationAdapter().FromDirectionCosines, I would obtain LPS as a result. However, I obtain RAI which is exactly the opposite of what I was expecting. Could somebody help me to understand what is happening and why I don't get LPS as a result?
Thank you,

Francois
_____________________________________
Powered by www.kitware.com<http://www.kitware.com/>

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20150526/f0d3a74f/attachment.html>


More information about the Insight-users mailing list