<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE-AT link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi ,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>itkCastImageFilter convert imagedata types.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I also saw in your code that you did not setmaximumerror(). Please read the itk manual about discretegaussianimagefilter, and the itk doxygen html.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>All the best,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Kana <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> G G [mailto:greenlander1986@gmail.com] <br><b>Sent:</b> 01 April 2011 15:43<br><b>To:</b> Arunachalam Kana<br><b>Cc:</b> insight-users@itk.org<br><b>Subject:</b> Re: [Insight-users] DiscreteGaussianImageFilter in function<o:p></o:p></span></p></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'>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<o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>2011/4/1 Arunachalam Kana &lt;<a href="mailto:Kana.Arunachalam@fh-wels.at">Kana.Arunachalam@fh-wels.at</a>&gt;<o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>Hi,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-GB style='font-size:11.0pt;color:#1F497D'>Writing the error message will give a better idea for us about what you are facing. </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-GB style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-GB style='font-size:11.0pt;color:#1F497D'>Anyways from what i know, the outputimagetype for discretegaussian is a float image.&nbsp; So in your definition</span><o:p></o:p></p><div><p class=MsoNormal><span lang=EN-GB style='font-family:"Courier New"'>typedef itk::DiscreteGaussianImageFilter&lt; TImageType, TImageType &gt; DiscreteGaussianFilterType;</span><o:p></o:p></p></div><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;color:#1F497D'>TImageType should be of float type. So your input image should be a float too. &nbsp;If this is true then i don&#8217;t know the bug.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-GB style='font-size:11.0pt;color:#1F497D'>If your input image is not float then you should change the definition as </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-GB style='font-family:"Courier New"'>typedef itk::DiscreteGaussianImageFilter&lt; TImageType, TOutputImageType &gt; DiscreteGaussianFilterType;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-GB style='font-family:"Courier New"'>TOutputImageType should be a float image.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-GB style='font-family:"Courier New"'>&nbsp;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-GB style='font-size:11.0pt;color:#1F497D'>This is the only thought sparked in my mind. Please check for this.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-GB style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-GB style='font-size:11.0pt;color:#1F497D'>All the best</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-GB style='font-size:11.0pt;color:#1F497D'>Regards,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'><span lang=EN-GB style='font-size:11.0pt;color:#1F497D'>Kana </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-GB style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span lang=EN-US style='font-size:10.0pt'>From:</span></b><span lang=EN-US style='font-size:10.0pt'> <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><o:p></o:p></p></div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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&lt;typename TImageTypePointer, typename TImageType&gt; void WatershedCompute::<br>&nbsp;&nbsp;&nbsp; discreteGaussianFilter(TImageTypePointer inputImage, void *poutputImage)<br>{<br>&nbsp;&nbsp;&nbsp; typedef itk::DiscreteGaussianImageFilter&lt; TImageType, TImageType &gt; DiscreteGaussianFilterType;<br>&nbsp;&nbsp;&nbsp; DiscreteGaussianFilterType::Pointer discreteGaussianFilter = DiscreteGaussianFilterType::New();<br>&nbsp;&nbsp;&nbsp; discreteGaussianFilter-&gt;SetInput( inputImage );<br>&nbsp;&nbsp;&nbsp; const double gaussianVariance = this-&gt;params-&gt;Get_discrete_gaussian_variance();<br>&nbsp;&nbsp;&nbsp; const unsigned int maxKernelWidth = this-&gt;params-&gt;Get_discrete_gaussian_kernel_width();<br>&nbsp;&nbsp;&nbsp; discreteGaussianFilter-&gt;SetVariance( gaussianVariance );<br>&nbsp;&nbsp;&nbsp; discreteGaussianFilter-&gt;SetMaximumKernelWidth( maxKernelWidth );<br>&nbsp;&nbsp;&nbsp; discreteGaussianFilter-&gt;Update(); // this line<br>&nbsp;&nbsp;&nbsp; TImageTypePointer *Pout = (TImageTypePointer *)poutputImage;<br>&nbsp;&nbsp;&nbsp; *Pout = discreteGaussianFilter-&gt;GetOutput();<br>&nbsp;&nbsp;&nbsp; return;<br>}</span><br><br>And in <span style='font-family:"Courier New"'>// 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:"Courier New"'>template&lt;typename TImageTypePointer, typename TImageType&gt; void WatershedCompute::<br>&nbsp;&nbsp;&nbsp; rescaleIntensityFilter(TImageTypePointer inputImage, void *poutputImage, int min, int max)<br>{<br>&nbsp;&nbsp;&nbsp; typedef itk::RescaleIntensityImageFilter&lt; TImageType, TImageType &gt; RescaleFilterType;<br>&nbsp;&nbsp;&nbsp; RescaleFilterType::Pointer rescaler = RescaleFilterType::New();<br>&nbsp;&nbsp;&nbsp; rescaler-&gt;SetOutputMinimum( min );<br>&nbsp;&nbsp;&nbsp; rescaler-&gt;SetOutputMaximum( max );<br>&nbsp;&nbsp;&nbsp; rescaler-&gt;SetInput( inputImage );<br>&nbsp;&nbsp;&nbsp; rescaler-&gt;Update();<br>&nbsp;&nbsp;&nbsp; TImageTypePointer *Pout = (TImageTypePointer *)poutputImage;<br>&nbsp;&nbsp;&nbsp; *Pout = rescaler-&gt;GetOutput();<br>&nbsp;&nbsp;&nbsp; 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 :-)<o:p></o:p></p></div></div></div></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>