12 #ifndef __itkStructureTensorImageFilter_hxx 13 #define __itkStructureTensorImageFilter_hxx 17 #include "itkUnaryFunctorImageFilter.h" 23 template<
class TInputImage,
class TOutputImage >
24 StructureTensorImageFilter < TInputImage, TOutputImage >
30 template<
class TInputImage,
class TOutputImage >
31 typename LightObject::Pointer
35 typename LightObject::Pointer loPtr = Superclass::InternalClone();
40 itkExceptionMacro(<<
"downcast to type " << this->
GetNameOfClass()<<
" failed.");
46 template<
class TInputImage,
class TOutputImage >
51 typename TInputImage::ConstPointer inputPtr = this->GetInput();
52 typename GradientFilterType::Pointer gradientFilter = GradientFilterType::New();
57 FunctorType timeFunctor;
58 typedef UnaryFunctorImageFilter<TInputImage, TInputImage, FunctorType> ScaleFilterType;
59 typename ScaleFilterType::Pointer scaleFilter = ScaleFilterType::New();
61 scaleFilter->SetFunctor(timeFunctor);
62 scaleFilter->SetInput(inputPtr);
63 scaleFilter->Update();
64 gradientFilter->SetInput(scaleFilter->GetOutput());
67 gradientFilter->SetInput(inputPtr);
69 gradientFilter->Update();
71 typename TOutputImage::Pointer gradient = gradientFilter->GetOutput();
74 typename OuterProductFilterType::Pointer outproductFilter = OuterProductFilterType::New();
75 outproductFilter->SetInput(gradient);
76 outproductFilter->Update();
78 typename TOutputImage::Pointer out = outproductFilter->GetOutput();
79 this->GraftOutput(out);
Computes the structure tensor.
virtual void GenerateData() ITK_OVERRIDE
LightObject::Pointer InternalClone() const ITK_OVERRIDE
SmartPointer< Self > Pointer
In each vxoel, multiply the input vector by a matrix.
ImageToImageFilter< TInputImage, TOutputImage > Superclass
virtual const char * GetNameOfClass() const
Run-time type information (and related methods).