[Insight-users] Problem with itk::HistogramMatchingImageFilter

Dario Kassler majin_clodan at t-online.de
Sun Oct 30 06:19:23 EDT 2011


Hello,

i hope i ask the question in the right position. I didn't found any place in which I can create a new thread in the mailing list.

Well I want to get the min, max and mean grayscale value from a picture. I need the values for the canny algorithm. I want to compute the the thresholds in a automatic way and for this I need these values. My Code for the computation of the min, max and mean grayscale of the picture looks like the following:

int thresholdLower = 0;
int thresholdUpper = 0;
int thresholdMean = 0;
	
const unsigned int DimensionHist = 2;
typedef unsigned short PixelType;
typedef itk::Image< PixelType, Dimension >  MovingImageType;
typedef itk::ImageFileReader< MovingImageType > MovingImageReaderType;
MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New();
typedef float InternalPixelType;
typedef itk::Image< InternalPixelType, DimensionHist > InternalImageType;
	
typedef itk::HistogramMatchingImageFilter< InternalImageType, InternalImageType >   
		MatchingFilterType;
	
// this class has the method ComputeMinMaxMean
MatchingFilterType::Pointer matcher = MatchingFilterType::New();
	
typedef itk::ImageFileReader< MovingImageType > MovingImageReaderType;
movingImageReader->SetFileName( inputPicture);
	
typedef itk::CastImageFilter< MovingImageType, InternalImageType > 		
	MovingImageCasterType;
MovingImageCasterType::Pointer movingImageCaster = MovingImageCasterType::New();
movingImageCaster->SetInput( movingImageReader->GetOutput() );
	
matcher->ComputeMinMaxMean(movingImageCaster->GetOutput(), thresholdLower, thresholdUpper, thresholdMean);




The "inputPicture" is the path to my picture.
I get the following error:
/Users/System/HiwiJob/Ticket 502/ITK/ITKSeg.cpp: In member function ‘int ITKSeg::Canny(const char*, float, char*, char*)’:
/Users/System/HiwiJob/Ticket 502/ITK/ITKSeg.cpp:220: error: no matching function for call to ‘itk::HistogramMatchingImageFilter<itk::Image<float, 2u>, itk::Image<float, 2u>, float>::ComputeMinMaxMean(itk::Image<float, 2u>*, int&, int&, int&)’
/usr/local/include/InsightToolkit/Algorithms/itkHistogramMatchingImageFilter.txx:386: note: candidates are: void itk::HistogramMatchingImageFilter<TInputImage, TOutputImage, THistogramMeasurement>::ComputeMinMaxMean(const typename itk::ImageToImageFilter<TInputImage, TOutputImage>::InputImageType*, THistogramMeasurement&, THistogramMeasurement&, THistogramMeasurement&) [with TInputImage = itk::Image<float, 2u>, TOutputImage = itk::Image<float, 2u>, THistogramMeasurement = float]


Well what can I do to serve this problem? Can anyone give me a example or so? :'( 
I will be very cool and I will be very thankful if you help me. :)


Greeting, Clodan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111030/d7ffdcbb/attachment.html>


More information about the Insight-users mailing list