[Insight-developers] itkGradientImageFilter class & misc.

Luis Ibanez ibanez@choroid.cs.unc.edu
Fri, 18 May 2001 12:26:35 -0400 (EDT)


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.


The filter:

      itkGradientRecursiveGaussianImageFilter


on the other hand, uses an internal pipeline of the previous
filters to compute the full gradient of the image and store
the result in a image of vectors, I guess this is the filter
that could fit what you need...


----


Maybe a look at the testing file:

  itkGradientRecursiveGaussianFilterTest.cxx

in Testing/Code/BasicFilters, could also help.


Luis




On Sat, 19 May 2001, Damion Shelton wrote:
> Been playing with that filter (actually, just the derivative part) a bit and
> I've hit a snag. The code fragment below produces a large number of compiler
> errors. Changing the image type to unsigned char, rather than
> itk::Scalar<unsigned char> doesn't seem to help. Any suggestions?
>
>   typedef itk::PhysicalImage< itk::Scalar<unsigned char>, 3 > TImageType;
>
>   // A recursive gaussian filter
>   typedef itk::FirstDerivativeRecursiveGaussianImageFilter
>     < TImageType, TImageType, itk::Scalar<unsigned char> > TDerivType ;
>   TDerivType::Pointer dfilter = TDerivType::New();
>
>   dfilter->SetInput(outputImage);
>
>   // Set up the output of the filter
>   TImageType::Pointer outputImage2 = dfilter->GetOutput();
>
>   // Execute the filter
>   dfilter->Update();
>
> -Damion-