Hi everybody, <br><br>I have problem when using itkImageToHistogramFilter. The compilation is ok up to the last line:<br><br><br><br>"const unsigned int Dimension = 3;<br> typedef unsigned char PixelType;<br> typedef itk::Image< PixelType, Dimension > ImageType;<br>
<br> const unsigned int MeasurementVectorSize = 1; // Grayscale<br> const unsigned int binsPerDimension = 160;<br><br>typedef itk::Statistics::ImageToHistogramFilter< ImageType ><br> ImageToHistogramFilterType;<br>
<br> ImageToHistogramFilterType::HistogramType::MeasurementVectorType<br> lowerBound(binsPerDimension);<br> lowerBound.Fill(0);<br><br> ImageToHistogramFilterType::HistogramType::MeasurementVectorType<br> upperBound(binsPerDimension);<br>
upperBound.Fill(40) ;<br><br> ImageToHistogramFilterType::HistogramType::SizeType size(MeasurementVectorSize);<br> size.Fill(binsPerDimension);<br><br> ImageToHistogramFilterType::Pointer imageToHistogramFilter = ImageToHistogramFilterType::New();<br>
imageToHistogramFilter->SetInput( image );<br> imageToHistogramFilter->SetHistogramBinMinimum( lowerBound );<br> imageToHistogramFilter->SetHistogramBinMaximum( upperBound );<br> imageToHistogramFilter->SetHistogramSize( size );<br>
imageToHistogramFilter->Update();<br><br> ImageToHistogramFilterType::HistogramType* histogram = imageToHistogramFilter->GetOutput();"<br><br><br>I have this error message:<br>         error: invalid conversion from ‘const itk::Statistics::Histogram<double, itk::Statistics::DenseFrequencyContainer2>*’ to ‘itk::Statistics::Histogram<double, itk::Statistics::DenseFrequencyContainer2>*’<br clear="all">
<br>Thanks for your help<br><br>-- <br>David<br><br>