[Insight-users] Adaptor with GreenPixelAccessor and VarianceImageFunction

bkrausz bkrausz at web.de
Mon Oct 30 09:00:42 EST 2006


Hi,

I tried to compute the variance in the green channel of an RGB image in a
neighborhood of a pixel. Therefore I used an ImageAdaptor with the
GreenPixelAccessor. Now I tried to compute the variance with the
VarianceImageFunction, but I couldn't compile. Here's my code (I also tried
the BinaryMedianImageFilter, but it didn't compile, either):

const unsigned int Dimension=2;
	typedef itk::RGBPixel <unsigned char>																	PixelType;
	typedef itk::Image <PixelType, Dimension>															ImageType;
	typedef itk::Image<unsigned char,Dimension>														ScalarImageType;
	typedef itk::GreenPixelAccessor <unsigned char>												AccessorType;
	typedef itk::ImageAdaptor <ImageType, AccessorType>										AdaptorType;
	typedef itk::ImageFileReader <ImageType>															ReaderType;
	typedef itk::ImageFileWriter <ScalarImageType>												WriterType;
	typedef itk::VarianceImageFunction<AdaptorType,float>									VarianceType;
	typedef itk::BinaryMedianImageFilter< AdaptorType, ScalarImageType >
FilterType;

	ReaderType::Pointer reader=ReaderType::New();
	WriterType::Pointer writer=WriterType::New();
	AdaptorType::Pointer greenadaptor=AdaptorType::New();
	AccessorType accessor;
	//FilterType::Pointer filter=FilterType::New();
	VarianceType::Pointer variance=VarianceType::New();  

and now the error message:

opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h: In
instantiation of `itk::ConstNeighborhoodIterator<main(int,
char**)::AdaptorType, itk::ZeroFluxNeumannBoundaryCondition<main(int,
char**)::AdaptorType> >':
/opt/InsightToolkit-2.8.1/Code/Common/itkVarianceImageFunction.txx:83:  
instantiated from `typename itk::NumericTraits<typename
TInputImage::PixelType>::RealType itk::VarianceImageFunction<TInputImage,
TCoordRep>::EvaluateAtIndex(typename itk::ImageFunction<TInputImage,
typename itk::NumericTraits<typename TInputImage::PixelType>::RealType,
TCoordRep>::IndexType&) const [with TInputImage = main(int,
char**)::AdaptorType, TCoordRep = float]'
/opt/InsightToolkit-2.8.1/Code/Common/itkImageFunction.h:74:   instantiated
from here
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:90:
error: no
   type named `NeighborhoodAccessorFunctorType' in `class main(int,
   char**)::AdaptorType'
/opt/InsightToolkit-2.8.1/Code/Common/itkImageBoundaryCondition.h: In
instantiation of `itk::ImageBoundaryCondition<main(int,
char**)::AdaptorType>':
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:502:  
instantiated from `itk::ZeroFluxNeumannBoundaryCondition<main(int,
char**)::AdaptorType>'
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:502:  
instantiated from `itk::ConstNeighborhoodIterator<main(int,
char**)::AdaptorType, itk::ZeroFluxNeumannBoundaryCondition<main(int,
char**)::AdaptorType> >'
/opt/InsightToolkit-2.8.1/Code/Common/itkVarianceImageFunction.txx:83:  
instantiated from `typename itk::NumericTraits<typename
TInputImage::PixelType>::RealType itk::VarianceImageFunction<TInputImage,
TCoordRep>::EvaluateAtIndex(typename itk::ImageFunction<TInputImage,
typename itk::NumericTraits<typename TInputImage::PixelType>::RealType,
TCoordRep>::IndexType&) const [with TInputImage = main(int,
char**)::AdaptorType, TCoordRep = float]'
/opt/InsightToolkit-2.8.1/Code/Common/itkImageFunction.h:74:   instantiated
from here
/opt/InsightToolkit-2.8.1/Code/Common/itkImageBoundaryCondition.h:73: error:
no
   type named `NeighborhoodAccessorFunctorType' in `class main(int,
   char**)::AdaptorType'
/opt/InsightToolkit-2.8.1/Code/Common/itkImageBoundaryCondition.h: In
instantiation of `itk::ImageBoundaryCondition<main(int,
char**)::AdaptorType>':
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:502:  
instantiated from `itk::ZeroFluxNeumannBoundaryCondition<main(int,
char**)::AdaptorType>'
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:502:  
instantiated from `itk::ConstNeighborhoodIterator<main(int,
char**)::AdaptorType, itk::ZeroFluxNeumannBoundaryCondition<main(int,
char**)::AdaptorType> >'
/opt/InsightToolkit-2.8.1/Code/Common/itkVarianceImageFunction.txx:83:  
instantiated from `typename itk::NumericTraits<typename
TInputImage::PixelType>::RealType itk::VarianceImageFunction<TInputImage,
TCoordRep>::EvaluateAtIndex(typename itk::ImageFunction<TInputImage,
typename itk::NumericTraits<typename TInputImage::PixelType>::RealType,
TCoordRep>::IndexType&) const [with TInputImage = main(int,
char**)::AdaptorType, TCoordRep = float]'
/opt/InsightToolkit-2.8.1/Code/Common/itkImageFunction.h:74:   instantiated
from here
/opt/InsightToolkit-2.8.1/Code/Common/itkImageBoundaryCondition.h:92: error:
no
   type named `NeighborhoodAccessorFunctorType' in `class main(int,
   char**)::AdaptorType'
/opt/InsightToolkit-2.8.1/Code/Common/itkZeroFluxNeumannBoundaryCondition.h:
In instantiation of `itk::ZeroFluxNeumannBoundaryCondition<main(int,
char**)::AdaptorType>':
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:502:  
instantiated from `itk::ConstNeighborhoodIterator<main(int,
char**)::AdaptorType, itk::ZeroFluxNeumannBoundaryCondition<main(int,
char**)::AdaptorType> >'
/opt/InsightToolkit-2.8.1/Code/Common/itkVarianceImageFunction.txx:83:  
instantiated from `typename itk::NumericTraits<typename
TInputImage::PixelType>::RealType itk::VarianceImageFunction<TInputImage,
TCoordRep>::EvaluateAtIndex(typename itk::ImageFunction<TInputImage,
typename itk::NumericTraits<typename TInputImage::PixelType>::RealType,
TCoordRep>::IndexType&) const [with TInputImage = main(int,
char**)::AdaptorType, TCoordRep = float]'
/opt/InsightToolkit-2.8.1/Code/Common/itkImageFunction.h:74:   instantiated
from here
/opt/InsightToolkit-2.8.1/Code/Common/itkZeroFluxNeumannBoundaryCondition.h:74:
error: no
   type named `NeighborhoodAccessorFunctorType' in `class
   itk::ImageBoundaryCondition<main(int, char**)::AdaptorType>'
/opt/InsightToolkit-2.8.1/Code/Common/itkZeroFluxNeumannBoundaryCondition.txx:
In instantiation of `itk::ZeroFluxNeumannBoundaryCondition<main(int,
char**)::AdaptorType>':
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:502:  
instantiated from `itk::ConstNeighborhoodIterator<main(int,
char**)::AdaptorType, itk::ZeroFluxNeumannBoundaryCondition<main(int,
char**)::AdaptorType> >'
/opt/InsightToolkit-2.8.1/Code/Common/itkVarianceImageFunction.txx:83:  
instantiated from `typename itk::NumericTraits<typename
TInputImage::PixelType>::RealType itk::VarianceImageFunction<TInputImage,
TCoordRep>::EvaluateAtIndex(typename itk::ImageFunction<TInputImage,
typename itk::NumericTraits<typename TInputImage::PixelType>::RealType,
TCoordRep>::IndexType&) const [with TInputImage = main(int,
char**)::AdaptorType, TCoordRep = float]'
/opt/InsightToolkit-2.8.1/Code/Common/itkImageFunction.h:74:   instantiated
from here
/opt/InsightToolkit-2.8.1/Code/Common/itkZeroFluxNeumannBoundaryCondition.txx:67:
error: no
   type named `NeighborhoodAccessorFunctorType' in `class
   itk::ImageBoundaryCondition<main(int, char**)::AdaptorType>'
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h: In
instantiation of `itk::ConstNeighborhoodIterator<main(int,
char**)::AdaptorType, itk::ZeroFluxNeumannBoundaryCondition<main(int,
char**)::AdaptorType> >':
/opt/InsightToolkit-2.8.1/Code/Common/itkVarianceImageFunction.txx:83:  
instantiated from `typename itk::NumericTraits<typename
TInputImage::PixelType>::RealType itk::VarianceImageFunction<TInputImage,
TCoordRep>::EvaluateAtIndex(typename itk::ImageFunction<TInputImage,
typename itk::NumericTraits<typename TInputImage::PixelType>::RealType,
TCoordRep>::IndexType&) const [with TInputImage = main(int,
char**)::AdaptorType, TCoordRep = float]'
/opt/InsightToolkit-2.8.1/Code/Common/itkImageFunction.h:74:   instantiated
from here
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:508:
error: no
   type named `NeighborhoodAccessorFunctorType' in `class main(int,
   char**)::AdaptorType'
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h: In
   constructor `itk::ConstNeighborhoodIterator<TImage,
   TBoundaryCondition>::ConstNeighborhoodIterator(typename
   itk::Neighborhood<typename TImage::InternalPixelType*,
   itk::ConstNeighborhoodIterator<TImage, TBoundaryCondition>::Dimension,
   itk::NeighborhoodAllocator<typename TImageType::InternalPixelType*>
   >::SizeType&, const TImage*, typename TImage::RegionType&) [with TImage =
   main(int, char**)::AdaptorType, TBoundaryCondition =
   itk::ZeroFluxNeumannBoundaryCondition<main(int, char**)::AdaptorType>]':
/opt/InsightToolkit-2.8.1/Code/Common/itkVarianceImageFunction.txx:83:  
instantiated from `typename itk::NumericTraits<typename
TInputImage::PixelType>::RealType itk::VarianceImageFunction<TInputImage,
TCoordRep>::EvaluateAtIndex(typename itk::ImageFunction<TInputImage,
typename itk::NumericTraits<typename TInputImage::PixelType>::RealType,
TCoordRep>::IndexType&) const [with TInputImage = main(int,
char**)::AdaptorType, TCoordRep = float]'
/opt/InsightToolkit-2.8.1/Code/Common/itkImageFunction.h:74:   instantiated
from here
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:119:
error: `
   GetNeighborhoodAccessor' undeclared (first use this function)
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:119:
error: (Each
   undeclared identifier is reported only once for each function it appears
   in.)
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:119:
error: '
   class itk::ConstNeighborhoodIterator<main(int, char**)::AdaptorType,
   itk::ZeroFluxNeumannBoundaryCondition<main(int, char**)::AdaptorType> >'
has
   no member named 'm_NeighborhoodAccessorFunctor'
/opt/InsightToolkit-2.8.1/Code/Common/itkVarianceImageFunction.txx:83:  
instantiated from `typename itk::NumericTraits<typename
TInputImage::PixelType>::RealType itk::VarianceImageFunction<TInputImage,
TCoordRep>::EvaluateAtIndex(typename itk::ImageFunction<TInputImage,
typename itk::NumericTraits<typename TInputImage::PixelType>::RealType,
TCoordRep>::IndexType&) const [with TInputImage = main(int,
char**)::AdaptorType, TCoordRep = float]'
/opt/InsightToolkit-2.8.1/Code/Common/itkImageFunction.h:74:   instantiated
from here
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:120:
error: '
   class itk::ConstNeighborhoodIterator<main(int, char**)::AdaptorType,
   itk::ZeroFluxNeumannBoundaryCondition<main(int, char**)::AdaptorType> >'
has
   no member named 'm_NeighborhoodAccessorFunctor'
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h: In
member
   function `typename TImage::PixelType
itk::ConstNeighborhoodIterator<TImage,
   TBoundaryCondition>::GetPixel(unsigned int) const [with TImage =
main(int,
   char**)::AdaptorType, TBoundaryCondition =
   itk::ZeroFluxNeumannBoundaryCondition<main(int, char**)::AdaptorType>]':
/opt/InsightToolkit-2.8.1/Code/Common/itkVarianceImageFunction.txx:92:  
instantiated from `typename itk::NumericTraits<typename
TInputImage::PixelType>::RealType itk::VarianceImageFunction<TInputImage,
TCoordRep>::EvaluateAtIndex(typename itk::ImageFunction<TInputImage,
typename itk::NumericTraits<typename TInputImage::PixelType>::RealType,
TCoordRep>::IndexType&) const [with TInputImage = main(int,
char**)::AdaptorType, TCoordRep = float]'
/opt/InsightToolkit-2.8.1/Code/Common/itkImageFunction.h:74:   instantiated
from here
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:169:
error: '
   const class itk::ConstNeighborhoodIterator<main(int,
char**)::AdaptorType,
   itk::ZeroFluxNeumannBoundaryCondition<main(int, char**)::AdaptorType> >'
has
   no member named 'm_NeighborhoodAccessorFunctor'
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.txx: In
   member function `typename TImage::PixelType
   itk::ConstNeighborhoodIterator<TImage,
   TBoundaryCondition>::GetPixel(unsigned int, bool&) const [with TImage =
   main(int, char**)::AdaptorType, TBoundaryCondition =
   itk::ZeroFluxNeumannBoundaryCondition<main(int, char**)::AdaptorType>]':
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:172:  
instantiated from `typename TImage::PixelType
itk::ConstNeighborhoodIterator<TImage,
TBoundaryCondition>::GetPixel(unsigned int) const [with TImage = main(int,
char**)::AdaptorType, TBoundaryCondition =
itk::ZeroFluxNeumannBoundaryCondition<main(int, char**)::AdaptorType>]'
/opt/InsightToolkit-2.8.1/Code/Common/itkVarianceImageFunction.txx:92:  
instantiated from `typename itk::NumericTraits<typename
TInputImage::PixelType>::RealType itk::VarianceImageFunction<TInputImage,
TCoordRep>::EvaluateAtIndex(typename itk::ImageFunction<TInputImage,
typename itk::NumericTraits<typename TInputImage::PixelType>::RealType,
TCoordRep>::IndexType&) const [with TInputImage = main(int,
char**)::AdaptorType, TCoordRep = float]'
/opt/InsightToolkit-2.8.1/Code/Common/itkImageFunction.h:74:   instantiated
from here
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.txx:61:
error: '
   const class itk::ConstNeighborhoodIterator<main(int,
char**)::AdaptorType,
   itk::ZeroFluxNeumannBoundaryCondition<main(int, char**)::AdaptorType> >'
has
   no member named 'm_NeighborhoodAccessorFunctor'
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:172:  
instantiated from `typename TImage::PixelType
itk::ConstNeighborhoodIterator<TImage,
TBoundaryCondition>::GetPixel(unsigned int) const [with TImage = main(int,
char**)::AdaptorType, TBoundaryCondition =
itk::ZeroFluxNeumannBoundaryCondition<main(int, char**)::AdaptorType>]'
/opt/InsightToolkit-2.8.1/Code/Common/itkVarianceImageFunction.txx:92:  
instantiated from `typename itk::NumericTraits<typename
TInputImage::PixelType>::RealType itk::VarianceImageFunction<TInputImage,
TCoordRep>::EvaluateAtIndex(typename itk::ImageFunction<TInputImage,
typename itk::NumericTraits<typename TInputImage::PixelType>::RealType,
TCoordRep>::IndexType&) const [with TInputImage = main(int,
char**)::AdaptorType, TCoordRep = float]'
/opt/InsightToolkit-2.8.1/Code/Common/itkImageFunction.h:74:   instantiated
from here
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.txx:73:
error: '
   const class itk::ConstNeighborhoodIterator<main(int,
char**)::AdaptorType,
   itk::ZeroFluxNeumannBoundaryCondition<main(int, char**)::AdaptorType> >'
has
   no member named 'm_NeighborhoodAccessorFunctor'
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.h:172:  
instantiated from `typename TImage::PixelType
itk::ConstNeighborhoodIterator<TImage,
TBoundaryCondition>::GetPixel(unsigned int) const [with TImage = main(int,
char**)::AdaptorType, TBoundaryCondition =
itk::ZeroFluxNeumannBoundaryCondition<main(int, char**)::AdaptorType>]'
/opt/InsightToolkit-2.8.1/Code/Common/itkVarianceImageFunction.txx:92:  
instantiated from `typename itk::NumericTraits<typename
TInputImage::PixelType>::RealType itk::VarianceImageFunction<TInputImage,
TCoordRep>::EvaluateAtIndex(typename itk::ImageFunction<TInputImage,
typename itk::NumericTraits<typename TInputImage::PixelType>::RealType,
TCoordRep>::IndexType&) const [with TInputImage = main(int,
char**)::AdaptorType, TCoordRep = float]'
/opt/InsightToolkit-2.8.1/Code/Common/itkImageFunction.h:74:   instantiated
from here
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.txx:114:
error: '
   const class itk::ConstNeighborhoodIterator<main(int,
char**)::AdaptorType,
   itk::ZeroFluxNeumannBoundaryCondition<main(int, char**)::AdaptorType> >'
has
   no member named 'm_NeighborhoodAccessorFunctor'
/opt/InsightToolkit-2.8.1/Code/Common/itkConstNeighborhoodIterator.txx:119:
error: '
   const class itk::ConstNeighborhoodIterator<main(int,
char**)::AdaptorType,
   itk::ZeroFluxNeumannBoundaryCondition<main(int, char**)::AdaptorType> >'
has
   no member named 'm_NeighborhoodAccessorFunctor'
make[2]: *** [CMakeFiles/VotingTest.dir/VotingTest.o] Fehler 1
make[1]: *** [CMakeFiles/VotingTest.dir/all] Fehler 2
make: *** [all] Fehler 2
-- 
View this message in context: http://www.nabble.com/Adaptor-with-GreenPixelAccessor-and-VarianceImageFunction-tf2539504.html#a7074843
Sent from the ITK - Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list