<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>hello all;</DIV>
<DIV>I have tried to implement point set to image registration;I would like to manipulate the results like that:</DIV>
<DIV>Supposing that these are the registation results;</DIV>
<DIV>
<P><FONT color=#0000ff>const</FONT> <FONT color=#0000ff>double</FONT> versorX = finalParameters[0];</P>
<P><FONT color=#0000ff>const</FONT> <FONT color=#0000ff>double</FONT> versorY = finalParameters[1];</P>
<P><FONT color=#0000ff>const</FONT> <FONT color=#0000ff>double</FONT> versorZ = finalParameters[2];</P>
<P><FONT color=#0000ff>const</FONT> <FONT color=#0000ff>double</FONT> finalTranslationX = finalParameters[3];</P>
<P><FONT color=#0000ff>const</FONT> <FONT color=#0000ff>double</FONT> finalTranslationY = finalParameters[4];</P>
<P><FONT color=#0000ff>const</FONT> <FONT color=#0000ff>double</FONT> finalTranslationZ = finalParameters[5];</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>I would like to manipulate them like that:</P>
<P>&nbsp;</P><FONT size=2><FONT size=2>
<P><FONT size=3>finalParameters[0]=2*vtkMath::Pi()-versorX;</FONT></P>
<P><FONT size=3>finalParameters[1]=2*vtkMath::Pi()-versorY;</FONT></P>
<P><FONT size=3>finalParameters[2]= 2*vtkMath::Pi()-versorZ;</FONT></P><FONT size=2>
<P><FONT size=3><STRONG>finalParameters[3]=finalTranslationX *(-1);</STRONG></FONT></P><FONT size=2>
<P><FONT size=3><STRONG>finalParameters[4]=finalTranslationY *(-1);</STRONG></FONT></P><FONT size=2>
<P><FONT size=3><STRONG>finalParameters[5]=finalTranslationZ *(-1);</STRONG></FONT></P>
<P><STRONG><FONT size=3></FONT></STRONG>&nbsp;</P>
<P><STRONG><FONT size=3></FONT></STRONG>&nbsp;</P>
<P><FONT size=3><STRONG>When I manipulate </STRONG>finalParameters[0], finalParameters[1],finalParameters[2]&nbsp; , It doesn't give any error,&nbsp; but these parameters are for rotation parameters&nbsp; where as my image translate when I change these parameters.<FONT color=#ff0000><STRONG>Why it doesn't rotate but translates through the x,y,z coordinate system When I manupulate them.</STRONG></FONT></FONT></P>
<P><FONT size=3>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? <FONT color=#ff0000><STRONG>Why I couldn't manupulate these parameters as I showed above?&nbsp;</STRONG></FONT></FONT></P>
<P><FONT size=3></FONT>&nbsp;</P>
<P><FONT size=3>here is the my translation code:</FONT></P><FONT color=#0000ff size=2>
<P>t<FONT size=3>ypedef</FONT></FONT><FONT size=3> itk::TranslationTransform&lt;<FONT color=#0000ff>float</FONT>,3&gt; NTransformType;</FONT></P>
<P><FONT size=3>NTransformType::Pointer finalTransform = NTransformType::New();</FONT></P>
<P><FONT size=3>finalTransform-&gt;SetParameters( finalParameters );&nbsp; //this is registration result</FONT></P>
<P><FONT size=3></FONT></P>
<P><FONT size=3></FONT></P>
<P><FONT size=3><FONT color=#0000ff>typedef</FONT> FMeshType::PointsContainer PointsContainerType;</FONT></P>
<P><FONT size=3><FONT color=#0000ff>typedef</FONT> FMeshType::PointsContainerPointer </FONT></P>
<P><FONT size=3>PointsContainerPointer;</FONT></P>
<P><FONT size=3><FONT color=#0000ff>typedef</FONT> itk::TransformMeshFilter&lt;</FONT></P>
<P><FONT size=3>FMeshType,</FONT></P>
<P><FONT size=3>FMeshType,</FONT></P>
<P><FONT size=3>NTransformType &gt; FilterType;</FONT></P>
<P><FONT size=3>&nbsp;</FONT></P>
<P><FONT color=#008000><FONT size=3>// Create a Filter </FONT></P></FONT>
<P><FONT size=3>FilterType::Pointer filter = FilterType::New();</FONT></P>
<P><FONT color=#008000><FONT size=3>// Connect the inputs</FONT></P></FONT>
<P><FONT size=3>filter-&gt;SetInput( input_mesh ); </FONT></P>
<P><FONT size=3>filter-&gt;SetTransform( finalTransform ); </FONT></P>
<P><FONT color=#008000><FONT size=3>// Execute the filter</FONT></P></FONT>
<P><FONT size=3>filter-&gt;Update();</FONT></P>
<P><FONT size=3>std::cout &lt;&lt; <FONT color=#800000>"Filter: "</FONT> &lt;&lt; filter;</FONT></P>
<P><FONT color=#008000><FONT size=3>// Get the Smart Pointer to the Filter Output </FONT></P></FONT>
<P><FONT size=3>FMeshType::Pointer outputMesh = filter-&gt;GetOutput();</FONT></P>
<P><FONT size=3>std::cout &lt;&lt; <FONT color=#800000>"Output Mesh has "</FONT> &lt;&lt; outputMesh-&gt;GetNumberOfPoints();</FONT></P>
<P><FONT size=3>std::cout &lt;&lt; <FONT color=#800000>" points "</FONT> &lt;&lt; std::endl;</FONT></P>
<P><FONT color=#008000><FONT size=3>// Get the the point container</FONT></P></FONT>
<P><FONT size=3>FMeshType::PointsContainerPointer </FONT></P>
<P><FONT size=3>transformedPoints = outputMesh-&gt;GetPoints();</FONT></P><FONT size=2></FONT></FONT></FONT></FONT></FONT></FONT></DIV></div><br>

<hr size=1>
Don't get soaked.  Take a<a href="
http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news"> quick peek at the forecast </a><br> with the<a href="
http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news">Yahoo! Search weather shortcut.</a></body></html>