[Insight-developers] itkGradientImageFilter class & misc.

Damion Shelton dmsst59+@pitt.edu
Sat, 19 May 2001 14:44:57 -0400


Luis, I just tried:

  // First derivative filter test

  // The type of the output image
  typedef itk::PhysicalImage<double,3> TOutputType;

  // The following line is for reference purposes
  // typedef itk::PhysicalImage< itk::Scalar<double>, 3 > TImageType;

  // Create the derivative filter
  typedef itk::FirstDerivativeRecursiveGaussianImageFilter
    < TImageType, TOutputType, double > TDerivType;

  TDerivType::Pointer dfilter = TDerivType::New();

  // Set filter parameters
  dfilter->SetInput(outputImage);
  dfilter->SetDirection(0);
  dfilter->SetSigma(1.0);

  // Execute the filter
  dfilter->Update();
  TOutputType::Pointer outputImage2 = dfilter->GetOutput();

Unfortuntaely, this doesn't work either. The compiler produces the error:

e:\damion\insight\code\basicfilters\itkrecursiveseparableimagefilter.txx(294
) : error C2593: 'operator =' is ambiguous
        c:\program files\microsoft visual studio\vc98\include\xstring(583) :
while compiling class-template member function 'void __thiscall
itk::RecursiveSeparableImageFilter<class itk::PhysicalImage<class
itk::Scalar<double>,3,class itk::DefaultIm
ageTraits<class itk::Scalar<double>,3,class
itk::ValarrayImageContainer<unsigned long,class itk::Scalar<double> > >
>,class itk::PhysicalImage<double,3,class
itk::DefaultImageTraits<double,3,class itk::ValarrayImageContainer<unsigned
long,double> >
>,double>::GenerateData(void)'

This seems to be an internal problem in
itkrecursiveseparableimagefilter.txx, relating to the way types are handled.
Any thoughts?

-Damion-

> It seems that the problem is with the third template argument
> of the filter.
>
> This is supposed to define if you want to perform the gaussian
> computations with types like "float" or "double".  It doesn't
> expects a Scalar Traits at all.
>
> Try with something like:
>
> typedef
> itk::GradientRecursiveGaussianImageFilter<
>                                  ImageType,
>                                  ImageType,
>                                  double      > FilterType;
>
> -----
>
> Also note that there is a set of Recursive Gaussian filters,
>
> Some of them will apply the conversion *only* in one dimension,
> (you select which one with the method SetDirection() ).
>
> This happens for:
>
>  - itkRecursiveGaussianImageFilter
>  - itkFirstDerivativeRecursiveGaussianImageFilter
>  - itkSecondDerivativeRecursiveGaussianImageFilter
>
> All of them will give as output a scalar image containing the
> result of applying the gaussian (or first/second deriv) along
> one direction.