<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Ops....sorry for my inattention...;-))<br><br><br><hr id="stopSpelling">Date: Fri, 6 Aug 2010 11:56:30 +0200<br>Subject: Re: [Insight-users] (no subject)<br>From: sergio.vera@alma3d.com<br>To: danysunflower@hotmail.it<br>CC: insight-users@itk.org<br><br><span class="ecxApple-style-span" style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;"><div><span class="ecxApple-style-span" style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;">Hi Daniela,</span></div>
filterCost-&gt;SetInput(filter-&gt;GetOutput);</span><div><font class="ecxApple-style-span" face="arial, sans-serif"><span class="ecxApple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="ecxApple-style-span" face="arial, sans-serif"><span class="ecxApple-style-span" style="border-collapse: collapse;">lacks the parentheses to the GetOutput() call:</span></font></div>
<div><font class="ecxApple-style-span" face="arial, sans-serif"><span class="ecxApple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="ecxApple-style-span" face="arial, sans-serif"><span class="ecxApple-style-span" style="border-collapse: collapse;"><span class="ecxApple-style-span" style="font-size: 13px;">filterCost-&gt;SetInput(filter-&gt;GetOutput());</span></span></font></div>
<div><font class="ecxApple-style-span" face="arial, sans-serif"><span class="ecxApple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="ecxApple-style-span" face="arial, sans-serif"><span class="ecxApple-style-span" style="border-collapse: collapse;">regards<br>
</span></font><div><font class="ecxApple-style-span" face="arial, sans-serif"><span class="ecxApple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><br><div class="ecxgmail_quote">On Fri, Aug 6, 2010 at 11:43 AM, Daniela Sacchetto <span dir="ltr">&lt;<a href="mailto:danysunflower@hotmail.it">danysunflower@hotmail.it</a>&gt;</span> wrote:<br>
<blockquote class="ecxgmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



<div>
Thanks Sergio for your suggestions.<br>I try to use the filter who suggested me but I have some problem and it doesn't run.<br><br>I wrote this code:<br>-------------------------------------------------------------------------------------------------------------------------------------------------<br>
typedef itk::AddConstantToImageFilter&lt;InputImageType,const float,OutputImageType&gt; AddCostantType;<br><br>AddCostantType::Pointer filterCost= AddCostantType::New();<br><br>filterCost-&gt;SetConstant(-0.5);<br>filterCost-&gt;SetInput(filter-&gt;GetOutput);<br>
<br>filterCost-&gt;Update();<br>-----------------------------------------------------------------------------------------------------------------------------------<br><br>But I have this output:<br><br>/home/daniela/Scrivania/Skeleton_ok/DistanceTrasform/DistanceTrasform2.cxx: In function ‘int main(int, char**)’:<br>
/home/daniela/Scrivania/Skeleton_ok/DistanceTrasform/DistanceTrasform2.cxx:124: error: no matching function for call to ‘itk::AddConstantToImageFilter&lt;itk::Image&lt;signed char, 3u&gt;, const float, itk::Image&lt;short int, 3u&gt; &gt;::SetInput(&lt;unresolved overloaded function type&gt;)’<br>
<br>[...]<br><br>I included the itkAddConstantToImageFilter.h file in the same folder where I save my code (as I always do when I use header file not included in itk folder...). <br>I thinks that I'm doing a stupid error, but I'm not expert in itk and c++, so I need your help.<br>
<br>Thanks of all, <br>Regards<br><font color="#888888">Daniela<br></font><div class="ecxhm"><hr>Date: Fri, 6 Aug 2010 10:52:11 +0200<br>Subject: Re: [Insight-users] (no subject)<br>From: <a href="mailto:sergio.vera@alma3d.com">sergio.vera@alma3d.com</a><br>
To: <a href="mailto:danysunflower@hotmail.it">danysunflower@hotmail.it</a><br>CC: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a></div><div><div></div><div class="h5"><br><br>
Hi Daniela.<div><br></div><div>Matlab and ITK are completely different environments... it may take a while to adapt.</div><div><br></div><div>To substract 0.5 to a image you can use the following filter:&nbsp;<span style="font-family: Geneva,Arial,Helvetica,sans-serif; font-weight: bold;">itk::AddConstantToImageFilter</span></div>

<div><span style="font-family: Geneva,Arial,Helvetica,sans-serif; font-size: 14px;"><div><span style="font-size: small;"><span style="font-weight: normal;"><br>
</span></span></div><div><span style="font-size: small;"><span style="font-weight: normal;">to perform the comparation between the images you can use&nbsp;</span></span><span style="font-weight: bold;"><span style="font-size: small;">itk::DifferenceImageFilter</span></span></div>

<div><span style="font-weight: bold;"><span style="font-size: small;"><br></span></span></div><div><span style="font-size: small;">regards</span></div>
<div><span style="font-size: small;"><span style="font-weight: normal;"><br></span></span></div></span><br><div>On Fri, Aug 6, 2010 at 10:40 AM, Daniela Sacchetto <span dir="ltr">&lt;<a href="mailto:danysunflower@hotmail.it">danysunflower@hotmail.it</a>&gt;</span> wrote:<br>

<blockquote style="padding-left: 1ex;">



<div>
Hi everyone,<br>I'm working in itk and I have a problem.<br><br>I have to do this operation :<br>-----------------------------------------------------------------<br>if (Daverage &lt; (D - 0.5))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (*)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dfinal=1<br>

else<br>&nbsp;&nbsp;&nbsp;&nbsp; Dfinal=0<br>-----------------------------------------------------------------<br>where:<br><br>D= is a DistanceMap obtained with itkDanielssonDistanceMapImageFilter;<br>Daverage = is D filtered with&nbsp; itkDiscreteGaussianImageFilter;<br>

<br>Dfinal = is a 3D map where pixel are black or white depending from (*).<br><br>I'm trying to do it but I have several problems with operations/comparisons between images... Could anyone help me?<br><br>For example in Matlab I can simply do:<br>

&nbsp;D - 0.5<br>to substract 0.5 to every pixel of my image... I tryed to do the same in itk but it doesn't run...<br><br>Thanks all for help<br>Daniela<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>
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><br clear="all"><br>-- <br>Sergio Vera<br><br>&nbsp;Alma IT Systems<br>&nbsp;C/ Vilana, 4B, 4º 1ª<br>&nbsp;08022 Barcelona<br>&nbsp;T. (+34) 932 380 592<br>&nbsp;<a href="http://www.alma3d.com" target="_blank">www.alma3d.com</a><br>

</div>                                               </div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Sergio Vera<br><br>&nbsp;Alma IT Systems<br>&nbsp;C/ Vilana, 4B, 4º 1ª<br>&nbsp;08022 Barcelona<br>&nbsp;T. (+34) 932 380 592<br>&nbsp;<a href="http://www.alma3d.com" target="_blank">www.alma3d.com</a><br>
</div></div>                                               </body>
</html>