[Insight-users] Type problem with ImportImageFilter and GradientAnisotropicDiffusionImageFilter

Bill Lorensen wlorens1 at nycap.rr.com
Mon Jan 21 08:55:34 EST 2002


Looks like a typo in FiniteDifferenceImageFilter::CopyInputToOutput.

Change the declaration of the second ImageIterator to:
ImageRegionIterator<TOutputImage> out ...

We'll update the repository and thanks for the bug report,

Bill

At 10:58 AM 1/21/02 +0100, Nils Hanssen wrote:
>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
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at public.kitware.com
>http://public.kitware.com/mailman/listinfo/insight-users 





More information about the Insight-users mailing list