<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Have you looked at the histograms of the two image with the parameters provided to the metric?<div><br></div><div>Perhaps this example will be of use:</div><div><a href="http://www.itk.org/Doxygen/html/RegistrationITKv3_2ImageRegistrationHistogramPlotter_8cxx-example.html">http://www.itk.org/Doxygen/html/RegistrationITKv3_2ImageRegistrationHistogramPlotter_8cxx-example.html</a></div><div><br></div><div>Brad<br><div><div>On Jul 16, 2014, at 9:52 AM, Iyas Hamdan <<a href="mailto:iyas.hamdan@gmail.com">iyas.hamdan@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div>Hello, <br><br></div>Thanks for your reply! <br><br></div>It's true I haven't shared alot of information about the methode I'm using sorry about that.<br>
<br></div>My code is based on the example "ImageRegistration20.cxx" with some modifications; <br><br></div>So I'm <span>basically using a 3D Affine registration with Mattes mutual information being the metric and the regular step gradient descent as the optimizer and finally a linear interpolator.<br>
<br></span></div><span>For the initialization, its good and there's no problem here. <br><br></span></div><span>But
 for the result, concerning the registered volume, the scale is good as 
well but the problem is that the its not aligned with the fixed volume. <br><br></span></div><span>And
 for the parameters, I have only a few ones for the metric ( number of 
histogram bins and spatial samples ) and I dont think they would have 
that much of effect on the output, but I tried to change them and I 
ended up always with almost the same result. <br></span></div><span>And for the optimizer, same as before I tried so many values for the relaxation factor and the max/min step lengths as well. <br><br></span></div><span>So
 the problem is not the scale nor the parameters but the registration 
itself; since it can't find, for each slice of the fixed volume, the 
slice in the moving volume that corresponds the maximum. So on the output I have a volume that has the same scale as the fixed one but they 
are not aligned and have no mutual information between them I would say.
 Even though I tried to change the initialization to prevent the local 
minimas and I'm starting now with a good initialization but still the 
same result. <br><br><br></span></div><span>And what I 
found wierd is that when I deleted few slices from the end of the moving
 volume, the registration worked perfectly and I had good results!<br><br><br></span></div><div><span><br></span></div><span>Hope this was clear and these information was enough, and please let me know if you have any other suggestions or advices.<br>
<br></span></div><span>Thanks in advance, <br><br></span></div><span>Iyas</span></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 16, 2014 at 3:17 PM, Bradley Lowekamp <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
This not the expected behavior for a good registration program.<br>
<br>
Is your initialization good?<br>
<br>
You haven't shared anything about the registration components you are using. Perhaps you scales are way off? How does the convergence look when monitoring the output?<br>
<br>
Perhaps you have too many free parameters? Maybe you are trying to optimize an transform with too many parameters when you are not close. Perhaps you need to do a Translation + Rotation transform such as Euler or Versor first?<br>

<br>
Hope that helps,<br>
Brad<br>
<div><div class="h5"><br>
On Jul 15, 2014, at 5:26 AM, Iyas Hamdan <<a href="mailto:iyas.hamdan@gmail.com">iyas.hamdan@gmail.com</a>> wrote:<br>
<br>
> Hello itk users,<br>
><br>
> I'm working on 3D image registration, currently I'm trying to register a CT volume to an MRI volume ( the two volumes have different sizes concerning the number of slices used to construct the 3D volume).<br>

><br>
> I'm doing an affine registration using the mutual information as a metric, and I'm having problems registering those two volumes.<br>
><br>
> What I thiink the problem is, I have a different field of view between both volumes, so when I try to register the whole CT volume to the MRI one  the registration falis. However, when I deleted a dozen of slices from the CT volume ( so that I had the same field of view in both volumes) it works just fine and I was able to register the volumes.<br>

><br>
><br>
> And by "the registration failed" I meant it worked with no errors but the result was really bad! and that the registered volume was nothing like the fixed one, so if I try to find the difference between each two corresponding slices for example , they were not aligned at all!<br>

><br>
> Is that normal that the registration doesnt work when I have a different field of view in each volume ? or should it deform one volume so that it corresponds to the other one even if they had two different fields of view ?<br>

><br>
> Any help would be really appreciated,<br>
><br>
> Thanks in advance,<br>
><br>
> Iyas<br>
</div></div>> _____________________________________<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></body></html>