[ITK] [ITK-users] SpatialOrientationAdapter

Bill Lorensen bill.lorensen at gmail.com
Fri May 22 16:43:48 EDT 2015


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> 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
>
> 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/community/attachments/20150522/936f01fe/attachment-0001.html>
-------------- next part --------------
_____________________________________
Powered by 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


More information about the Community mailing list