28 #ifndef itkImageBase_h
29 #define itkImageBase_h
43 #include "vnl/vnl_matrix_fixed.txx"
51 template<
unsigned int NImageDimension,
unsigned int R,
unsigned int C,
typename TPo
intValue,
typename TMatrixValue >
111 template<
unsigned int VImageDimension = 2 >
174 {
return VImageDimension; }
181 virtual void SetOrigin(
const double origin[VImageDimension]);
182 virtual void SetOrigin(
const float origin[VImageDimension]);
232 itkGetConstReferenceMacro(Origin,
PointType);
241 virtual void Allocate(
bool initialize=
false);
407 virtual void SetSpacing(
const double spacing[VImageDimension]);
408 virtual void SetSpacing(
const float spacing[VImageDimension]);
415 template<
typename TCoordRep >
453 template<
typename TCoordRep,
typename TIndexRep >
460 for (
unsigned int k = 0; k < VImageDimension; ++k )
462 cvector[k] = point[k] - this->
m_Origin[k];
465 for (
unsigned int i = 0; i < VImageDimension; ++i )
467 index[i] =
static_cast< TIndexRep
>( cvector[i] );
480 template<
typename TCoordRep,
typename TIndexRep >
485 for (
unsigned int r = 0; r < VImageDimension; ++r )
488 for (
unsigned int c = 0; c < VImageDimension; ++c )
502 template<
typename TCoordRep >
540 template<
typename TCoordRep >
551 for (
unsigned int i = 0; i < VImageDimension; ++i )
555 for (
unsigned int j = 0; j < VImageDimension; ++j )
557 sum += direction[i][j] * inputGradient[j];
559 outputGradient[i] =
static_cast< TCoordRep
>( sum );
571 template<
typename TCoordRep >
582 for (
unsigned int i = 0; i < VImageDimension; ++i )
586 for (
unsigned int j = 0; j < VImageDimension; ++j )
588 sum += inverseDirection[i][j] * inputGradient[j];
590 outputGradient[i] =
static_cast< TCoordRep
>( sum );
686 virtual
void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
767 void operator=(const
Self &) ITK_DELETE_FUNCTION;
775 template <
typename TSpacingValue>
792 #ifndef ITK_MANUAL_INSTANTIATION
793 #include "itkImageBase.hxx"
void SetSize(const SizeType &size)
virtual void SetRegions(const RegionType ®ion)
virtual bool RequestedRegionIsOutsideOfTheBufferedRegion() override
OffsetValueType m_OffsetTable[VImageDimension+1]
const OffsetValueType * GetOffsetTable() const
Index< VImageDimension > IndexType
const IndexType & GetIndex() const
Represent the offset between two n-dimensional indexes in a n-dimensional image.
static void ComputeOffset(const IndexType &bufferedRegionIndex, const IndexType &index, const OffsetValueType offsetTable[], OffsetValueType &offset)
itk::SizeValueType SizeValueType
virtual void CopyInformation(const DataObject *data) override
Represent the size (bounds) of a n-dimensional image.
RegionType m_BufferedRegion
virtual void SetDirection(const DirectionType &direction)
virtual void Allocate(bool initialize=false)
bool IsInside(const IndexType &index) const
virtual const RegionType & GetLargestPossibleRegion() const
IndexType FastComputeIndex(OffsetValueType offset) const
An image region represents a structured region of data.
RegionType m_RequestedRegion
SpacePrecisionType SpacingValueType
void TransformIndexToPhysicalPoint(const IndexType &index, Point< TCoordRep, VImageDimension > &point) const
virtual void UpdateOutputInformation() override
DirectionType m_IndexToPhysicalPoint
static void ComputeIndex(const IndexType &bufferedRegionIndex, OffsetValueType offset, const OffsetValueType offsetTable[], IndexType &index)
virtual void Initialize() override
Size< VImageDimension > SizeType
DirectionType m_InverseDirection
Point< PointValueType, VImageDimension > PointType
virtual void SetSpacing(const SpacingType &spacing)
Matrix< SpacePrecisionType, VImageDimension, VImageDimension > DirectionType
Simulate a standard C array with copy semnatics.
virtual void SetRegions(const SizeType &size)
unsigned int ImageDimensionType
IndexType ComputeIndex(OffsetValueType offset) const
DirectionType m_Direction
::itk::IndexValueType IndexValueType
virtual void InitializeBufferedRegion()
bool TransformPhysicalPointToContinuousIndex(const Point< TCoordRep, VImageDimension > &point, ContinuousIndex< TIndexRep, VImageDimension > &index) const
Get the continuous index from a physical point.
virtual void SetNumberOfComponentsPerPixel(unsigned int)
void ComputeOffsetTable()
virtual void Graft(const DataObject *data) override
virtual const RegionType & GetBufferedRegion() const
Offset< VImageDimension > OffsetType
virtual const DirectionType & GetInverseDirection() const
SmartPointer< const Self > ConstPointer
virtual unsigned int GetNumberOfComponentsPerPixel() const
Vector< SpacingValueType, VImageDimension > SpacingType
void TransformLocalVectorToPhysicalVector(const FixedArray< TCoordRep, VImageDimension > &inputGradient, FixedArray< TCoordRep, VImageDimension > &outputGradient) const
OffsetValueType FastComputeOffset(const IndexType &ind) const
void CastFrom(const Vector< TCoordRepB, NVectorDimension > &pa)
static const ImageDimensionType ImageDimension
void TransformPhysicalVectorToLocalVector(const FixedArray< TCoordRep, VImageDimension > &inputGradient, FixedArray< TCoordRep, VImageDimension > &outputGradient) const
static unsigned int GetImageDimension()
SmartPointer< Self > Pointer
SizeType::SizeValueType SizeValueType
OffsetType::OffsetValueType OffsetValueType
void InternalSetSpacing(const TSpacingValue spacing[VImageDimension])
virtual void PrintSelf(std::ostream &os, Indent indent) const override
virtual void SetLargestPossibleRegion(const RegionType ®ion)
Base class for templated image classes.
A templated class holding a point in n-Dimensional image space.
void TransformContinuousIndexToPhysicalPoint(const ContinuousIndex< TIndexRep, VImageDimension > &index, Point< TCoordRep, VImageDimension > &point) const
DirectionType m_PhysicalPointToIndex
virtual const DirectionType & GetDirection() const
virtual const RegionType & GetRequestedRegion() const
virtual void ComputeIndexToPhysicalPointMatrices()
Control indentation during Print() invocation.
void InternalSetSpacing(const SpacingValueType spacing[VImageDimension])
OffsetValueType ComputeOffset(const IndexType &ind) const
double SpacePrecisionType
virtual void UpdateOutputData() override
ImageRegion< VImageDimension > RegionType
itk::OffsetValueType OffsetValueType
SpacePrecisionType PointValueType
Base class for all data objects in ITK.
virtual void SetRequestedRegionToLargestPossibleRegion() override
IndexType::IndexValueType IndexValueType
RegionType m_LargestPossibleRegion
virtual bool VerifyRequestedRegion() override
bool TransformPhysicalPointToIndex(const Point< TCoordRep, VImageDimension > &point, IndexType &index) const
virtual void SetRequestedRegion(const RegionType ®ion)
virtual void SetBufferedRegion(const RegionType ®ion)
virtual void SetOrigin(PointType _arg)