<div class="gmail_quote"><div>Hi Luis,</div><div>Thanks to replay me.</div><div><br></div><div>I use </div><div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo">       </p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo">
</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span style="color: #bb2b9f">typedef</span> itk::ImageMaskSpatialObject&lt; ImageDimension &gt;MaskType;</p><p></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo">
        MaskType::Pointer<span class="Apple-tab-span" style="white-space:pre">        </span>spatialObjectMask<span class="Apple-tab-span" style="white-space:pre">        </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>MaskType::New();</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><br></p></div><div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #00841c"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span>spatialObjectMask-&gt;SetImage( maskReader-&gt;GetOutput() );</p>

<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #00841c"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span>metric-&gt;SetFixedImageMask( spatialObjectMask);</p>
<div><font class="Apple-style-span" color="#00841C" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px; "><br></span></font></div></div><div><br></div><div>the mask covers all the head..... should I use a mask larger than the head?</div>
<div><br></div><div>Serena.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">----------------------------------------------------------------------<br>

<br>
Message: 1<br>
Date: Thu, 17 Jun 2010 10:33:41 -0400<br>
From: Luis Ibanez &lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt;<br>
Subject: Re: [Insight-users] Problems with Bspline grid and mask<br>
To: sere f &lt;<a href="mailto:serenaf33@gmail.com">serenaf33@gmail.com</a>&gt;<br>
Cc: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br>
Message-ID:<br>
        &lt;<a href="mailto:AANLkTiliRUpoydvHExh8JbHmCZV3hNctl-AxbTvbY2I3@mail.gmail.com">AANLkTiliRUpoydvHExh8JbHmCZV3hNctl-AxbTvbY2I3@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
Hi Sere,<br>
<br>
How are you defining the mask ?<br>
<br>
I would suggest that you use the SpatialObjectToImageMask<br>
in order to imprint the mask in the Fixed image and see where<br>
it is mapping.<br>
<br>
It is quite likely that your Mask is not covering the pixels<br>
that you think is covering.<br>
<br>
For examples on how to use this filter, please look at;<br>
<br>
            Insight/Examples/Filtering/<br>
                         SpatialObjectToImage1.cxx<br>
                         SpatialObjectToImage2.cxx<br>
                         SpatialObjectToImage3.cxx<br>
<br>
<br>
   Regards,<br>
<br>
<br>
       Luis<br>
<br>
<br>
-------------------------------------------------------------------------------<br>
On Thu, Jun 17, 2010 at 7:58 AM, sere f &lt;<a href="mailto:serenaf33@gmail.com">serenaf33@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Hi All,<br>
&gt;<br>
&gt; I am registering with 2 images of the head with BSpline Transformation and<br>
&gt; Mattes MI.<br>
&gt;<br>
&gt; I use the mask to exclude the background so the samples for MI are taken<br>
&gt; only from the head, but the BSpline grid is defined on all image.<br>
&gt; The registered image is not correctly deformed. In particular it appears flattened<br>
&gt;  on the top of the image.<br>
&gt; I have played with the parameters of optimizer but i have the same result.<br>
&gt; When I register without the mask the registered image is good.<br>
&gt; Where is  the error?<br>
&gt; any idea?<br>
&gt;<br>
&gt; Thank you for any suggestion.<br>
&gt;<br>
&gt; Serena.<br>
&gt;<br>
&gt;<br>
&gt; _____________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;<br>
&gt;<br><br>
</blockquote></div><br>