<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 style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Hello Luis;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">I implemented your suggestion about how to obtain pointset. to test my pointset I implemented pointsettopointsetregistration and it worked perfect,but when i have tried to implement pointsettoimageregistration with <FONT size=2>
<P><STRONG>APPROPRIATE</STRONG> parametres (optimizer,registration method e.t) </FONT>i have used same pointset with a 3D image( which is .raw extension)</P></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">my pointsettoimageregistration process has processed 4 minutes then gives a break or continue error,and a new code page appears which name is vector and it shows :</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><FONT size=2>
<P>const_iterator begin() </FONT><FONT color=#0000ff size=2>const</P></FONT><FONT size=2>
<P>{ </FONT><FONT color=#008000 size=2>// return iterator for beginning of nonmutable sequence</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> (const_iterator(_Myfirst, </FONT><FONT color=#0000ff size=2>this</FONT><FONT size=2>));//<FONT color=#ff0000 size=5>it shows here</FONT></P>
<P>}</P></FONT></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">This seems so strange for me ,what might the reason of that?<BR><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: Luis Ibanez <luis.ibanez@kitware.com><BR>To: tony hakki <tony2007vtk@yahoo.com><BR>Cc: insight-users@itk.org<BR>Sent: Wednesday, April 11, 2007 6:58:16 PM<BR>Subject: Re: [Insight-users] Versor problem<BR><BR>
<DIV>Hi Tony,<BR><BR><BR>Your code looks fine.<BR>There is just a redundant piece:<BR><BR><BR><BR>If you already did:<BR><BR> pointSet->SetPoints( input_mesh->GetPoints() );<BR><BR><BR>then there is no need to add a for loop that copies<BR>every point again:<BR><BR> while()<BR> {<BR> ...<BR> pointSet->SetPoint( pointId, p );// advance to next point<BR> ...<BR> }<BR><BR><BR>You can get rid of the while loop entirely.<BR><BR><BR><BR> Regards,<BR><BR><BR> Luis<BR><BR><BR><BR>---------------------<BR>tony hakki wrote:<BR>> Dear Luis;<BR>> I convert my STL data to itk pointset like that:first I read it with VTK <BR>> ,then i converted vtk polydata to itk mesh and lastly i converted itk <BR>> mesh to itk pointset with the following code?Is that code incorrect? Is <BR>> there an easier way to
convert vtkpolydata to itkpointset?<BR>> <BR>> <BR>> const unsigned int Dimension = 3;<BR>> <BR>> typedef unsigned short PixelType;<BR>> <BR>> typedef itk::PointSet< float, Dimension > FixedPointSetType;<BR>> <BR>> typedef itk::Image< PixelType, Dimension > MovingImageType;<BR>> <BR>> typedef FixedPointSetType::PointsContainer PointsContainer;<BR>> <BR>> PointsContainer::Pointer pointsContainer = PointsContainer::New();<BR>> <BR>> pointsContainer = input_mesh->GetPoints();<BR>> <BR>> itk::PointSet<float, 3>::Pointer pointSet = itk::PointSet<float,3>::New();<BR>> <BR>> pointSet->SetPoints(pointsContainer);<BR>> <BR>> unsigned long pointId = 0;<BR>> <BR>> typedef FMeshType::PointsContainer::Iterator PointsIterator;<BR>> <BR>> <BR>> <BR>> PointsIterator pointIterator = input_mesh->GetPoints()->Begin();<BR>> <BR>> PointsIterator end =
input_mesh->GetPoints()->End();<BR>> <BR>> while( pointIterator != end )<BR>> <BR>> {<BR>> <BR>> FMeshType::PointType p = pointIterator.Value(); // access the point<BR>> <BR>> std::cout << p << std::endl; // print the point<BR>> <BR>> pointSet->SetPoint( pointId, p );// advance to next point<BR>> <BR>> pointSet->SetPointData( pointId, pointSet->GetBufferedRegion() );<BR>> <BR>> ++pointIterator;<BR>> <BR>> ++pointId;<BR>> <BR>> }<BR>> <BR>> <BR>> <BR>> ----- Original Message ----<BR>> From: Luis Ibanez <luis.ibanez@kitware.com><BR>> To: tony hakki <tony2007vtk@yahoo.com><BR>> Cc: insight-users@itk.org<BR>> Sent: Sunday, April 8, 2007 12:01:48 AM<BR>> Subject: Re: [Insight-users] Versor problem<BR>> <BR>> Hi Tony,<BR>> <BR>> <BR>> 1) Are you using the TransformFileWriter class ?<BR>> <BR>> <A
href="http://www.itk.org/Insight/Doxygen/html/classitk_1_1TransformFileWriter.html" target=_blank>http://www.itk.org/Insight/Doxygen/html/classitk_1_1TransformFileWriter.html</A><BR>> <BR>> <BR>> <BR>> 2) The code in your email is inconsistent.<BR>> <BR>> You are declaring a QuaternionRigidTransform in the code,<BR>> but the print out indicates that what you have in the file<BR>> is a VersorRigidTransform.<BR>> <BR>> The transform in the file *MUST* match the type<BR>> of the transform that you declare in the code.<BR>> <BR>> <BR>> <BR>> 3) The fact that your point set is stored in an STL file<BR>> is irrelevant for the purpose of the registration.<BR>> As we suggested in a previous email, you should use VTK<BR>> for reading the
STL file, and then convert the points from<BR>> a vtkPolyData into an itkPointSet.<BR>> <BR>> <BR>> <BR>> 4) The fact that your image is stored in a .raw file is<BR>> also irrelevant for the purpose of the registration.<BR>> What matter is whether you are able to read the image file<BR>> into an itk Image.<BR>> <BR>> <BR>> <BR>> 5) Yes,<BR>> You can do PointSet to Image registration in ITK.<BR>> <BR>> <BR>> <BR>> Regards,<BR>> <BR>> <BR>> Luis<BR>> <BR>> <BR>> <BR>> <BR>> ---------------------<BR>> tony hakki wrote:<BR>> > Dear Luis;<BR>> ><BR>> > I set the Center like the following code. I think it is correct to set<BR>> > center. At the end
of the registration I write the transform staffs to<BR>> > the a txt folder. In this folder center is seen [0,0,0],as if I hadn't<BR>> > set it. What might the problem?I apply finalparameters to the<BR>> > TransformMeshfilter as a input like that<BR>> ><BR>> > transform->SetParameters( finalParameters );<BR>> ><BR>> > filter->SetTransform(transform );<BR>> ><BR>> > but The pointset goes far away from the image instead of the overlapping<BR>> ><BR>> > If you like to see my whole code I can add it.<BR>> ><BR>> > <BR>> ><BR>> > <BR>> ><BR>> > typedef itk::QuaternionRigidTransform< double >
TransformType;<BR>> ><BR>> > TransformType::Pointer transform = TransformType::New();<BR>> ><BR>> > TransformType::InputPointType centerFixed;<BR>> ><BR>> > centerFixed[0] = 15 ;<BR>> ><BR>> > centerFixed[1] =-20;<BR>> ><BR>> > centerFixed[2] =0;<BR>> ><BR>> > transform->SetCenter(centerFixed);<BR>> ><BR>> > <BR>> ><BR>> > here is the Transform staff at the end of the registration : Also here<BR>> > the transformation and the versor variables are too small according to<BR>> > me?Is ITK capable to registrate STL Polydata(I convert it to ITK mesh<BR>> > then to a pointset) and .raw extension 3D
image?<BR>> ><BR>> > <BR>> ><BR>> > VersorRigid3DTransform (04D73558)<BR>> > RTTI typeinfo: class itk::VersorRigid3DTransform<double><BR>> > Reference Count: 4<BR>> > Modified Time: 1221<BR>> > Debug: Off<BR>> > Observers:<BR>> > none<BR>> > Matrix:<BR>> > 0.999912 -0.00431884 0.0125821<BR>> > 0.00426851 0.999983 0.00402404<BR>> > -0.0125992 -0.00396998 0.999913<BR>> > Offset: [1.00003, -0.73264, -1.39039]<BR>> > Center: [0, 0, 0]<BR>> > Translation: [1.00003,
-0.73264, -1.39039]<BR>> > Inverse:<BR>> > 0.999912 0.00426851 -0.0125992<BR>> > -0.00431884 0.999983 -0.00396998<BR>> > 0.0125821 0.00402404 0.999913<BR>> > Singular: 0<BR>> > Versor: [ -0.00199855, 0.00629548, 0.00214689, 0.999976 ]<BR>> ><BR>> ><BR>> > ----- Original Message ----<BR>> > From: Luis Ibanez <luis.ibanez@kitware.com><BR>> > To: tony hakki <tony2007vtk@yahoo.com><BR>> > Cc: insight-users@itk.org<BR>> > Sent: Friday, April 6, 2007 4:15:48 PM<BR>> > Subject: Re: [Insight-users] Versor problem<BR>> ><BR>> > Hi
Tony,<BR>> ><BR>> ><BR>> > 1) The center of the Transform should be set to the Center of the<BR>> > Fixed object. In your case, that will be the Fixed Point Set.<BR>> ><BR>> ><BR>> ><BR>> > 2) FORGET EULER ANGLES !!<BR>> ><BR>> ><BR>> ><BR>> > They are a *BAD* representation of 3D rotations<BR>> ><BR>> ><BR>> > Versors ARE NOT EULER
ANGLES<BR>> > Versors are unit Quaternions<BR>> ><BR>> ><BR>> > The methods SetRotationAroundX,Y,Z, *ARE NOT* cumulative.<BR>> ><BR>> > The rotation that you set with SetRotationAroundY is<BR>> > overriding the rotation that you set around X previously.<BR>> ><BR>> > The correct way of setting a versor is via an Axis and an Angle.<BR>> ><BR>> > You should provide the three components (x,y,z) of the axis<BR>> > of rotation, as a unit
vector. And you should provide the<BR>> > angle of rotation in radians. Note that the component of the<BR>> > axis *ARE NOT* the Euler angles either.<BR>> ><BR>> ><BR>> ><BR>> > Please read the tutorial on Quaternions:<BR>> ><BR>> > <A href="http://www.itk.org/CourseWare/Training/QuaternionsI.pdf" target=_blank>http://www.itk.org/CourseWare/Training/QuaternionsI.pdf</A><BR>> > <A href="http://www.itk.org/CourseWare/Training/QuaternionsII.pdf" target=_blank>http://www.itk.org/CourseWare/Training/QuaternionsII.pdf</A><BR>> ><BR>> > and the description of Versors in the Wikipedia:<BR>> ><BR>> >
<A href="http://en.wikipedia.org/wiki/Versor" target=_blank>http://en.wikipedia.org/wiki/Versor</A><BR>> ><BR>> > The four components of a Quaternion correspond to:<BR>> ><BR>> ><BR>> > q0 = Ax * sin( T / 2 )<BR>> > q0 = Ay * sin( T / 2 )<BR>> > q0 = Az * sin( T / 2 )<BR>> > q0 = cos( T / 2 )<BR>> ><BR>> ><BR>> > where (Ax,Ay,Az) are the components of the axis<BR>> > of rotation and T is the angle of rotation.<BR>> ><BR>> ><BR>> ><BR>> >
Regards,<BR>> ><BR>> ><BR>> > Luis<BR>> ><BR>> ><BR>> > ------------------------<BR>> > tony hakki wrote:<BR>> > > hello;<BR>> > > I have 2 questions:<BR>> > > 1- When we implement pointSetToImageRegistration Should we Set the<BR>> > > center of transform like SetTransform(Center) ,if yes which data's<BR>> > > center should it be,PointSet center or image center?<BR>> > > <BR>> > > 2- I use VersorRigid3DTransform,and I want to set Versor by my <BR>> self and<BR>> > > see the effect of Versor. But I set the versor type like the
following<BR>> > > then I get the transform parameters to confirm the versor variables it<BR>> > > says that *versor[0, 0, -0.26745, 0.963572] Why do the versor<BR>> > > variables not same what I set at the beginning?and What does the<BR>> > > fourth one( 0.963572) indicate?*<BR>> > > **<BR>> > > **<BR>> > ><BR>> > > *TransformType::VersorType versor;*<BR>> > ><BR>> > > *versor.SetRotationAroundX( 0.276538 );*<BR>> > ><BR>> > > *versor.SetRotationAroundY(
1.595315);*<BR>> > ><BR>> > > *versor.SetRotationAroundZ( -0.5414906);*<BR>> > ><BR>> > > *transform->SetRotation( versor );*<BR>> > ><BR>> > ><BR>> > > <BR>> ------------------------------------------------------------------------<BR>> > > Expecting? Get great news right away with email Auto-Check.<BR>> > ><BR>> > <BR>> <<A href="http://us.rd.yahoo.com/evt=49982/*http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html" target=_blank>http://us.rd.yahoo.com/evt=49982/*http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html</A>><BR>> > > Try the Yahoo! Mail
Beta.<BR>> > ><BR>> > <BR>> <<A href="http://us.rd.yahoo.com/evt=49982/*http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html" target=_blank>http://us.rd.yahoo.com/evt=49982/*http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html</A>><BR>> > ><BR>> > ><BR>> > > <BR>> ------------------------------------------------------------------------<BR>> > ><BR>> > > _______________________________________________<BR>> > > Insight-users mailing list<BR>> > > Insight-users@itk.org<BR>> > > <A href="http://www.itk.org/mailman/listinfo/insight-users"
target=_blank>http://www.itk.org/mailman/listinfo/insight-users</A><BR>> ><BR>> ><BR>> > ------------------------------------------------------------------------<BR>> > The fish are biting.<BR>> > Get more visitors<BR>> > <BR>> <<A href="http://us.rd.yahoo.com/evt=49679/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php?o=US2140&cmp=Yahoo&ctv=Q107Tagline&s=Y&s2=EM&b=50" target=_blank>http://us.rd.yahoo.com/evt=49679/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php?o=US2140&cmp=Yahoo&ctv=Q107Tagline&s=Y&s2=EM&b=50</A> <BR>> <<A href="http://us.rd.yahoo.com/evt=49679/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php?o=US2140&cmp=Yahoo&ctv=Q107Tagline&s=Y&s2=EM&b=50"
target=_blank>http://us.rd.yahoo.com/evt=49679/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php?o=US2140&cmp=Yahoo&ctv=Q107Tagline&s=Y&s2=EM&b=50</A>>> <BR>> <BR>> > on your site using Yahoo! Search Marketing. <<BR>> > <BR>> <A href="http://us.rd.yahoo.com/evt=49679/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php?o=US2140&cmp=Yahoo&ctv=Q107Tagline&s=Y&s2=EM&b=50" target=_blank>http://us.rd.yahoo.com/evt=49679/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php?o=US2140&cmp=Yahoo&ctv=Q107Tagline&s=Y&s2=EM&b=50</A> <BR>> <<A href="http://us.rd.yahoo.com/evt=49679/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php?o=US2140&cmp=Yahoo&ctv=Q107Tagline&s=Y&s2=EM&b=50"
target=_blank>http://us.rd.yahoo.com/evt=49679/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php?o=US2140&cmp=Yahoo&ctv=Q107Tagline&s=Y&s2=EM&b=50</A>>><BR>> <BR>> <BR>> ------------------------------------------------------------------------<BR>> Need Mail bonding?<BR>> Go to the Yahoo! Mail Q&A <BR>> <<A href="http://answers.yahoo.com/dir/index;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx?link=ask&sid=396546091" target=_blank>http://answers.yahoo.com/dir/index;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx?link=ask&sid=396546091</A>> <BR>> for great tips from Yahoo! Answers <BR>> <<A href="http://answers.yahoo.com/dir/index;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx?link=ask&sid=396546091"
target=_blank>http://answers.yahoo.com/dir/index;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx?link=ask&sid=396546091</A>> <BR>> users.</DIV></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR></DIV></div><br>
<hr size=1>Expecting? Get great news right away with <a href="http://us.rd.yahoo.com/evt=49982/*http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html">email Auto-Check.</a><br>Try the <a href="http://us.rd.yahoo.com/evt=49982/*http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html">Yahoo! Mail Beta.</a></body></html>