<br>Hi Ganesh,<br><br><br><br>            No, that line change is not enough.<br><br><br><br>You must also balance the number of parameters for<br>the Translation transform.<br><br>In particular,<br><br>lines 259-260<br><br>
  initialParameters[0] = 0.0;  // Initial offset in mm along X<br>  initialParameters[1] = 0.0;  // Initial offset in mm along Y<br><br>should become<br><br>  initialParameters[0] = 0.0;  // Initial offset in mm along X<br>
  initialParameters[1] = 0.0;  // Initial offset in mm along Y<br>  initialParameters[2] = 0.0;  // Initial offset in mm along Z<br><br><br>and lines 325-326:<br><br>  double TranslationAlongX = finalParameters[0];<br>  double TranslationAlongY = finalParameters[1];<br>
<br>should become:<br><br>  double TranslationAlongX = finalParameters[0];<br>  double TranslationAlongY = finalParameters[1];<br>  double TranslationAlongZ = finalParameters[2];<br><br><br><br>Without these additional changes you will be <br>
running your code with uninitialized variables.<br><br><br>   Regards,<br><br><br>         Luis<br><br><br><br>-----------------------------------------------------------------<br><div class="gmail_quote">On Tue, May 25, 2010 at 2:10 PM, Ganesh Narayanasamy <span dir="ltr">&lt;<a href="mailto:nganesh76@hotmail.com">nganesh76@hotmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



<div>
<br>I converted the ImageRegistration4.cxx on MattesMutualInformation technique from 2D into 3D by changing line #123 from 2 to 3:<br>const    unsigned int    Dimension = 3;<br><br>Is that all that needs to be done?<br>When I did Build Solution and ran the executable with 2 input images and a name for an output image, I got this error message:<br>
<br><br>****<br>C:\Ganesh\ITK316\Build\bin\Debug&gt;ImageRegistration4  P1T1Img1.mha P1T2<br>Img2.mha Final_P1T1fT2m.mha<br><br>ExceptionObject caught !<br><br>itk::ExceptionObject (0146FB48)<br>Location: &quot;void __thiscall itk::MattesMutualInformationImageToImageMetric&lt;class<br>
itk::Image&lt;unsigned short,3&gt;,class itk::Image&lt;unsigned short,3&gt; &gt;::GetValueAndDe<br>rivative(const class itk::Array&lt;double&gt; &amp;,double &amp;,class itk::Array&lt;double&gt; &amp;) c<br>onst&quot;<br>
File: c:\ganesh\itk316\itk\code\algorithms\itkMattesMutualInformationImageToImag<br>eMetric.txx<br>Line: 1113<br>Description: itk::ERROR: MattesMutualInformationImageToImageMetric(019441E0): To<br>o many samples map outside moving image buffer: 0 / 10000<br>
****<br><br><br>Can you identify the error and let me know any corrective step?<br>Thanks for your help,<br>
Ganesh<br>                                               <br><hr>The New Busy is not the old busy. Search, chat and e-mail from your inbox. <a href="http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3" target="_blank">Get started.</a></div>

<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>