28 #ifndef itkImageBase_h 29 #define itkImageBase_h 41 #include <vxl_version.h> 42 #if VXL_VERSION_DATE_FULL < 20160229 43 #include "vnl/vnl_matrix_fixed.txx" 45 #include "vnl/vnl_matrix_fixed.hxx" 54 template<
unsigned int NImageDimension,
unsigned int R,
unsigned int C,
typename TPo
intValue,
typename TMatrixValue >
114 template<
unsigned int VImageDimension = 2 >
177 {
return VImageDimension; }
183 itkSetMacro(Origin, PointType);
184 virtual void SetOrigin(
const double origin[VImageDimension]);
185 virtual void SetOrigin(
const float origin[VImageDimension]);
213 virtual void SetDirection(
const DirectionType & direction);
218 itkGetConstReferenceMacro(Direction, DirectionType);
223 itkGetConstReferenceMacro(InverseDirection, DirectionType);
229 itkGetConstReferenceMacro(Spacing, SpacingType);
235 itkGetConstReferenceMacro(Origin, PointType);
244 virtual void Allocate(
bool initialize=
false);
312 RegionType region; region.
SetSize(size);
340 OffsetValueType offset = 0;
409 virtual void SetSpacing(
const SpacingType & spacing);
410 virtual void SetSpacing(
const double spacing[VImageDimension]);
411 virtual void SetSpacing(
const float spacing[VImageDimension]);
418 template<
typename TCoordRep >
421 IndexType & index)
const 456 template<
typename TCoordRep,
typename TIndexRep >
463 for (
unsigned int k = 0; k < VImageDimension; ++k )
465 cvector[k] = point[k] - this->
m_Origin[k];
468 for (
unsigned int i = 0; i < VImageDimension; ++i )
470 index[i] =
static_cast< TIndexRep
>( cvector[i] );
483 template<
typename TCoordRep,
typename TIndexRep >
488 for (
unsigned int r = 0; r < VImageDimension; ++r )
491 for (
unsigned int c = 0; c < VImageDimension; ++c )
505 template<
typename TCoordRep >
507 const IndexType & index,
543 template<
typename TCoordRep >
554 for (
unsigned int i = 0; i < VImageDimension; ++i )
558 for (
unsigned int j = 0; j < VImageDimension; ++j )
560 sum += direction[i][j] * inputGradient[j];
562 outputGradient[i] =
static_cast< TCoordRep
>( sum );
574 template<
typename TCoordRep >
585 for (
unsigned int i = 0; i < VImageDimension; ++i )
589 for (
unsigned int j = 0; j < VImageDimension; ++j )
591 sum += inverseDirection[i][j] * inputGradient[j];
593 outputGradient[i] =
static_cast< TCoordRep
>( sum );
689 virtual void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
736 OffsetValueType offset = 0;
769 ImageBase(
const Self &) ITK_DELETE_FUNCTION;
770 void operator=(
const Self &) ITK_DELETE_FUNCTION;
774 SpacingType s(spacing);
778 template <
typename TSpacingValue>
795 #ifndef ITK_MANUAL_INSTANTIATION 796 #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
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
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
virtual void PrintSelf(std::ostream &os, Indent indent) const override
void InternalSetSpacing(const TSpacingValue spacing[VImageDimension])
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)
void operator=(const Self &) ITK_DELETE_FUNCTION
virtual void SetBufferedRegion(const RegionType ®ion)
virtual void SetOrigin(PointType _arg)