41#include <vxl_version.h>
42#include "vnl/vnl_matrix_fixed.hxx"
113template <
unsigned int VImageDimension = 2>
178 static constexpr unsigned int
181 return VImageDimension;
464 template <
typename TCoordinate>
471 for (
unsigned int i = 0; i < VImageDimension; ++i)
474 for (
unsigned int j = 0; j < VImageDimension; ++j)
491 template <
typename TCoordinate>
492 ITK_NODISCARD(
"Call the overload which has the point as the only parameter and returns the index")
517 template <
typename TIndexRep,
typename TCoordinate>
524 for (
unsigned int k = 0; k < VImageDimension; ++k)
529 for (
unsigned int i = 0; i < VImageDimension; ++i)
531 index[i] =
static_cast<TIndexRep
>(cvector[i]);
544 template <
typename TCoordinate,
typename TIndexRep>
545 ITK_NODISCARD(
"Call the overload which has the point as the only parameter and returns the index")
560 template <
typename TCoordinate,
typename TIndexRep>
565 for (
unsigned int r = 0; r < VImageDimension; ++r)
568 for (
unsigned int c = 0; c < VImageDimension; ++c)
581 template <
typename TCoordinate,
typename TIndexRep>
596 template <
typename TCoordinate>
600 for (
unsigned int i = 0; i < VImageDimension; ++i)
603 for (
unsigned int j = 0; j < VImageDimension; ++j)
616 template <
typename TCoordinate>
640 template <
typename TCoordinate>
649 for (
unsigned int i = 0; i < VImageDimension; ++i)
653 for (
unsigned int j = 0; j < VImageDimension; ++j)
655 sum += direction[i][j] * inputGradient[j];
657 outputGradient[i] =
static_cast<TCoordinate
>(sum);
667 template <
typename TVector>
668 [[nodiscard]] TVector
671 TVector outputGradient;
673 return outputGradient;
690 template <
typename TCoordinate>
699 for (
unsigned int i = 0; i < VImageDimension; ++i)
703 for (
unsigned int j = 0; j < VImageDimension; ++j)
705 sum += inverseDirection[i][j] * inputGradient[j];
707 outputGradient[i] =
static_cast<TCoordinate
>(sum);
717 template <
typename TVector>
718 [[nodiscard]] TVector
721 TVector outputGradient;
723 return outputGradient;
940#ifndef ITK_MANUAL_INSTANTIATION
941# include "itkImageBase.hxx"
A templated class holding a point in n-Dimensional image space.
Simulate a standard C array with copy semantics.
ValueType * GetDataPointer()
void TransformPhysicalVectorToLocalVector(const FixedArray< TCoordinate, VImageDimension > &inputGradient, FixedArray< TCoordinate, VImageDimension > &outputGradient) const
IndexType FastComputeIndex(OffsetValueType offset) const
Vector< SpacingValueType, VImageDimension > SpacingType
virtual void SetRequestedRegion(const RegionType ®ion)
IndexType ComputeIndex(OffsetValueType offset) const
virtual void InitializeBufferedRegion()
void SetRequestedRegionToLargestPossibleRegion() override
ImageRegion< VImageDimension > RegionType
ContinuousIndex< TIndexRep, VImageDimension > TransformPhysicalPointToContinuousIndex(const Point< TCoordinate, VImageDimension > &point) const
Returns the continuous index from a physical point.
bool VerifyRequestedRegion() override
SpacePrecisionType SpacingValueType
TVector TransformPhysicalVectorToLocalVector(const TVector &inputGradient) const
IndexType TransformPhysicalPointToIndex(const Point< TCoordinate, VImageDimension > &point) const
virtual void SetDirection(const DirectionType &direction)
bool IsSameImageGeometryAs(const ImageBase *otherImage, double coordinateTolerance=DefaultImageCoordinateTolerance, double directionTolerance=DefaultImageDirectionTolerance) const
virtual const DirectionType & GetDirection() const
void AllocateInitialized()
unsigned int ImageDimensionType
void PrintSelf(std::ostream &os, Indent indent) const override
virtual const RegionType & GetBufferedRegion() const
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
virtual void SetRegions(const SizeType &size)
virtual void SetBufferedRegion(const RegionType ®ion)
DirectionType m_IndexToPhysicalPoint
Index< VImageDimension > IndexType
Offset< VImageDimension > OffsetType
virtual void SetSpacing(const SpacingType &spacing)
void UpdateOutputData() override
DirectionType m_Direction
DirectionType m_PhysicalPointToIndex
virtual void SetNumberOfComponentsPerPixel(unsigned int)
RegionType m_RequestedRegion
OffsetValueType m_OffsetTable[VImageDimension+1]
OffsetValueType FastComputeOffset(const IndexType &ind) const
virtual void Allocate(bool initialize=false)
TVector TransformLocalVectorToPhysicalVector(const TVector &inputGradient) const
virtual void SetOrigin(const float origin[VImageDimension])
typename OffsetType::OffsetValueType OffsetValueType
typename IndexType::IndexValueType IndexValueType
void UpdateOutputInformation() override
virtual void Graft(const Self *image)
void TransformContinuousIndexToPhysicalPoint(const ContinuousIndex< TIndexRep, VImageDimension > &index, Point< TCoordinate, VImageDimension > &point) const
SmartPointer< const Self > ConstPointer
virtual unsigned int GetNumberOfComponentsPerPixel() const
virtual void SetSpacing(const float spacing[VImageDimension])
const OffsetValueType * GetOffsetTable() const
virtual const RegionType & GetRequestedRegion() const
virtual void ComputeIndexToPhysicalPointMatrices()
void SetRequestedRegion(const DataObject *data) override
static constexpr ImageDimensionType ImageDimension
SmartPointer< Self > Pointer
OffsetValueType ComputeOffset(const IndexType &ind) const
virtual void SetRegions(const RegionType ®ion)
Matrix< SpacePrecisionType, VImageDimension, VImageDimension > DirectionType
SpacePrecisionType PointValueType
void CopyInformation(const DataObject *data) override
void TransformIndexToPhysicalPoint(const IndexType &index, Point< TCoordinate, VImageDimension > &point) const
virtual void SetOrigin(const double origin[VImageDimension])
Size< VImageDimension > SizeType
RegionType m_BufferedRegion
virtual void SetSpacing(const double spacing[VImageDimension])
Point< PointValueType, VImageDimension > PointType
Point< TCoordinate, VImageDimension > TransformContinuousIndexToPhysicalPoint(const ContinuousIndex< TIndexRep, VImageDimension > &index) const
virtual void SetLargestPossibleRegion(const RegionType ®ion)
virtual const RegionType & GetLargestPossibleRegion() const
Point< TCoordinate, VImageDimension > TransformIndexToPhysicalPoint(const IndexType &index) const
RegionType m_LargestPossibleRegion
void ComputeOffsetTable()
DirectionType m_InverseDirection
virtual const DirectionType & GetInverseDirection() const
~ImageBase() override=default
void Initialize() override
bool IsCongruentImageGeometry(const ImageBase *otherImage, double coordinateTolerance, double directionTolerance) const
typename SizeType::SizeValueType SizeValueType
void TransformLocalVectorToPhysicalVector(const FixedArray< TCoordinate, VImageDimension > &inputGradient, FixedArray< TCoordinate, VImageDimension > &outputGradient) const
void Graft(const DataObject *data) override
static constexpr unsigned int GetImageDimension()
static void ComputeIndex(const IndexType &bufferedRegionIndex, OffsetValueType offset, const OffsetValueType offsetTable[], IndexType &index)
static void ComputeOffset(const IndexType &bufferedRegionIndex, const IndexType &index, const OffsetValueType offsetTable[], OffsetValueType &offset)
An image region represents a structured region of data.
void SetSize(const SizeType &size)
Vector< SpacingValueType, VImageDimension > SpacingType
Index< VImageDimension > IndexType
Control indentation during Print() invocation.
A templated class holding a M x N size Matrix.
static Self GetIdentity()
A templated class holding a geometric point in n-Dimensional space.
Implements transparent reference counting.
Point< PointValueType, VImageDimension > PointType
typename OffsetType::OffsetValueType OffsetValueType
A templated class holding a n-Dimensional vector.
TInput RoundHalfIntegerUp(TInput x) template< typename TReturn
Round towards nearest integer (This is a synonym for RoundHalfIntegerUp)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
constexpr TContainer MakeFilled(typename TContainer::const_reference value)
constexpr double DefaultImageDirectionTolerance
constexpr double DefaultImageCoordinateTolerance
*par Constraints *The filter image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
double SpacePrecisionType
Represent a n-dimensional index in a n-dimensional image.
itk::IndexValueType IndexValueType
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
itk::OffsetValueType OffsetValueType
Represent a n-dimensional size (bounds) of a n-dimensional image.
itk::SizeValueType SizeValueType