Hi Guys,<br><br>I am trying to use the itk class LabelStatisticsImageFilter but I have the following problem and doubt?<br><br>The label image I am getting from one of my own designed classes is const. Now I would like to use it as an input to the <br>
<br>itk class LabelStatisticsImageFilter and I am getting the following error.<br><br>/home/ferrari/Workspace/MIP_PROJECTS/trunk/segmentation/gmm/TGMM_RelabelStrategy_MeanValue.txx:17: error: invalid conversion from ‘const itk::Image&lt;unsigned char, 3u&gt;*’ to ‘itk::Image&lt;unsigned char, 3u&gt;*’<br>
<br><br>which I can easily understand. <br><br>Now, taking a look on the SetLabelInput function in the <br>itk class LabelStatisticsImageFilter I´ve notice that the input image is converted to a const. <br><br><br>00228   <br>
00230   void SetLabelInput(TLabelImage *input)<br>00231     {<br>00232       // Process object is not const-correct so the const casting is required.<br>00233       this-&gt;SetNthInput(1, const_cast&lt;TLabelImage *&gt;(input) );<br>
00234     }<br><br><br>So, my question is, what is the reason for doing that. What´s the problem in change the function to<br><br>void SetLabelInput( const TLabelImage *input) ????????<br><br><br>I really appreciate any help on this.<br>
<br>Thank you <br><br>Ricardo<br><br>