18 #ifndef __itkLabelGeometryImageFilter_h
19 #define __itkLabelGeometryImageFilter_h
25 #include "itksys/hash_map.hxx"
28 #include "vnl/algo/vnl_symmetric_eigensystem.h"
29 #include "vnl/vnl_det.h"
30 #include "vnl/vnl_math.h"
77 template<
typename TLabelImage,
typename TIntensityImage = TLabelImage >
98 typedef typename TIntensityImage::SizeType
SizeType;
99 typedef typename TIntensityImage::IndexType
IndexType;
113 TLabelImage::ImageDimension);
169 const unsigned int imageDimension = itkGetStaticConstMacro(
ImageDimension);
172 for (
unsigned int i = 0; i < imageDimension * 2; i += 2 )
196 unsigned int numberOfVertices = (
unsigned int)std::pow( (
double)2, (int)
ImageDimension );
250 typedef itksys::hash_map< LabelPixelType, LabelGeometry >
MapType;
251 typedef typename itksys::hash_map< LabelPixelType, LabelGeometry >::iterator
MapIterator;
252 typedef typename itksys::hash_map< LabelPixelType, LabelGeometry >::const_iterator
MapConstIterator;
255 itkGetMacro(CalculatePixelIndices,
bool);
256 itkBooleanMacro(CalculatePixelIndices);
264 if ( value ==
false )
282 itkGetMacro(CalculateOrientedBoundingBox,
bool);
283 itkBooleanMacro(CalculateOrientedBoundingBox);
300 itkGetMacro(CalculateOrientedLabelRegions,
bool);
301 itkBooleanMacro(CalculateOrientedLabelRegions);
318 itkGetMacro(CalculateOrientedIntensityRegions,
bool);
319 itkBooleanMacro(CalculateOrientedIntensityRegions);
340 this->
SetNthInput( 1, const_cast< TIntensityImage * >( input ) );
461 #ifdef ITK_USE_CONCEPT_CHECKING
493 template<
typename TLabelImage,
typename TIntensityImage >
495 vnl_symmetric_eigensystem< double > eig);
497 template<
typename TLabelImage,
typename TIntensityImage,
typename TGenericImage >
500 vnl_symmetric_eigensystem< double > eig,
502 bool useLabelImage =
true);
505 #ifndef ITK_MANUAL_INSTANTIATION
506 #include "itkLabelGeometryImageFilter.hxx"
MatrixType m_SecondOrderRawMoments
LabelIndicesType GetPixelIndices(LabelPixelType label) const
itk::FixedArray< float, itkGetStaticConstMacro(ImageDimension)*2 > BoundingBoxFloatType
Critical section locking class that can be allocated on the stack.
bool HasLabel(LabelPixelType label) const
RealType m_OrientedBoundingBoxVolume
LabelPointType GetOrientedBoundingBoxOrigin(LabelPixelType label) const
bool CalculateOrientedBoundingBoxVertices(vnl_symmetric_eigensystem< double > eig, LabelGeometry &m_LabelGeometry)
RealType GetMinorAxisLength(LabelPixelType label) const
SimpleFastMutexLock m_Mutex
Light weight base class for most itk classes.
itksys::hash_map< LabelPixelType, LabelGeometry >::const_iterator MapConstIterator
IntensityImageType::Pointer m_OrientedIntensityImage
MatrixType m_Eigenvectors
TLabelImage::IndexType LabelIndexType
SizeValueType m_ZeroOrderMoment
itk::FixedArray< RealType, itkGetStaticConstMacro(ImageDimension) > AxesLengthType
TLabelImage::RegionType LabelRegionType
SimpleDataObjectDecorator< RealType > RealObjectType
void SetCalculateOrientedIntensityRegions(const bool value)
RealType GetEccentricity(LabelPixelType label) const
VectorType GetEigenvalues(LabelPixelType label) const
itksys::hash_map< LabelPixelType, LabelGeometry >::iterator MapIterator
signed long IndexValueType
MapType m_LabelGeometryMapper
RealType GetOrientation(LabelPixelType label) const
TIntensityImage::IndexType IndexType
TLabelImage LabelImageType
RealType m_FirstOrderCentralCrossMoment
RealType GetElongation(LabelPixelType label) const
MatrixType m_RotationMatrix
LabelGeometryImageFilter< TLabelImage, TIntensityImage >::MatrixType CalculateRotationMatrix(vnl_symmetric_eigensystem< double > eig)
static const unsigned int ImageDimension
std::vector< LabelIndexType > LabelIndicesType
void SetCalculateOrientedBoundingBox(const bool value)
itksys::hash_map< LabelPixelType, LabelGeometry > MapType
unsigned long SizeValueType
TIntensityImage IntensityImageType
RealType GetOrientedBoundingBoxVolume(LabelPixelType label) const
bool CalculateOrientedImage(LabelGeometryImageFilter< TLabelImage, TIntensityImage > *filter, vnl_symmetric_eigensystem< double > eig, typename LabelGeometryImageFilter< TLabelImage, TIntensityImage >::LabelGeometry &labelGeometry, bool useLabelImage=true)
MatrixType GetRotationMatrix(LabelPixelType label) const
void Fill(const ValueType &)
LabelPointType m_OrientedBoundingBoxOrigin
TLabelImage * GetOrientedLabelImage(LabelPixelType label) const
Simulate a standard C array with copy semnatics.
LabelGeometryImageFilter()
IndexArrayType m_FirstOrderRawMoments
Geometry stored per label.
TIntensityImage::RegionType RegionType
std::vector< LabelPixelType > LabelsType
itk::FixedArray< typename LabelIndexType::IndexValueType, itkGetStaticConstMacro(ImageDimension) > IndexArrayType
void SetCalculateOrientedLabelRegions(const bool value)
LabelIndicesType m_PixelIndices
MatrixType GetEigenvectors(LabelPixelType label) const
RealType GetIntegratedIntensity(LabelPixelType label) const
~LabelGeometryImageFilter()
Decorates any "simple" data type (data types without smart pointers) with a DataObject API...
IndexArrayType m_FirstOrderWeightedRawMoments
void SetCalculatePixelIndices(const bool value)
TIntensityImage::Pointer InputImagePointer
SizeValueType GetNumberOfLabels() const
bool m_CalculateOrientedBoundingBox
BoundingBoxVerticesType m_OrientedBoundingBoxVertices
LabelPointType GetOrientedBoundingBoxSize(LabelPixelType label) const
std::vector< LabelPixelType > GetLabels() const
LabelGeometry m_LabelGeometry
RealType m_BoundingBoxVolume
bool m_CalculatePixelIndices
RegionType GetRegion(LabelPixelType label) const
DataObject::Pointer DataObjectPointer
Given a label map and an optional intensity image, compute geometric features.
virtual void Modified() const
DataObject * GetInput(const DataObjectIdentifierType &key)
RealType GetBoundingBoxVolume(LabelPixelType label) const
SizeValueType GetNumberOfObjects() const
LabelSizeType GetBoundingBoxSize(LabelPixelType label) const
SmartPointer< Self > Pointer
bool m_CalculateOrientedLabelRegions
void SetIntensityInput(const TIntensityImage *input)
SmartPointer< const Self > ConstPointer
std::vector< LabelPointType > BoundingBoxVerticesType
LabelPointType m_OrientedBoundingBoxSize
TLabelImage::PointType LabelPointType
ImageToImageFilter< TLabelImage, TIntensityImage > Superclass
BoundingBoxVerticesType GetOrientedBoundingBoxVertices(LabelPixelType label) const
LabelImageType::Pointer m_OrientedLabelImage
LabelPointType GetWeightedCentroid(LabelPixelType label) const
Base class for filters that take an image as input and produce an image as output.
void PrintSelf(std::ostream &os, Indent indent) const
TLabelImage::Pointer LabelImagePointer
FixedArray< float, itkGetStaticConstMacro(ImageDimension) > m_AxesLength
TIntensityImage * GetOrientedIntensityImage(LabelPixelType label) const
const TIntensityImage * GetIntensityInput() const
Control indentation during Print() invocation.
MatrixType m_SecondOrderCentralMoments
BoundingBoxType m_BoundingBox
SizeValueType m_FirstOrderRawCrossMoment
LabelGeometryImageFilter Self
std::vector< double > VectorType
static T NonpositiveMin()
TLabelImage::PixelType LabelPixelType
TLabelImage::SizeType LabelSizeType
Define additional traits for native types such as int or float.
virtual void SetNthInput(DataObjectPointerArraySizeType num, DataObject *input)
BoundingBoxType GetBoundingBox(LabelPixelType label) const
vnl_matrix< double > MatrixType
void operator=(const Self &)
#define itkConceptMacro(name, concept)
itk::FixedArray< typename LabelIndexType::IndexValueType, itkGetStaticConstMacro(ImageDimension)*2 > BoundingBoxType
LabelPointType GetCentroid(LabelPixelType label) const
NumericTraits< PixelType >::RealType RealType
AxesLengthType GetAxesLength(LabelPixelType label) const
Base class for all data objects in ITK.
bool m_CalculateOrientedIntensityRegions
LabelPointType m_Centroid
LabelSizeType m_BoundingBoxSize
LabelPointType m_WeightedCentroid
RealType GetMajorAxisLength(LabelPixelType label) const
TIntensityImage::PixelType PixelType
SizeValueType GetVolume(LabelPixelType label) const
TIntensityImage::SizeType SizeType