<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hey Vishal,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">I tried setting the transform to the metric, and that gets rid of the "transform not set" exception:</div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace">        metric->SetTransform(transform);</font></div><div class="gmail_default"><font face="monospace, monospace">        metric->SetInterpolator(interpolator1);</font></div><div class="gmail_default"><font face="monospace, monospace">        metric->Initialize();</font></div></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Take a look at the Initialize method on line 300 in ITK-git\Modules\Registration\Common\include\itkImageToImageMetric.hxx to see all the things you need to provide to metric before a call to initialize.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">I guess that you are also migrating the code from registration V3 framework to V4, in addition to going from 2 projections to 1, which complicates your life. May I suggest you first do one, and once that works then the other? E.g. first update the example to use V4 registration framework, and then change the code to go from two projections to one.<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 9, 2016 at 2:28 AM, vishal <span dir="ltr"><<a href="mailto:itkhelpacc@gmail.com" target="_blank">itkhelpacc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hi,<br>
I made some changes to the code i attached previously no i getting this<br>
error:<br>
<br>
Starting the registration now...<br>
Exception in the Metric )intialize caught!!<br>
itk::ERROR: NormalizedCorrelationImageToImageMetric(0000000002832510):<br>
Transform<br>
 is not present<br>
-------------------------------------<br>
MultiResolution Level : 0<br>
<br>
ExceptionObject caught !<br>
<br>
itk::ExceptionObject (000000000027E8A0)<br>
Location: "void __cdecl itk::NormalizedCorrelationImageToImageMetric<class<br>
itk::<br>
Image<float,3>,class itk::Image<float,3> >::GetValueAndDerivative(const<br>
class it<br>
k::OptimizerParameters<double> &,double &,class itk::Array<double> &) const"<br>
File:<br>
c:\itk\insighttoolkit-4.8.2\modules\registration\common\include\itkNormali<br>
zedCorrelationImageToImageMetric.hxx<br>
Line: 332<br>
Description: itk::ERROR:<br>
NormalizedCorrelationImageToImageMetric(000000000283251<br>
0): The gradient image is null, maybe you forgot to call Initialize()<br>
<br>
Please find the modified code along with this post... please help me out<br>
with this problem!!<br>
regards<br>
Vishal<br>
<br>
code:  RegularStepGradientDescentWithNGC.cxx<br>
<<a href="http://itk-users.7.n7.nabble.com/file/n36758/RegularStepGradientDescentWithNGC.cxx" rel="noreferrer" target="_blank">http://itk-users.7.n7.nabble.com/file/n36758/RegularStepGradientDescentWithNGC.cxx</a>><br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://itk-users.7.n7.nabble.com/Multiresolution-Registration-error-while-trying-to-improve-a-journal-paper-tp36739p36758.html" rel="noreferrer" target="_blank">http://itk-users.7.n7.nabble.com/Multiresolution-Registration-error-while-trying-to-improve-a-journal-paper-tp36739p36758.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the ITK - Users mailing list archive at Nabble.com.<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br></div>