<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">I have already tried it. I wrote the transform result to a txt file . Here is the transform results .But on the otherhand I also wrote the <FONT size=2>
<P>optimizer-&gt;GetValue() to a txt file. it says it is zero. Why is it zero?what might the reason?</P></FONT></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><EM><STRONG>QuaternionRigidTransform (03975550)<BR>&nbsp; RTTI typeinfo:&nbsp;&nbsp; class itk::QuaternionRigidTransform&lt;float&gt;<BR>&nbsp; Reference Count: 2<BR>&nbsp; Modified Time: 27001127<BR>&nbsp; Debug: Off<BR>&nbsp; Observers: <BR>&nbsp;&nbsp;&nbsp; none<BR>&nbsp; Matrix: <BR>&nbsp;&nbsp;&nbsp; 0.969827 0.238191 0.0519706 <BR>&nbsp;&nbsp;&nbsp; -0.224559 0.955767 -0.189954 <BR>&nbsp;&nbsp;&nbsp; -0.0949171 0.172552 0.980416 <BR>&nbsp; Offset: [-0.0650461, -44.047, -19.0696]<BR>&nbsp; Center: [0, 0, 0]<BR>&nbsp; Translation: [-0.0650461, -44.047, -19.0696]<BR>&nbsp; Inverse: <BR>&nbsp;&nbsp;&nbsp; 0.969827 -0.224559 -0.0949171 <BR>&nbsp;&nbsp;&nbsp; 0.238191 0.955767 0.172552 <BR>&nbsp;&nbsp;&nbsp; 0.0519706 -0.189954 0.980416 <BR>&nbsp; Singular: 0<BR>&nbsp; Rotation:&nbsp;&nbsp;&nbsp; 0.0917104 0.0371611 -0.117071 0.988181</STRONG></EM><BR><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: David Cole &lt;david.cole@kitware.com&gt;<BR>To: tony hakki &lt;tony2007vtk@yahoo.com&gt;<BR>Cc: Luis Ibanez &lt;luis.ibanez@kitware.com&gt;; insight-users@itk.org<BR>Sent: Saturday, March 31, 2007 1:10:45 PM<BR>Subject: Re: [Insight-users] How long does it take do you think ?<BR><BR>
<DIV>Why not try changing the hard-coded 10,000,000 in your code down to<BR>500 in light of Luis' email...?<BR><BR>HTH,<BR>David<BR><BR><BR>On 3/31/07, tony hakki &lt;tony2007vtk@yahoo.com&gt; wrote:<BR>&gt;<BR>&gt;<BR>&gt; Dear Luis<BR>&gt; Here is my code,what might the wrong ?According to me everything is OK.<BR>&gt; Could you please have a look at his for me. This is really important for me.<BR>&gt;<BR>&gt;<BR>&gt; //-----------------------------------------------------------<BR>&gt;<BR>&gt; // Set up a Transform<BR>&gt;<BR>&gt; //-----------------------------------------------------------<BR>&gt;<BR>&gt; typedef itk::QuaternionRigidTransform&lt; double &gt; TransformType;<BR>&gt;<BR>&gt; TransformType::Pointer transform = TransformType::New();<BR>&gt;<BR>&gt; typedef MovingImageType::SpacingType SpacingType;<BR>&gt;<BR>&gt; typedef MovingImageType::PointType OriginType;<BR>&gt;<BR>&gt; typedef MovingImageType::RegionType RegionType;<BR>&gt;<BR>&gt; typedef
 MovingImageType::SizeType SizeType;<BR>&gt;<BR>&gt; const OriginType movingOrigin = input-&gt;GetOrigin();<BR>&gt;<BR>&gt; const RegionType movingRegion =<BR>&gt; input-&gt;GetLargestPossibleRegion();<BR>&gt;<BR>&gt; const SizeType movingSize = movingRegion.GetSize();<BR>&gt;<BR>&gt; const SpacingType movingSpacing = input-&gt;GetSpacing();<BR>&gt;<BR>&gt; TransformType::InputPointType centerMoving;<BR>&gt;<BR>&gt; centerMoving[0] = movingOrigin[0] + movingSpacing[0] * movingSize[0] / 2.0;<BR>&gt;<BR>&gt; centerMoving[1] = movingOrigin[1] + movingSpacing[1] * movingSize[1] / 2.0;<BR>&gt;<BR>&gt; centerMoving[2] = movingOrigin[2] + movingSpacing[2] * movingSize[1] / 2.0;<BR>&gt;<BR>&gt; TransformType::InputPointType centerFixed;<BR>&gt;<BR>&gt; centerFixed[0] = 14.7947 ;<BR>&gt;<BR>&gt; centerFixed[1] =-1.48122;<BR>&gt;<BR>&gt; centerFixed[2] =2.43377;<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; transform-&gt;SetCenter(centerFixed);<BR>&gt;<BR>&gt; transform-&gt;SetTranslation(
 centerMoving - centerFixed );<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; //------------------------------------------------------------<BR>&gt;<BR>&gt; // Optimizer Type<BR>&gt;<BR>&gt; //-----------------------------------------------------------<BR>&gt;<BR>&gt; typedef<BR>&gt; itk::QuaternionRigidTransformGradientDescentOptimizer<BR>&gt; OptimizerType;<BR>&gt;<BR>&gt; OptimizerType::Pointer optimizer = OptimizerType::New();<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; //------------------------------------------------------------<BR>&gt;<BR>&gt; // Set up an Interpolator<BR>&gt;<BR>&gt; //------------------------------------------------------------<BR>&gt;<BR>&gt; typedef itk::LinearInterpolateImageFunction&lt;<BR>&gt;<BR>&gt; MovingImageType,<BR>&gt;<BR>&gt; double &gt; InterpolatorType;<BR>&gt;<BR>&gt; InterpolatorType::Pointer interpolator = InterpolatorType::New();<BR>&gt;<BR>&gt; //-----------------------------------------------------------<BR>&gt;<BR>&gt; // Set up Metric<BR>&gt;<BR>&gt;
 //-----------------------------------------------------------<BR>&gt;<BR>&gt; typedef itk::NormalizedCorrelationPointSetToImageMetric&lt;<BR>&gt;<BR>&gt; FixedPointSetType,<BR>&gt;<BR>&gt; MovingImageType &gt; MetricType;<BR>&gt;<BR>&gt; typedef MetricType::TransformType TransformBaseType;<BR>&gt;<BR>&gt; typedef TransformBaseType::ParametersType ParametersType;<BR>&gt;<BR>&gt; MetricType::Pointer metric = MetricType::New();<BR>&gt;<BR>&gt; //-----------------------------------------------------------<BR>&gt;<BR>&gt; //RegistrationMethod<BR>&gt;<BR>&gt; //-----------------------------------------------------------<BR>&gt;<BR>&gt; typedef itk::PointSetToImageRegistrationMethod&lt;<BR>&gt;<BR>&gt; FixedPointSetType,<BR>&gt;<BR>&gt; MovingImageType &gt; RegistrationType;<BR>&gt;<BR>&gt; RegistrationType::Pointer registrationMethod = RegistrationType::New();<BR>&gt;<BR>&gt; typedef itk::CommandIterationUpdate&lt;<BR>&gt;<BR>&gt; OptimizerType &gt;
 CommandIterationType;<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; // Instantiate an Observer to report the progress of the Optimization<BR>&gt;<BR>&gt; CommandIterationType::Pointer iterationCommand =<BR>&gt; CommandIterationType::New();<BR>&gt;<BR>&gt; iterationCommand-&gt;SetOptimizer( optimizer.GetPointer() );<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; // Scale the translation components of the Transform in the Optimizer<BR>&gt;<BR>&gt; OptimizerType::ScalesType scales(<BR>&gt; transform-&gt;GetNumberOfParameters() );<BR>&gt;<BR>&gt; scales.Fill( 1.0 );<BR>&gt;<BR>&gt; int j;<BR>&gt;<BR>&gt; for ( j = 4; j &lt; 7; j++ )<BR>&gt;<BR>&gt; {<BR>&gt;<BR>&gt; scales[j] = 0.0001;<BR>&gt;<BR>&gt; }<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; unsigned long numberOfIterations = 1000000;<BR>&gt;<BR>&gt; optimizer-&gt;SetScales( scales );<BR>&gt;<BR>&gt; optimizer-&gt;SetNumberOfIterations( numberOfIterations );<BR>&gt;<BR>&gt; optimizer-&gt;MinimizeOn();<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; // can probably provide a
 better guess than the identity...<BR>&gt;<BR>&gt; transform-&gt;SetIdentity();<BR>&gt;<BR>&gt; registrationMethod-&gt;SetInitialTransformParameters(<BR>&gt; transform-&gt;GetParameters() );<BR>&gt;<BR>&gt; RegistrationType::ParametersType initialParameters(<BR>&gt;<BR>&gt; transform-&gt;GetNumberOfParameters() );<BR>&gt;<BR>&gt; initialParameters.Fill( 0.0 );<BR>&gt;<BR>&gt; initialParameters[3] = 1.0;<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; // Connect all the components required for Registration<BR>&gt;<BR>&gt; //------------------------------------------------------<BR>&gt;<BR>&gt; registrationMethod-&gt;SetMetric( metric );<BR>&gt;<BR>&gt; registrationMethod-&gt;SetOptimizer( optimizer );<BR>&gt;<BR>&gt; registrationMethod-&gt;SetFixedPointSet(pointSet);<BR>&gt;<BR>&gt; registrationMethod-&gt;SetMovingImage(input);<BR>&gt;<BR>&gt; registrationMethod-&gt;SetInterpolator(interpolator);<BR>&gt;<BR>&gt; registrationMethod-&gt;SetTransform( transform );<BR>&gt;<BR>&gt;
 //------------------------------------------------------------<BR>&gt;<BR>&gt; // Set up transform parameters<BR>&gt;<BR>&gt; //------------------------------------------------------------<BR>&gt;<BR>&gt; ParametersType parameters(<BR>&gt; transform-&gt;GetNumberOfParameters() );<BR>&gt;<BR>&gt; // initialize the offset/vector part<BR>&gt;<BR>&gt; for( unsigned int k = 0; k &lt;Dimension; k++ )<BR>&gt;<BR>&gt; {<BR>&gt;<BR>&gt; parameters[k]= 0.0f;<BR>&gt;<BR>&gt; }<BR>&gt;<BR>&gt; try<BR>&gt;<BR>&gt; {<BR>&gt;<BR>&gt; registrationMethod-&gt;SetInitialTransformParameters(<BR>&gt; initialParameters );<BR>&gt;<BR>&gt; registrationMethod-&gt;StartRegistration();<BR>&gt;<BR>&gt; }<BR>&gt;<BR>&gt; catch( itk::ExceptionObject &amp; e )<BR>&gt;<BR>&gt; {<BR>&gt;<BR>&gt; std::cout &lt;&lt; e &lt;&lt; std::endl;<BR>&gt;<BR>&gt; }<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; OptimizerType::ParametersType finalParameters<BR>&gt;
 =registrationMethod-&gt;GetLastTransformParameters();<BR>&gt;<BR>&gt; const unsigned int nmbrOfIterations =<BR>&gt; optimizer-&gt;GetCurrentIteration();<BR>&gt;<BR>&gt; const double bestValue = optimizer-&gt;GetValue();<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; transform-&gt;SetParameters( finalParameters );<BR>&gt;<BR>&gt; ----- Original Message ----<BR>&gt; From: Luis Ibanez &lt;luis.ibanez@kitware.com&gt;<BR>&gt; To: tony hakki &lt;tony2007vtk@yahoo.com&gt;<BR>&gt; Cc: Robert Tamburo &lt;rjtst21@pitt.edu&gt;; insight-users@itk.org<BR>&gt; Sent: Friday, March 30, 2007 6:56:17 PM<BR>&gt; Subject: Re: [Insight-users] How long does it take do you think ?<BR>&gt;<BR>&gt;<BR>&gt; Hi Tony,<BR>&gt;<BR>&gt; A well tunned registration process should take less than<BR>&gt; 500 iterations in a Gradient-Descent type of optimizer.<BR>&gt;<BR>&gt;<BR>&gt; If it takes longer than 500 iterations,<BR>&gt; then it means that:<BR>&gt;<BR>&gt;<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; a) Your have a poor
 initialization, or<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; b) The step length (or learning rate) are too small.<BR>&gt;<BR>&gt;<BR>&gt; If you were registering images of sizes 512 x 512 x 200, that should<BR>&gt; probably should take between 2 minutes and 20 minutes in a modern<BR>&gt; computer.<BR>&gt;<BR>&gt; If you are doing PointSet registration, and your point sets have around<BR>&gt; 25,000 points, then it should take about 20 minutes to register them<BR>&gt; using ICP (in a modern computer).<BR>&gt;<BR>&gt; You will find easier to monitor the registration process is you add<BR>&gt; a visualization of the point sets using VTK, to the command observer<BR>&gt; of the registration.<BR>&gt;<BR>&gt;<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Regards,<BR>&gt;<BR>&gt;<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Luis<BR>&gt;<BR>&gt;<BR>&gt; -------------------<BR>&gt; tony hakki wrote:<BR>&gt; &gt; you are generally right, but in this algorithm when optimizer finds the<BR>&gt; &gt;
 best results it will be stoped by program not to wait&nbsp;&nbsp;900 million<BR>&gt; &gt; iterations . I didn't think that it would need 900 million iterations. I<BR>&gt; &gt; thought at the beginning just assign 900 million any how it would not<BR>&gt; &gt; need 900 million&nbsp;&nbsp;iterations. It has been still runnning :((<BR>&gt; &gt;<BR>&gt; &gt; ----- Original Message ----<BR>&gt; &gt; From: Robert Tamburo &lt;rjtst21@pitt.edu&gt;<BR>&gt; &gt; To: tony hakki &lt;tony2007vtk@yahoo.com&gt;<BR>&gt; &gt; Cc: insight-users@itk.org<BR>&gt; &gt; Sent: Friday, March 30, 2007 4:39:08 PM<BR>&gt; &gt; Subject: Re: [Insight-users] How long does it take do you think ?<BR>&gt; &gt;<BR>&gt; &gt; I've never used this algorithm but 900 million iterations seems like<BR>&gt; &gt; insanity. Assume that each iteration takes either 1 millisecond (best<BR>&gt; &gt; case scenario?) or 1 second (worst case scenario?) then calculate how<BR>&gt; &gt; long 900 million iterations will take.
 You will probably want to rethink<BR>&gt; &gt; the number of iterations you're using. You may also want to set up&nbsp;&nbsp;a<BR>&gt; &gt; convergence criteria to stop the registration. You may find that you<BR>&gt; &gt; only need a handful iterations to achieve acceptable results.<BR>&gt; &gt;<BR>&gt; &gt; On Mar 30, 2007, at 3:34 AM, tony hakki wrote:<BR>&gt; &gt;<BR>&gt; &gt;&gt; hello ;<BR>&gt; &gt;&gt; I have tried to implement point set to image registration. My point<BR>&gt; &gt;&gt; set has 151 points(x,y,z),and the image 3D .raw image size is<BR>&gt; &gt;&gt; size = 329 527 181&nbsp;&nbsp;and the resolution is res=&nbsp;&nbsp;0.200068 0.200068<BR>&gt; &gt;&gt; 0.200068&nbsp;&nbsp;.Is there anybody who is expert on registration&nbsp;&nbsp;process to<BR>&gt; &gt;&gt; guess how long does&nbsp;&nbsp;computer run&nbsp;&nbsp;to finish registration process? my<BR>&gt; &gt;&gt; computer has 2.21 GHz processor, and 3 GB Ram . I assigned<BR>&gt; &gt;&gt; numberofiteration
 as 900.000.000 (900 million) and my computer has<BR>&gt; &gt;&gt; been runnning for 20 hours(yes ,20 hours:))),do you think this is normal?<BR>&gt; &gt;&gt; Thanks<BR>&gt; &gt;&gt; Tony<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt;<BR>&gt; ------------------------------------------------------------------------<BR>&gt; &gt;&gt; Sucker-punch spam<BR>&gt; &gt;&gt;<BR>&gt; &lt;<A href="http://us.rd.yahoo.com/evt=49981/*http://advision.webevents.yahoo.com/mailbeta/features_spam.html" target=_blank>http://us.rd.yahoo.com/evt=49981/*http://advision.webevents.yahoo.com/mailbeta/features_spam.html</A>&gt;<BR>&gt; &gt;&gt; with award-winning protection.<BR>&gt; &gt;&gt; Try the free Yahoo! Mail Beta.<BR>&gt; &gt;&gt;<BR>&gt; &lt;<A href="http://us.rd.yahoo.com/evt=49981/*http://advision.webevents.yahoo.com/mailbeta/features_spam.html" target=_blank>http://us.rd.yahoo.com/evt=49981/*http://advision.webevents.yahoo.com/mailbeta/features_spam.html</A>&gt;<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt;
 _______________________________________________<BR>&gt; &gt;&gt; Insight-users mailing list<BR>&gt; &gt;&gt; Insight-users@itk.org &lt;mailto:Insight-users@itk.org&gt;<BR>&gt; &gt;&gt; <A href="http://www.itk.org/mailman/listinfo/insight-users" target=_blank>http://www.itk.org/mailman/listinfo/insight-users</A><BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; ------------------------------------------------------------------------<BR>&gt; &gt; We won't tell. Get more on shows you hate to love<BR>&gt; &gt;<BR>&gt; &lt;<A href="http://us.rd.yahoo.com/evt=49980/*http://tv.yahoo.com/collections/265" target=_blank>http://us.rd.yahoo.com/evt=49980/*http://tv.yahoo.com/collections/265</A><BR>&gt; &gt;<BR>&gt; &gt; (and love to hate): Yahoo! TV's Guilty Pleasures list.<BR>&gt; &gt;<BR>&gt; &lt;<A href="http://us.rd.yahoo.com/evt=49980/*http://tv.yahoo.com/collections/265"
 target=_blank>http://us.rd.yahoo.com/evt=49980/*http://tv.yahoo.com/collections/265</A><BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; ------------------------------------------------------------------------<BR>&gt; &gt;<BR>&gt; &gt; _______________________________________________<BR>&gt; &gt; Insight-users mailing list<BR>&gt; &gt; Insight-users@itk.org<BR>&gt; &gt; <A href="http://www.itk.org/mailman/listinfo/insight-users" target=_blank>http://www.itk.org/mailman/listinfo/insight-users</A><BR>&gt;<BR>&gt;<BR>&gt;&nbsp;&nbsp;________________________________<BR>&gt; The fish are biting.<BR>&gt;&nbsp;&nbsp;Get more visitors on your site using Yahoo! Search Marketing.<BR>&gt; _______________________________________________<BR>&gt; Insight-users mailing list<BR>&gt; Insight-users@itk.org<BR>&gt; <A href="http://www.itk.org/mailman/listinfo/insight-users" target=_blank>http://www.itk.org/mailman/listinfo/insight-users</A><BR>&gt;<BR>&gt;</DIV></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR></DIV></div><br>

<hr size=1>
<a href="http://us.rd.yahoo.com/evt=49678/*http://smallbusiness.yahoo.com/domains/?p=BESTDEAL"> Get your own web address.</a><br> Have a HUGE year through <a href="
http://us.rd.yahoo.com/evt=49678/*http://smallbusiness.yahoo.com/domains/?p=BESTDEAL">Yahoo! Small Business.</a></body></html>