<div>Hi Luis,<div><br></div><div>Thanks for your replay.</div><div>I have tried it without success. The registered image is still flatted/distorted on the top of it. </div><div><br></div><div>The background of the moving and fixed image is set to 0. When I use the mask on fixed image the background is excluded but in the moving image the background can be selected. </div>
<div>So in MI calculus I will have a couples that is not informative: (fixedImage value -- 0 value) because 0 is the background in moving image and it is everywhere in the moving image. </div><div>This is very simply explanation, I know that Mattes MI is calculated with Parzel window method. </div>
<div>What do you think? </div><div><br></div><div>Thanks for any advice.</div><div><br></div><div>Serena.</div></div><div><br></div><div><br></div><div><br></div><br><br><div class="gmail_quote">On Sun, Jun 20, 2010 at 3:50 PM, Luis Ibanez <span dir="ltr"><<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>Hi Sere,<br><br><br>Please make sure that you call <br><br> maskReader->Update()<br><br><br>before you call<br>
<br><span style="color:rgb(0, 0, 0)"><span style="white-space:pre-wrap">        </span></span>spatialObjectMask->SetImage( maskReader->GetOutput() );<br>
<br><br>Otherwise, you will not have an image <br>set inside the MaskSpatialObject.<br><br><br> Luis<br><br><br>-------------------------------------------------------<div><div></div><div class="h5"><br><div class="gmail_quote">
On Thu, Jun 17, 2010 at 11:29 AM, sere f <span dir="ltr"><<a href="mailto:serenaf33@gmail.com" target="_blank">serenaf33@gmail.com</a>></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 class="gmail_quote"><div>Hi Luis,</div><div>Thanks to replay me.</div><div><br></div><div>
I use </div><div><p style="margin:0px;font-family:Menlo;font-style:normal;font-variant:normal;font-weight:normal;font-size:11px;line-height:normal;font-size-adjust:none;font-stretch:normal"> </p><p style="margin:0px;font-family:Menlo;font-style:normal;font-variant:normal;font-weight:normal;font-size:11px;line-height:normal;font-size-adjust:none;font-stretch:normal">
</p><p style="margin:0px;font-family:Menlo;font-style:normal;font-variant:normal;font-weight:normal;font-size:11px;line-height:normal;font-size-adjust:none;font-stretch:normal"><span style="color:rgb(187, 43, 159)">typedef</span> itk::ImageMaskSpatialObject< ImageDimension >MaskType;</p>
<p></p><p style="margin:0px;font-family:Menlo;font-style:normal;font-variant:normal;font-weight:normal;font-size:11px;line-height:normal;font-size-adjust:none;font-stretch:normal">
MaskType::Pointer<span style="white-space:pre-wrap">        </span>spatialObjectMask<span style="white-space:pre-wrap">        </span>=<span style="white-space:pre-wrap">        </span>MaskType::New();</p>
<p style="margin:0px;font-family:Menlo;font-style:normal;font-variant:normal;font-weight:normal;font-size:11px;line-height:normal;font-size-adjust:none;font-stretch:normal"><br></p></div><div><p style="margin:0px;font-family:Menlo;font-style:normal;font-variant:normal;font-weight:normal;font-size:11px;line-height:normal;font-size-adjust:none;font-stretch:normal;color:rgb(0, 132, 28)">
<span style="color:rgb(0, 0, 0)"><span style="white-space:pre-wrap">        </span></span>spatialObjectMask->SetImage( maskReader->GetOutput() );</p>
<p style="margin:0px;font-family:Menlo;font-style:normal;font-variant:normal;font-weight:normal;font-size:11px;line-height:normal;font-size-adjust:none;font-stretch:normal;color:rgb(0, 132, 28)"><span style="color:rgb(0, 0, 0)"><span style="white-space:pre-wrap">        </span></span>metric->SetFixedImageMask( spatialObjectMask);</p>
<div><font color="#00841c" face="Menlo" size="3"><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="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Thu, 17 Jun 2010 10:33:41 -0400<br>
From: Luis Ibanez <<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>><br>
Subject: Re: [Insight-users] Problems with Bspline grid and mask<br>
To: sere f <<a href="mailto:serenaf33@gmail.com" target="_blank">serenaf33@gmail.com</a>><br>
Cc: <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br>
Message-ID:<br>
<<a href="mailto:AANLkTiliRUpoydvHExh8JbHmCZV3hNctl-AxbTvbY2I3@mail.gmail.com" target="_blank">AANLkTiliRUpoydvHExh8JbHmCZV3hNctl-AxbTvbY2I3@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<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 <<a href="mailto:serenaf33@gmail.com" target="_blank">serenaf33@gmail.com</a>> wrote:<br>
<br>
> Hi All,<br>
><br>
> I am registering with 2 images of the head with BSpline Transformation and<br>
> Mattes MI.<br>
><br>
> I use the mask to exclude the background so the samples for MI are taken<br>
> only from the head, but the BSpline grid is defined on all image.<br>
> The registered image is not correctly deformed. In particular it appears flattened<br>
> on the top of the image.<br>
> I have played with the parameters of optimizer but i have the same result.<br>
> When I register without the mask the registered image is good.<br>
> Where is the error?<br>
> any idea?<br>
><br>
> Thank you for any suggestion.<br>
><br>
> Serena.<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>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</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://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
><br><br>
</blockquote></div><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>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</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://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>
</div></div></blockquote></div><br>