<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"><<a href="mailto:nganesh76@hotmail.com">nganesh76@hotmail.com</a>></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>ImageRegistration4 P1T1Img1.mha P1T2<br>Img2.mha Final_P1T1fT2m.mha<br><br>ExceptionObject caught !<br><br>itk::ExceptionObject (0146FB48)<br>Location: "void __thiscall itk::MattesMutualInformationImageToImageMetric<class<br>
itk::Image<unsigned short,3>,class itk::Image<unsigned short,3> >::GetValueAndDe<br>rivative(const class itk::Array<double> &,double &,class itk::Array<double> &) c<br>onst"<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>