<div dir="ltr">I get the error immediately after running the script, so I think the problem is in the transform initialization. <div>Should I try with <a class="" href="http://www.itk.org/Doxygen/html/itkCenteredTransformInitializer_8h_source.html" style="color:rgb(70,101,162);font-weight:bold;font-family:monospace;font-size:12px;line-height:22px">itkCenteredTransformInitializer.h</a><font color="#000000" face="monospace"><span style="font-size:12px;line-height:22px">? </span></font></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-23 14:48 GMT+02:00 Bradley Lowekamp <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Is this at the first iteration of after a few? Are iterations converging, diverging or erratic?<div>
<br></div><div>If it's the first it's an indication that initial transform is poor and they don't overlap much. There for the results of the transform initializer should be evaluated.</div><div><br></div><div>
If it's after a few iterations, then is the iteration of the metric and optimizer needs to be examine. Is the value of the metric correct and correlated with the correct solution? Is the step size too big? Would smoothing the fixed and moving images smooth optimization? etc?</div>
<div><br></div><div>These registration examples are not designed to be turn key solution, they are a stepping stone to learn about the registration framework, and begin analyzing the behavior of the components so that a solution to your problem can be constructed.<br>
<div><br></div><div>Brad</div><div><div class="h5"><div><br><div><div>On Jul 23, 2014, at 8:30 AM, elena bresciani <<a href="mailto:elena.bresciani87@gmail.com" target="_blank">elena.bresciani87@gmail.com</a>> wrote:</div>
<br><blockquote type="cite"><div dir="ltr">ExceptionObject caught !<br><br>itk::ExceptionObject (0x3043350)<br>Location: "void itk::MeanSquaresImageToImageMetric<TFixedImage, TMovingImage>::GetValueAndDerivative(const ParametersType&, itk::MeanSquaresImageToImageMetric<TFixedImage, TMovingImage>::MeasureType&, itk::MeanSquaresImageToImageMetric<TFixedImage, TMovingImage>::DerivativeType&) const [with TFixedImage = itk::Image<unsigned char, 2u>; TMovingImage = itk::Image<unsigned char, 2u>; itk::MeanSquaresImageToImageMetric<TFixedImage, TMovingImage>::ParametersType = itk::OptimizerParameters<double>; itk::MeanSquaresImageToImageMetric<TFixedImage, TMovingImage>::MeasureType = double; itk::MeanSquaresImageToImageMetric<TFixedImage, TMovingImage>::DerivativeType = itk::Array<double>]" <br>

File: /usr/local/include/ITK-4.5/itkMeanSquaresImageToImageMetric.hxx<br>Line: 257<br>Description: itk::ERROR: MeanSquaresImageToImageMetric(0x30384c0): Too many samples map outside moving image buffer: <a href="tel:4042%20%2F%20568832" value="+14042568832" target="_blank">4042 / 568832</a><br>
</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-23 13:47 GMT+02:00 Bradley Lowekamp <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What is the error you are getting?<br>
<br>
Brad<br>
<div><div>On Jul 23, 2014, at 6:20 AM, elena bresciani <<a href="mailto:elena.bresciani87@gmail.com" target="_blank">elena.bresciani87@gmail.com</a>> wrote:<br>
<br>
> Hello folks,<br>
><br>
> I have a registration problem for you. I'm using the code in the example ImageRegistration5.cxx in order to align image of drugs blisters to assess if they are the same or not.<br>
><br>
> The code works well even though for certain images couples I get the error in this message object.<br>
> I thought the problem could be the relative difference in images size and tried to pad the smallest one to have the same size as the biggest: same error.<br>
> After reading comments on the same topic I tried to add to the code the line<br>
><br>
> registration -> SetFixedImageRegion (fixedImage -> GetBufferedRegion());<br>
><br>
> again not solving my problem.<br>
> Attached you can find example images: while I can register image "1" on image "0", if I try to register "2" on "1" I get the ERROR.<br>
><br>
> Any guess?<br>
><br>
> Cheers,<br>
> Elena<br>
><br>
><br>
><br>
</div></div>> <0.jpg><1.jpg><2.jpg><br>
><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.php" target="_blank">http://www.kitware.com/products/protraining.php</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://public.kitware.com/mailman/listinfo/insight-users" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
<br>
</blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></div></blockquote></div><br></div>