[Insight-users] using itk::VersorTransform,
how to specify two angle(around two axis)?
charfeddine amir
charfeddine_amir at yahoo.fr
Wed Mar 15 09:35:18 EST 2006
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->SetCenter( 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 la version beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060315/86cf5cb7/attachment.htm
More information about the Insight-users
mailing list