<br>Hi Sharath,<br><br>Thanks for the clear description of the problem that you are facing.<br><br><br>The simplest way of restricting the computation of the metric to <br>a region of the image is to set the &quot;FixedImageRegion&quot;.<br>
<br><br>The typical call will look like<br><br>    registration-&gt;SetFixedImageRegion( fixedRegion );<br><br>   <br>You will find many examples of this call in programs in the <br>directory:<br><br>               Insight/Examples/Registration             <br>
<br><br>Using the FixedImageMask is also a way of restricting the<br>computation of the metric to use a subset of the pixels in<br>the fixed image, but it is more expensive in computation<br>time that just setting the FixedImageRegion.  Masks are<br>
justified when the region that you want to focus on, is not<br>a rectangular region, but, has an irregular shape.<br><br><br>For this to work, it is *VERY* important that you set <br>correctly the origin of the child image.<br>
<br>In principle the origin should be set in such a way that<br>if you render both images in physical space, the child<br>image will overlap to the correct location in the parent<br>image.<br><br>This will be done correctly by the RegionOfInterest<br>
image filter, for example.<br><br>If you have not set the origin of the child image this<br>way, then you should have to initialize properly the<br>translation of the Transform that you are using (Affine<br>in your case).<br>
<br>When you compute this Translation please keep in<br>mind that *ALL* the registration process is performed<br>in Physical Units, and never in pixel units. Therefore<br>the translation should take into account the origin of<br>
both images, and the pixel spacing of both images.<br><br><br>If you need help with this calculation, please post<br>to the mailing list the values of Origin and Pixel <br>Spacing of both images.<br><br>Also, please post the values of the Direction matrix<br>
(the direction cosines of the image) since they will<br>matter for the computation of the Translation in <br>Physical Space.<br><br>---<br><br>Just FYI, you can use different masks for the <br>FixedImage and the Moving image by calling the<br>
methods<br><br><br>    SetFixedImageMask()<br>    SetMovingImageMask()<br><br>That, said, please note that you probably don&#39;t<br>need to use Masks here, and you should be able<br>to do this by simply setting properly the call for<br>
SetFixedImageRegion().<br><br><br><br>       Regards,<br><br><br>               Luis<br><br><br><div class="gmail_quote">--------------------------------------------------------------------------<br>On Mon, Jun 29, 2009 at 10:30 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;"><br>
Hi,<br>
<br>
I am trying to register 2 images  - the first is a parent image (2000 * 2000 pixels) and the second is a child image ( 640* 480 pixels) which is any sub-part of the parent image.<br>
<br>
I am using the following combination:<br>
<br>
MutualInformationHistogramImageToImageMetric + MultiResolutionImageRegistrationMethod + AffineTransform + RegularStepGradientDescentOptimizer<br>
<br>
**** How can I adapt to take only a specified ROI in the parent image and full child image for Mutual Information calculation?<br>
<br>
I tried to use SetFixedImageMask() with a mask image (size of parent image, with only the ROI having non-zero values) and set the metric.  It failed with an exception.<br>
<br>
**** I assume this mask applied for both fixed and moving images. How can I apply different masks for fixed and moving images?<br>
<br>
Image Details:<br>
Moving Image (child image) : 640*480<br>
Fixed Image(parent image): 2000*2000<br>
Approximate start of corresponding area of moving image in fixed image ( top-left) (x,y) = (600,800)<br>
Approximate area of mask ROI (area to be considered for MI in the Fixed image) : 1200 * 800<br>
<br>
<br>
**** What initial translation values and transform center should I use for initializing AffineTransform ?<br>
<br>
**** How can I determine the approximate start point and region in the parent image for calculation Mutual Information ? ( As of now, I am assuming these values)<br>
<br>
Thanks,<br>
<br>
Sharath Venkatesha<br>
<br>
<br>
<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>
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>
</blockquote></div><br>