18#ifndef itkGradientImageFilter_h
19#define itkGradientImageFilter_h
31template <
typename TPixelType,
unsigned int VImageDimension>
63template <
typename TInputImage,
64 typename TOperatorValueType = float,
65 typename TOutputValueType = float,
66 typename TOutputImageType =
67 Image<CovariantVector<TOutputValueType, TInputImage::ImageDimension>, TInputImage::ImageDimension>>
75 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
76 static constexpr unsigned int OutputImageDimension = TOutputImageType::ImageDimension;
118 itkSetMacro(UseImageSpacing,
bool);
119 itkGetConstMacro(UseImageSpacing,
bool);
120 itkBooleanMacro(UseImageSpacing);
123#if !defined(ITK_FUTURE_LEGACY_REMOVE)
128 SetUseImageSpacingOn()
130 this->SetUseImageSpacing(
true);
137 SetUseImageSpacingOff()
139 this->SetUseImageSpacing(
false);
147#ifdef ITK_USE_CONCEPT_CHECKING
164 itkSetMacro(UseImageDirection,
bool);
165 itkGetConstMacro(UseImageDirection,
bool);
166 itkBooleanMacro(UseImageDirection);
195 template <
typename TValue>
199 if (this->m_UseImageDirection)
202 it.GetImage()->TransformLocalVectorToPhysicalVector(gradient, physicalGradient);
211 template <
typename T>
216 if (this->m_UseImageDirection)
218 it.
GetImage()->TransformLocalVectorToPhysicalVector(gradient, it.
Value());
222 it.
Value() = gradient;
227 bool m_UseImageSpacing{
true };
231 bool m_UseImageDirection{
true };
234 std::unique_ptr<ImageBoundaryCondition<TInputImage, TInputImage>> m_BoundaryCondition{
235 std::make_unique<ZeroFluxNeumannBoundaryCondition<TInputImage>>()
240#ifndef ITK_MANUAL_INSTANTIATION
241# include "itkGradientImageFilter.hxx"
A templated class holding a n-Dimensional covariant vector.
ValueType * GetDataPointer()
Computes the gradient of an image using directional derivatives.
TOperatorValueType OperatorValueType
TOutputValueType OutputValueType
typename OutputImageType::Pointer OutputImagePointer
void GenerateInputRequestedRegion() override
void OverrideBoundaryCondition(ImageBoundaryCondition< TInputImage > *boundaryCondition)
typename OutputImageType::RegionType OutputImageRegionType
typename OutputImageType::PixelType OutputPixelType
void PrintSelf(std::ostream &os, Indent indent) const override
void SetOutputPixel(ImageRegionIterator< T > &it, CovariantVectorType &gradient)
TOutputImageType OutputImageType
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
void GenerateOutputInformation() override
typename InputImageType::PixelType InputPixelType
TInputImage InputImageType
~GradientImageFilter() override=default
void SetOutputPixel(ImageRegionIterator< VectorImage< TValue, OutputImageDimension > > &it, CovariantVectorType &gradient)
typename InputImageType::Pointer InputImagePointer
A virtual base object that defines an interface to a class of boundary condition objects for use by n...
const ImageType * GetImage() const
A multi-dimensional iterator templated over image type that walks a region of pixels.
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Light weight base class for most itk classes.
Templated n-dimensional vector image class.
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
ImageBaseType::RegionType RegionType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....