[Insight-users] using itk::VersorTransform, how to specify two angle(around two axis)?

Julien Jomier julien.jomier at kitware.com
Wed Mar 15 10:42:49 EST 2006


Hi Charfeddine,

You can use the itkEuler3DTransform class, by default the order of the 
rotations is around Y then X then Z so it might do what you want. 
Otherwise you can use the Compose() function to compose two Euler 
transforms.

Hope that helps,

Julien

charfeddine amir wrote:
> Hi all,
> how could i apply a rotation arround x axis (1,0,0) forwarded by another 
> rotation arround z axis (0,0,1)?
> 
> I tried this way but it takes much time!
> 
>     volumefilter = VolumeFilterType::New();
>     volumefilter2 = VolumeFilterType::New();
>     rotation1 = VersorTransformType::New();
>     rotation2 = VersorTransformType::New();
>     interpolator = InterpolatorType::New();
>     volumefilter->SetInterpolator( interpolator );
>     volumefilter->SetDefaultPixelValue( 1 );
>     volumefilter2->SetInterpolator( interpolator );
>     volumefilter2->SetDefaultPixelValue( 1 );
>     degreesToRadians = atan(1.0) / 45.0;
> 
>     volumefilter->SetOutputOrigin( m_inputimagesorigin );
>     volumefilter->SetOutputSpacing( m_inputimagespacing );
>     volumefilter->SetSize( m_inputimagesize );
>    
>     volumefilter2->SetOutputOrigin( m_inputimagesorigin );
>     volumefilter2->SetOutputSpacing( m_inputimagespacing );
>     volumefilter2->SetSize( m_inputimagesize );
>    
>     volumefilter->SetInput( m_VolumeReader->GetOutput() );
>     volumefilter2->SetInput( volumefilter->GetOutput() );
>        
>     center[0] = m_inputimagesorigin[0] + m_inputimagespacing[0] * 
> m_inputimagesize[0] / 2.0;
>     center[1] = m_inputimagesorigin[1] + m_inputimagespacing[1] * 
> m_inputimagesize[1] / 2.0;
>     center[2] = m_inputimagesorigin[2] + m_inputimagespacing[2] * 
> m_inputimagesize[2] / 2.0;
> 
>     axis[0] = 0.0;
>     axis[1] = 0.0;
>     axis[2] = 1.0;
>    
>     const double angle1 = -PAngleValue[indice] * degreesToRadians;
> 
>     rot.Set(  axis, angle1 );
>     rotation1->SetCe! nter( center );
>     rotation1->SetRotation( rot );
>        
>     volumefilter->SetTransform( rotation1 );
>    
>     axis[0] = 1.0;
>     axis[1] = 0.0;
>     axis[2] = 0.0;
>    
>     const double angle3 = -SAngleValue[indice] * degreesToRadians;
>     rot.Set(  axis, angle3 );
>     rotation2->SetCenter( center );
>     rotation2->SetRotation( rot );
>        
>     volumefilter2->SetTransform( rotation2 );
>     volumefilter2->Update();
> 
> thx for your time,
> Regards.
> 
> ------------------------------------------------------------------------
> Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les 
> tarifs exceptionnels pour appeler la France et l'international. 
> Téléchargez 
> <http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.beta.messenger.yahoo.com> 
> la version beta.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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