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 >
171 {
return VImageDimension; }
178 virtual void SetOrigin(
const double origin[VImageDimension]);
179 virtual void SetOrigin(
const float origin[VImageDimension]);
229 itkGetConstReferenceMacro(Origin,
PointType);
238 virtual void Allocate(
bool initialize=
false);
404 virtual void SetSpacing(
const double spacing[VImageDimension]);
405 virtual void SetSpacing(
const float spacing[VImageDimension]);
412 template<
typename TCoordRep >
450 template<
typename TCoordRep,
typename TIndexRep >
457 for (
unsigned int k = 0; k < VImageDimension; k++ )
459 cvector[k] = point[k] - this->
m_Origin[k];
462 for (
unsigned int i = 0; i < VImageDimension; i++ )
464 index[i] =
static_cast< TIndexRep
>( cvector[i] );
477 template<
typename TCoordRep,
typename TIndexRep >
482 for (
unsigned int r = 0; r < VImageDimension; r++ )
485 for (
unsigned int c = 0; c < VImageDimension; c++ )
499 template<
typename TCoordRep >
537 template<
typename TCoordRep >
548 for (
unsigned int i = 0; i < VImageDimension; i++ )
552 for (
unsigned int j = 0; j < VImageDimension; j++ )
554 sum += direction[i][j] * inputGradient[j];
556 outputGradient[i] =
static_cast< TCoordRep
>( sum );
568 template<
typename TCoordRep >
579 for (
unsigned int i = 0; i < VImageDimension; i++ )
583 for (
unsigned int j = 0; j < VImageDimension; j++ )
585 sum += inverseDirection[i][j] * inputGradient[j];
587 outputGradient[i] =
static_cast< TCoordRep
>( sum );
683 virtual
void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
719 ImageBase(const
Self &);
720 void operator=(const Self &);
728 template <
typename TSpacingValue>
745 #ifndef ITK_MANUAL_INSTANTIATION
746 #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
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)
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
void CastFrom(const Vector< TCoordRepB, NVectorDimension > &pa)
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
static const unsigned int ImageDimension
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)