You are right, but I have to display &quot;unsigned char&quot; image... Do you know name of filter, which convert float image to unsigned char image? <br>Thanks a lot<br><br><div class="gmail_quote">2011/4/1 Arunachalam Kana <span dir="ltr">&lt;<a href="mailto:Kana.Arunachalam@fh-wels.at">Kana.Arunachalam@fh-wels.at</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div link="blue" vlink="purple" lang="DE-AT"><div><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Hi,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D" lang="EN-GB">Writing the error message will give a better idea for us about what you are facing. </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D" lang="EN-GB"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D" lang="EN-GB">Anyways from what i know, the outputimagetype for discretegaussian is a float image.  So in your definition</span></p>
<p class="MsoNormal"></p><div class="im"><span style="font-family:&quot;Courier New&quot;" lang="EN-GB">typedef itk::DiscreteGaussianImageFilter&lt; TImageType, TImageType &gt; DiscreteGaussianFilterType;<br></span></div>
<span style="font-size:11.0pt;color:#1F497D" lang="EN-GB">TImageType should be of float type. So your input image should be a float too.  If this is true then i don’t know the bug.</span><p></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D" lang="EN-GB">If your input image is not float then you should change the definition as </span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;" lang="EN-GB">typedef itk::DiscreteGaussianImageFilter&lt; TImageType, TOutputImageType &gt; DiscreteGaussianFilterType;</span></p><p class="MsoNormal">
<span style="font-family:&quot;Courier New&quot;" lang="EN-GB">TOutputImageType should be a float image.</span></p><p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;" lang="EN-GB"> </span></p><p class="MsoNormal">
<span style="font-size:11.0pt;color:#1F497D" lang="EN-GB">This is the only thought sparked in my mind. Please check for this.</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D" lang="EN-GB"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D" lang="EN-GB">All the best</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D" lang="EN-GB">Regards,</span></p><p class="MsoNormal">
<span style="font-size:11.0pt;color:#1F497D" lang="EN-GB">Kana </span><span style="font-family:&quot;Courier New&quot;" lang="EN-GB"><br><br></span><span style="font-size:11.0pt;color:#1F497D" lang="EN-GB"></span></p><p class="MsoNormal">
<span style="font-size:11.0pt;color:#1F497D" lang="EN-GB"> </span></p><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="font-size:10.0pt" lang="EN-US">From:</span></b><span style="font-size:10.0pt" lang="EN-US"> <a href="mailto:insight-users-bounces@itk.org" target="_blank">insight-users-bounces@itk.org</a> [mailto:<a href="mailto:insight-users-bounces@itk.org" target="_blank">insight-users-bounces@itk.org</a>] <b>On Behalf Of </b>G G<br>
<b>Sent:</b> 01 April 2011 11:37<br><b>To:</b> insight-users<br><b>Subject:</b> [Insight-users] DiscreteGaussianImageFilter in function</span></p></div><div><div></div><div class="h5"><p class="MsoNormal"> </p><p class="MsoNormal">
Hi, I dont solve it, so I try to ask here...<br>I have this function<br><br><span style="font-family:&quot;Courier New&quot;">template&lt;typename TImageTypePointer, typename TImageType&gt; void WatershedCompute::<br>    discreteGaussianFilter(TImageTypePointer inputImage, void *poutputImage)<br>
{<br>    typedef itk::DiscreteGaussianImageFilter&lt; TImageType, TImageType &gt; DiscreteGaussianFilterType;<br>    DiscreteGaussianFilterType::Pointer discreteGaussianFilter = DiscreteGaussianFilterType::New();<br>    discreteGaussianFilter-&gt;SetInput( inputImage );<br>
    const double gaussianVariance = this-&gt;params-&gt;Get_discrete_gaussian_variance();<br>    const unsigned int maxKernelWidth = this-&gt;params-&gt;Get_discrete_gaussian_kernel_width();<br>    discreteGaussianFilter-&gt;SetVariance( gaussianVariance );<br>
    discreteGaussianFilter-&gt;SetMaximumKernelWidth( maxKernelWidth );<br>    discreteGaussianFilter-&gt;Update(); // this line<br>    TImageTypePointer *Pout = (TImageTypePointer *)poutputImage;<br>    *Pout = discreteGaussianFilter-&gt;GetOutput();<br>
    return;<br>}</span><br><br>And in <span style="font-family:&quot;Courier New&quot;">// this line</span> I have &quot;error&quot;... I dont know, if it is error, because I get code from another function, which I dont call, I dont know what is the problem :(<br>
<br><br>I have another function for example <br><br><span style="font-family:&quot;Courier New&quot;">template&lt;typename TImageTypePointer, typename TImageType&gt; void WatershedCompute::<br>    rescaleIntensityFilter(TImageTypePointer inputImage, void *poutputImage, int min, int max)<br>
{<br>    typedef itk::RescaleIntensityImageFilter&lt; TImageType, TImageType &gt; RescaleFilterType;<br>    RescaleFilterType::Pointer rescaler = RescaleFilterType::New();<br>    rescaler-&gt;SetOutputMinimum( min );<br>    rescaler-&gt;SetOutputMaximum( max );<br>
    rescaler-&gt;SetInput( inputImage );<br>    rescaler-&gt;Update();<br>    TImageTypePointer *Pout = (TImageTypePointer *)poutputImage;<br>    *Pout = rescaler-&gt;GetOutput();<br>    return;<br>}</span><br><br>When I call only <span style="font-family:&quot;Courier New&quot;">rescaleIntensityFilter</span> and dont call <span style="font-family:&quot;Courier New&quot;">discreteGaussianFilter</span> it is OK. Could someone help me, please? <br>
Thanks a lot :-)</p></div></div></div></div></blockquote></div><br>