HI Sharath,<br><br>1) What value of region are you passing to <br><br><div><span style="font-family: &#39;times new roman&#39;; font-size: 16px;"> registration-&gt;SetFixedImageRegion( region )    ?<br></span></div><div><font size="4" face="&#39;times new roman&#39;"><span style="font-size: 16px;"><br>
   The Metric only uses the pixels inside that region.<br><br>   So, depending on the region that you are passing,<br>   you may not be using the 2000x2000 pixels of<br>   the full image.<br><br>2)   Why do you have to use a big region in the Fixed image ?<br>
<br>3) What Transform are you using ?<br>    A scaling of 0.5 is unusual, and may indicate that<br>    the spacing declared by your images is wrong.<br><br>4)  What is the content of the images ?<br>      are these medical images ?<br>
<br><br></span></font></div>5) Sure, you can sample from the Moving image,<br>    You simply need to swap  the Fixed and Moving<br>    images and you should be ready to rerun the <br>    registration.<br><br>6) What &quot;functions&quot;, in what &quot;respective&quot; files are <br>
    you referring to ?<br><br>   If you want to sample from the Moving Image, then<br>   In principle you just need to replace:<br><br>        registration-&gt;SetFixedImage( imageA );<br>        registration-&gt;SetMovingImage( imageB );<br>
        registration-&gt;SetFixedImageRegion( regionA );<br><br>with:<br><br>
        registration-&gt;SetFixedImage( imageB );<br>        registration-&gt;SetMovingImage( imageA );<br>
        registration-&gt;SetFixedImageRegion( regionB );<br>
<br>
<br><br>   Regards,<br><br><br>        Luis<br><br><br>----------------------------------------------------------------------------<br><div class="gmail_quote">On Sat, Jul 11, 2009 at 12:48 PM, Sharath Venkatesha <span dir="ltr">&lt;<a href="mailto:sharath20284@yahoo.com">sharath20284@yahoo.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><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><div>Hi Luis,</div>
<div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;">
<div class="im"><div><br></div><div>I am already using the </div><div><br></div><div><span style="font-family: &#39;times new roman&#39;; font-size: 16px;"> registration-&gt;SetFixedImageRegion( region ) </span></div><div>
<font size="4" face="&#39;times new roman&#39;"><span style="font-size: 16px;"><br></span></font></div><div><font size="4" face="&#39;times new roman&#39;"><span style="font-size: 16px;">My scaling parameters are around 0.6 and rotation of 6-7
 degrees, I have to use a big region  in the fixed image (I am initialiazing with scale =0.5, and hence using a region of size 1280*960).  The performance has not improved
 much. </span></font></div><div><font size="4" face="&#39;times new roman&#39;"><span style="font-size: 16px;"><br></span></font></div><div><font size="4" face="&#39;times new roman&#39;"><span style="font-size: 16px;">Hence I want to <b>sample pixels from the moving image,</b> and do a <b>backward mapping to pixels in the fixed image</b>( by the inverse transform parameters, that are estimated in each iteration of the optimizer). In this case, I think that almost all the points will be mapped, and hence the metric will be better. Also, it will take care of the scale and translation, as in the previous case, a wrong initial scale will make me miss out the the pixel values in the fixed image.</span></font></div>
<div><font size="4" face="&#39;times new roman&#39;"><span style="font-size: 16px;"><br></span></font></div><div><font size="4" face="&#39;times new roman&#39;"><span style="font-size: 16px;"><br></span></font></div></div>
<div class="im"><div><font size="4" face="&#39;times new roman&#39;"><span style="font-size: 16px;">Do I need to change the functions in the respective files, or is there a simpler way to do this, or is already implemented?<br>
<br>Thanks,<br><br>Sharath Venkatesha</span></font></div></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font size="2" face="Tahoma"><hr size="1">
<div class="im"><b><span style="font-weight: bold;">From:</span></b> Luis Ibanez &lt;<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>&gt;<br><b><span style="font-weight: bold;">To:</span></b> Sharath Venkatesha &lt;<a href="mailto:sharath20284@yahoo.com" target="_blank">sharath20284@yahoo.com</a>&gt;<br>
<b><span style="font-weight: bold;">Cc:</span></b> Insight users
 &lt;<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Saturday, July 11, 2009 8:49:51 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Insight-users] Registration - Mutual Information Metric -  Sampling from Moving Image<br>
</div></font><br><div><div></div><div class="h5">
<br>Hi Sharath,<br><br>You are right in that it is not a good idea to take samples<br>from the entire 2000 x 2000 pixels image if we expect that<br>only a regions of 640 x 480 is going to match the Moving<br>image.<br><br>

The solution is to simply call <br><br>            registration-&gt;SetFixedImageRegion( region )<br><br> and set &quot;region&quot; to the region of interest from the <br>2000 x 2000 image, where you anticipate to find matches<br>

for the moving image.<br><br><br>You will find examples on the use of <br><br>       SetFixedImageRegion()<br><br>in the ITK software Guide<br><br><span><span>       <a href="http://www.itk.org/ItkSoftwareGuide.pdf" target="_blank">http://www.itk.org/ItkSoftwareGuide.pdf</a></span></span><br>

<br>and most (if not all) the corresponding Image Registration<br>examples in <br><br>            Insight/Examples/Registration<br><br><br><br><br>   Regards,<br><br><br>         Luis<br><br><br><br>---------------------------------------------------------------<br>

<div class="gmail_quote">On Fri, Jul 10, 2009 at 9:15 PM, Sharath Venkatesha <span dir="ltr">&lt;<a rel="nofollow" href="mailto:sharath20284@yahoo.com" target="_blank">sharath20284@yahoo.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;">

<br>
Hi,<br>
<br>
I am working with images where the Fixed image is 2000*2000 pixels and the moving image is 640*480 (sub region of the fixed image). In all the Mutual Information metrics, the sampling is done on the Fixed image, and the transformed points are mapped on the moving image.<br>


<br>
I figured out that it is incorrect to sample the points randomly in the full fixed image ( as in my case, the moving image is a sub-part of the fixed image, and only 30-40% points were mapped), I used an approximate region of the fixed image from which sampling should be done. This has not improved the performance/accuracy of registration.<br>


<br>
I am thinking of sampling pixels from the moving image, and do a backward mapping to pixels in the fixed image. In this case, I think that almost all the points will be mapped, and hence the metric will be better.<br>
<br>
Do I need to change the functions in the respective files, or is there a simpler way to do this, or is already implemented?<br>
<br>
Thanks,<br>
<br>
Sharath Venkatesha<br>
<br>
<br>
<br>
<br>
<br>
_____________________________________<br>
Powered by <a rel="nofollow" href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br><span><span>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a></span></span><br>
<br><span><span>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a></span></span><br>
<br>
Follow this link to subscribe/unsubscribe:<br><span><span>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a></span></span><br>
</blockquote></div><br>
</div></div></div></div><div></div></div><br>

      </div></div><div></div></div><br>

      </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>
Please keep messages on-topic and check the ITK FAQ at: <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>