18 #ifndef itkShapeLabelObject_h
19 #define itkShapeLabelObject_h
41 template<
typename TLabel,
unsigned int VImageDimension >
162 if ( s ==
"NumberOfPixels" )
166 else if ( s ==
"PhysicalSize" )
170 else if ( s ==
"Centroid" )
174 else if ( s ==
"BoundingBox" )
178 else if ( s ==
"NumberOfPixelsOnBorder" )
182 else if ( s ==
"PerimeterOnBorder" )
186 else if ( s ==
"FeretDiameter" )
190 else if ( s ==
"PrincipalMoments" )
194 else if ( s ==
"PrincipalAxes" )
198 else if ( s ==
"Elongation" )
202 else if ( s ==
"Perimeter" )
206 else if ( s ==
"Roundness" )
210 else if ( s ==
"EquivalentSphericalRadius" )
214 else if ( s ==
"EquivalentSphericalPerimeter" )
218 else if ( s ==
"EquivalentEllipsoidDiameter" )
222 else if ( s ==
"Flatness" )
226 else if ( s ==
"PerimeterOnBorderRatio" )
230 else if ( s ==
"OrientedBoundingBoxOrigin")
234 else if ( s ==
"OrientedBoundingBoxSize")
248 name =
"NumberOfPixels";
251 name =
"PhysicalSize";
257 name =
"BoundingBox";
260 name =
"NumberOfPixelsOnBorder";
263 name =
"PerimeterOnBorder";
266 name =
"FeretDiameter";
269 name =
"PrincipalMoments";
272 name =
"PrincipalAxes";
284 name =
"EquivalentSphericalRadius";
287 name =
"EquivalentSphericalPerimeter";
290 name =
"EquivalentEllipsoidDiameter";
296 name =
"PerimeterOnBorderRatio";
299 name =
"OrientedBoundingBoxOrigin";
302 name =
"OrientedBoundingBoxSize";
323 template <
size_t VX,
unsigned short VY>
582 const unsigned int msb = 1 << (ImageDimension-1);
587 vertices[i][j] = max[j];
591 vertices[i][j] = min[j];
609 for (
unsigned int i = 0; i < VImageDimension; i++ )
612 for (
unsigned int j = 0; j < VImageDimension; j++ )
621 result->SetMatrix(matrix);
622 result->SetOffset(offset);
635 for (
unsigned int i = 0; i < VImageDimension; i++ )
638 for (
unsigned int j = 0; j < VImageDimension; j++ )
646 result->SetMatrix(matrix);
647 result->SetOffset(offset);
650 result->GetInverse(inverse);
655 template<
typename TSourceLabelObject >
658 Superclass::template CopyAttributesFrom<TSourceLabelObject>(src);
681 template<
typename TSourceLabelObject >
684 itkAssertOrThrowMacro ( ( src != ITK_NULLPTR ),
"Null Pointer" );
685 this->
template CopyLinesFrom<TSourceLabelObject>( src );
686 this->
template CopyAttributesFrom<TSourceLabelObject>( src );
718 os << indent <<
"Perimeter: " <<
m_Perimeter << std::endl;
722 os << indent <<
"Elongation: " <<
m_Elongation << std::endl;
723 os << indent <<
"Flatness: " <<
m_Flatness << std::endl;
724 os << indent <<
"Roundness: " <<
m_Roundness << std::endl;
725 os << indent <<
"Centroid: " <<
m_Centroid << std::endl;
726 os << indent <<
"BoundingBox: ";
double m_PerimeterOnBorderRatio
void SetPerimeter(const double &v)
Matrix< double, VImageDimension, VImageDimension > MatrixType
static const AttributeType PRINCIPAL_MOMENTS
Light weight base class for most itk classes.
static const AttributeType FERET_DIAMETER
void SetPhysicalSize(const double &v)
WeakPointer< const Self > ConstWeakPointer
double m_EquivalentSphericalPerimeter
Vector< double, VImageDimension > VectorType
OrientedBoundingBoxVerticesType GetOrientedBoundingBoxVertices() const
Superclass::LengthType LengthType
Superclass::LabelObjectType LabelObjectType
Point< double, VImageDimension > CentroidType
void SetOrientedBoundingBoxSize(const OrientedBoundingBoxSizeType &v)
VectorType m_PrincipalMoments
Point< double, VImageDimension > OrientedBoundingBoxPointType
void SetEquivalentEllipsoidDiameter(const VectorType &v)
static const AttributeType BOUNDING_BOX
const double & GetRoundness() const
void SetElongation(const double &v)
void SetCentroid(const CentroidType ¢roid)
void SetEquivalentSphericalRadius(const double &v)
void SetBoundingBox(const RegionType &v)
static const unsigned int ImageDimension
void SetFlatness(const double &v)
An image region represents a structured region of data.
static const AttributeType PHYSICAL_SIZE
static AttributeType GetAttributeFromName(const std::string &s)
virtual void Print(std::ostream &os, Indent indent=0) const
LabelMap< Self > LabelMapType
static const AttributeType NUMBER_OF_PIXELS_ON_BORDER
void SetEquivalentSphericalPerimeter(const double &v)
static const AttributeType FLATNESS
SizeValueType m_NumberOfPixelsOnBorder
const OrientedBoundingBoxPointType & GetOrientedBoundingBoxOrigin() const
static const AttributeType PERIMETER_ON_BORDER_RATIO
Implements a weak reference to an object.
static const AttributeType CENTROID
const OrientedBoundingBoxDirectionType & GetOrientedBoundingBoxDirection() const
const double & GetFlatness() const
LabelObjectLine< VImageDimension > LineType
void Fill(const ValueType &)
static const AttributeType NUMBER_OF_PIXELS
MatrixType m_PrincipalAxes
static const AttributeType EQUIVALENT_SPHERICAL_RADIUS
Simulate a standard C array with copy semnatics.
unsigned int AttributeType
static const AttributeType PRINCIPAL_AXES
static const unsigned int Length
Index< VImageDimension > IndexType
static std::string GetNameFromAttribute(const AttributeType &a)
static const AttributeType ORIENTED_BOUNDING_BOX_SIZE
SizeValueType m_NumberOfPixels
void PrintSelf(std::ostream &os, Indent indent) const override
void SetNumberOfPixels(const SizeValueType &v)
Superclass::IndexType IndexType
void SetNumberOfPixelsOnBorder(const SizeValueType &v)
const OrientedBoundingBoxSizeType & GetOrientedBoundingBoxSize() const
const double & GetPhysicalSize() const
void CopyAttributesFrom(const TSourceLabelObject *src)
LineType::LengthType LengthType
const CentroidType & GetCentroid() const
ImageRegion< VImageDimension > RegionType
LabelObject< TLabel, VImageDimension > Superclass
double m_PerimeterOnBorder
void SetRoundness(const double &v)
static const AttributeType EQUIVALENT_ELLIPSOID_DIAMETER
const VectorType & GetPrincipalMoments() const
const RegionType & GetRegion() const
Superclass::AttributeType AttributeType
Superclass::LineType LineType
AffineTransformPointer GetPhysicalAxesToPrincipalAxesTransform(void) const
virtual void PrintSelf(std::ostream &os, Indent indent) const override
static AttributeType GetAttributeFromName(const std::string &s)
const double & GetEquivalentSphericalPerimeter() const
static const vcl_size_t Result
Vector< double, VImageDimension > OrientedBoundingBoxSizeType
const MatrixType & GetPrincipalAxes() const
A Label object to store the common attributes related to the shape of the object. ...
const double & GetFeretDiameter() const
OrientedBoundingBoxPointType m_OrientedBoundingBoxOrigin
const SizeValueType & GetNumberOfPixels() const
static const AttributeType PERIMETER
static const AttributeType ORIENTED_BOUNDING_BOX_ORIGIN
AffineTransformType::Pointer AffineTransformPointer
void SetOrientedBoundingBoxOrigin(const OrientedBoundingBoxPointType &v)
void SetPerimeterOnBorderRatio(const double &v)
const double & GetPerimeter() const
const double & GetEquivalentSphericalRadius() const
const VectorType & GetEquivalentEllipsoidDiameter() const
const double & GetPerimeterOnBorder() const
itk::SizeValueType SizeValueType
static const AttributeType PERIMETER_ON_BORDER
const double & GetElongation() const
The base class for the representation of an labeled binary object in an image.
static const AttributeType ROUNDNESS
const RegionType & GetBoundingBox() const
SmartPointer< const Self > ConstPointer
Control indentation during Print() invocation.
void Fill(const T &value)
VectorType m_EquivalentEllipsoidDiameter
void SetPrincipalMoments(const VectorType &v)
FixedArray< OrientedBoundingBoxPointType, IntegerPow< 2, ImageDimension >::Result > OrientedBoundingBoxVerticesType
Templated n-dimensional image to store labeled objects.
void SetFeretDiameter(const double &v)
void SetPerimeterOnBorder(const double &v)
const SizeValueType & GetNumberOfPixelsOnBorder() const
void SetPrincipalAxes(const MatrixType &v)
const double & GetPerimeterOnBorderRatio() const
double m_EquivalentSphericalRadius
AffineTransform< double, VImageDimension > AffineTransformType
OrientedBoundingBoxSizeType m_OrientedBoundingBoxSize
static std::string GetNameFromAttribute(const AttributeType &a)
static const AttributeType EQUIVALENT_SPHERICAL_PERIMETER
void CopyAllFrom(const TSourceLabelObject *src)
MatrixType OrientedBoundingBoxDirectionType
AffineTransformPointer GetPrincipalAxesToPhysicalAxesTransform() const
SmartPointer< Self > Pointer
static const AttributeType ELONGATION