[Insight-users] Type problem with ImportImageFilter and GradientAnisotropicDiffusionImageFilter

Nils Hanssen hanssen at caesar.de
Mon Jan 21 04:58:55 EST 2002


Hi,

i am using the itk cvs-version from 2002-01-08.

I was trying to connect itk::ImportImageFilter to
itk::GradientAnisotropicDiffusionImageFilter to pass data from a
vtkstructuredpoints to the itk pipeline. Unfortunately, there seems to be a
type problem with the types...

The declaration of the two filters look like this:

----------------------------
...

	typedef float PixelType;
	const unsigned int IMAGE_DIMENSION = 3;

	typedef itk::Image<PixelType, IMAGE_DIMENSION> ImageType;
	typedef itk::ImportImageFilter<PixelType, IMAGE_DIMENSION>
ImportImageFilterType;

	typedef
itk::GradientAnisotropicDiffusionImageFilter<ImportImageFilterType::OutputIm
ageType, ImageType> GradientAnisotropicFilterType;

	// Member declaration:
	ImportImageFilterType::Pointer		m_pImportFilter;
	GradientAnisotropicFilterType::Pointer	m_pAnisotropicDiffusionFilter;
...
----------------------------

With this code, i get an error in
code\common\itkfinitedifferenceimagefilter.txx(58): Conversion of parameter
1 of class

itk::ImportImageContainer<unsigned long,float> > > >(class
itk::Image<float,3,class itk::DefaultImageTraits<float,3,class
itk::ImportImageContainer<unsigned
 long,float> > > *,const class itk::ImageRegion<3> &)' : Konvertierung des
Parameters 1 von 'class itk::SmartPointer<class itk::Image<float,3,class
itk::DefaultImageTraits<float,3,class itk::ValarrayImageContainer<unsigned
long,float> > > >'

in
class

itk::Image<float,3,class itk::DefaultImageTraits<float,3,class
itk::ImportImageContainer<unsigned long,float> > > * not possible.
(Translated from german error message).


If i try to declare the anisotropic filter as follows, i can't convert the
output from the importimagefilter to the appropriate input of the
anisotropic filter:

---
typedef itk::GradientAnisotropicDiffusionImageFilter<ImageType, ImageType>
GradientAnisotropicFilterType;

GradientAnisotropicFilterType::Pointer	m_pAnisotropicDiffusionFilter;
ImageType::Pointer				m_pAnisotropicImage;

...

m_pAnisotropicImage = m_pAnsisotropicDiffusionFilter->GetOutput();
---

The error message is now:

error C2664: 'SetInput' : Conversion of parameter 1 of

'class itk::SmartPointer<class itk::Image<float,3,class
itk::DefaultImageTraits<float,3,class itk::ImportImageContainer<unsigned
long,float> > > >'

in

'class itk::Image<float,3,class itk::DefaultImageTraits<float,3,class
itk::ValarrayImageContainer<unsigned long,float> > > *' not possible. No
user-defined conversion operator available, that can perform this conversion
or the operator cannot be called.

Any attempts to perform an explicit type conversion via dynamic_cast<...>
failed.



Does anybody have an idea what is going wrong here?

Thanks for any suggestions or ideas!

Regards,
Nils




More information about the Insight-users mailing list