You are right, but I have to display "unsigned char" 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"><<a href="mailto:Kana.Arunachalam@fh-wels.at">Kana.Arunachalam@fh-wels.at</a>></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:"Courier New"" lang="EN-GB">typedef itk::DiscreteGaussianImageFilter< TImageType, TImageType > 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:"Courier New"" lang="EN-GB">typedef itk::DiscreteGaussianImageFilter< TImageType, TOutputImageType > DiscreteGaussianFilterType;</span></p><p class="MsoNormal">
<span style="font-family:"Courier New"" lang="EN-GB">TOutputImageType should be a float image.</span></p><p class="MsoNormal"><span style="font-family:"Courier New"" 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:"Courier New"" 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:"Courier New"">template<typename TImageTypePointer, typename TImageType> void WatershedCompute::<br> discreteGaussianFilter(TImageTypePointer inputImage, void *poutputImage)<br>
{<br> typedef itk::DiscreteGaussianImageFilter< TImageType, TImageType > DiscreteGaussianFilterType;<br> DiscreteGaussianFilterType::Pointer discreteGaussianFilter = DiscreteGaussianFilterType::New();<br> discreteGaussianFilter->SetInput( inputImage );<br>
const double gaussianVariance = this->params->Get_discrete_gaussian_variance();<br> const unsigned int maxKernelWidth = this->params->Get_discrete_gaussian_kernel_width();<br> discreteGaussianFilter->SetVariance( gaussianVariance );<br>
discreteGaussianFilter->SetMaximumKernelWidth( maxKernelWidth );<br> discreteGaussianFilter->Update(); // this line<br> TImageTypePointer *Pout = (TImageTypePointer *)poutputImage;<br> *Pout = discreteGaussianFilter->GetOutput();<br>
return;<br>}</span><br><br>And in <span style="font-family:"Courier New"">// this line</span> I have "error"... 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:"Courier New"">template<typename TImageTypePointer, typename TImageType> void WatershedCompute::<br> rescaleIntensityFilter(TImageTypePointer inputImage, void *poutputImage, int min, int max)<br>
{<br> typedef itk::RescaleIntensityImageFilter< TImageType, TImageType > RescaleFilterType;<br> RescaleFilterType::Pointer rescaler = RescaleFilterType::New();<br> rescaler->SetOutputMinimum( min );<br> rescaler->SetOutputMaximum( max );<br>
rescaler->SetInput( inputImage );<br> rescaler->Update();<br> TImageTypePointer *Pout = (TImageTypePointer *)poutputImage;<br> *Pout = rescaler->GetOutput();<br> return;<br>}</span><br><br>When I call only <span style="font-family:"Courier New"">rescaleIntensityFilter</span> and dont call <span style="font-family:"Courier New"">discreteGaussianFilter</span> it is OK. Could someone help me, please? <br>
Thanks a lot :-)</p></div></div></div></div></blockquote></div><br>