18 #ifndef itkGradientImageFilter_h
19 #define itkGradientImageFilter_h
29 template <
typename TPixelType,
unsigned int VImageDimension >
class VectorImage;
54 template<
typename TInputImage,
55 typename TOperatorValueType = float,
56 typename TOutputValueType = float,
57 typename TOutputImageType = Image< CovariantVector< TOutputValueType,
58 TInputImage::ImageDimension >,
59 TInputImage::ImageDimension > >
65 itkStaticConstMacro(InputImageDimension,
unsigned int,
66 TInputImage::ImageDimension);
67 itkStaticConstMacro(OutputImageDimension,
unsigned int,
68 TOutputImageType::ImageDimension);
105 virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
109 void SetUseImageSpacingOn()
110 { this->SetUseImageSpacing(
true); }
115 { this->SetUseImageSpacing(
false); }
119 itkSetMacro(UseImageSpacing,
bool);
120 itkGetConstMacro(UseImageSpacing,
bool);
121 itkBooleanMacro(UseImageSpacing);
126 #ifdef ITK_USE_CONCEPT_CHECKING
145 itkSetMacro(UseImageDirection,
bool);
146 itkGetConstMacro(UseImageDirection,
bool);
147 itkBooleanMacro(UseImageDirection);
153 void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
165 void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
171 virtual
void GenerateOutputInformation() ITK_OVERRIDE;
175 template <typename TValue>
178 if ( this->m_UseImageDirection )
181 it.GetImage()->TransformLocalVectorToPhysicalVector( gradient, physicalGradient );
186 it.Set(
OutputPixelType( gradient.GetDataPointer(), InputImageDimension, false ) );
190 template <
typename T >
194 if ( this->m_UseImageDirection )
196 it.
GetImage()->TransformLocalVectorToPhysicalVector( gradient, it.
Value() );
200 it.
Value() = gradient;
216 #ifndef ITK_MANUAL_INSTANTIATION
217 #include "itkGradientImageFilter.hxx"
ImageBoundaryCondition< TInputImage, TInputImage > * m_BoundaryCondition
Light weight base class for most itk classes.
InputImageType::Pointer InputImagePointer
TOperatorValueType OperatorValueType
InputImageType::PixelType InputPixelType
Templated n-dimensional vector image class.
TOutputImageType OutputImageType
TInputImage InputImageType
OutputImageType::RegionType OutputImageRegionType
OutputImageType::Pointer OutputImagePointer
SmartPointer< const Self > ConstPointer
void SetOutputPixel(ImageRegionIterator< T > &it, CovariantVectorType &gradient)
CovariantVector< OutputValueType, itkGetStaticConstMacro(OutputImageDimension) > CovariantVectorType
void SetUseImageSpacingOff()
SmartPointer< Self > Pointer
unsigned int ThreadIdType
A virtual base object that defines an interface to a class of boundary condition objects for use by n...
OutputImageType::PixelType OutputPixelType
ImageToImageFilter< InputImageType, OutputImageType > Superclass
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
TOutputValueType OutputValueType
ValueType * GetDataPointer()
#define itkConceptMacro(name, concept)
A templated class holding a n-Dimensional covariant vector.
A multi-dimensional iterator templated over image type that walks a region of pixels.
const ImageType * GetImage() const
Computes the gradient of an image using directional derivatives.