[Insight-users] registration results

Luis Ibanez luis.ibanez at kitware.com
Fri Mar 23 14:05:38 EST 2007


Hi Tony,

The components of a Versor *ARE NOT* angles.

A versor *IS NOT* a triplet of Euler angles.


Instead, it is equivalent to a Unit Quaternion.


Please refer to the ITK Software Guide for
a description of the concept of Versors.

   http://www.itk.org/ItkSoftwareGuide.pdf


If you have a rotation of T degrees around
an axis defined by a unit vertor x,y,z,

Then the components of the Versor will be
equal to:


        Vx = x * sin( T / 2 )
        Vy = y * sin( T / 2 )
        Vz = z * sin( T / 2 )


You may find useful to read also the Tutorials
on Quaternions:


http://www.itk.org/CourseWare/Training/QuaternionsI.pdf
http://www.itk.org/CourseWare/Training/QuaternionsII.pdf


The reason why your image "seems" to translate is probably
that you have not set correctly the center of rotation
of the transformation.  A rotation performed around a
center that is far from the field of view of the image,
will 'look' like a translation.

You will find this effect explained in detail in the
ITK Software Guide:

      http://www.itk.org/ItkSoftwareGuide.pdf


in section "6.9.4" "Resample Image Filter",
in pdf-pages 254-275.

Pay particular attention to figuires:

           6.51 and 6.52



    Regards,


       Luis


-----------------
tony hakki wrote:
> hello all;
> I have tried to implement point set to image registration;I would like 
> to manipulate the results like that:
> Supposing that these are the registation results;
> 
> const double versorX = finalParameters[0];
> 
> const double versorY = finalParameters[1];
> 
> const double versorZ = finalParameters[2];
> 
> const double finalTranslationX = finalParameters[3];
> 
> const double finalTranslationY = finalParameters[4];
> 
> const double finalTranslationZ = finalParameters[5];
> 
>  
> 
>  
> 
> I would like to manipulate them like that:
> 
>  
> 
> finalParameters[0]=2*vtkMath::Pi()-versorX;
> 
> finalParameters[1]=2*vtkMath::Pi()-versorY;
> 
> finalParameters[2]= 2*vtkMath::Pi()-versorZ;
> 
> *finalParameters[3]=finalTranslationX *(-1);*
> 
> *finalParameters[4]=finalTranslationY *(-1);*
> 
> *finalParameters[5]=finalTranslationZ *(-1);*
> 
> ** 
> 
> ** 
> 
> *When I manipulate *finalParameters[0], 
> finalParameters[1],finalParameters[2]  , It doesn't give any error,  but 
> these parameters are for rotation parameters  where as my image 
> translate when I change these parameters.*Why it doesn't rotate but 
> translates through the x,y,z coordinate system When I manupulate them.*
> 
> On the other hand I couldn't manupulate the rest of the parameters 
> finalParameters[3],,finalParameters[4],,finalParameters[5], ,it gives 
> break or continue error when I run my program. And these are the 
> translation parameters,aren't they? *Why I couldn't manupulate these 
> parameters as I showed above? *
> 
>  
> 
> here is the my translation code:
> 
> typedef itk::TranslationTransform<float,3> NTransformType;
> 
> NTransformType::Pointer finalTransform = NTransformType::New();
> 
> finalTransform->SetParameters( finalParameters );  //this is 
> registration result
> 
> typedef FMeshType::PointsContainer PointsContainerType;
> 
> typedef FMeshType::PointsContainerPointer
> 
> PointsContainerPointer;
> 
> typedef itk::TransformMeshFilter<
> 
> FMeshType,
> 
> FMeshType,
> 
> NTransformType > FilterType;
> 
>  
> 
> // Create a Filter
> 
> FilterType::Pointer filter = FilterType::New();
> 
> // Connect the inputs
> 
> filter->SetInput( input_mesh );
> 
> filter->SetTransform( finalTransform );
> 
> // Execute the filter
> 
> filter->Update();
> 
> std::cout << "Filter: " << filter;
> 
> // Get the Smart Pointer to the Filter Output
> 
> FMeshType::Pointer outputMesh = filter->GetOutput();
> 
> std::cout << "Output Mesh has " << outputMesh->GetNumberOfPoints();
> 
> std::cout << " points " << std::endl;
> 
> // Get the the point container
> 
> FMeshType::PointsContainerPointer
> 
> transformedPoints = outputMesh->GetPoints();
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list