18#ifndef itkShapeLabelObject_h
19#define itkShapeLabelObject_h
42template <
typename TLabel,
unsigned int VImageDimension>
166 if (s ==
"NumberOfPixels")
170 if (s ==
"PhysicalSize")
174 else if (s ==
"Centroid")
178 else if (s ==
"BoundingBox")
182 else if (s ==
"NumberOfPixelsOnBorder")
186 else if (s ==
"PerimeterOnBorder")
190 else if (s ==
"FeretDiameter")
194 else if (s ==
"PrincipalMoments")
198 else if (s ==
"PrincipalAxes")
202 else if (s ==
"Elongation")
206 else if (s ==
"Perimeter")
210 else if (s ==
"Roundness")
214 else if (s ==
"EquivalentSphericalRadius")
218 else if (s ==
"EquivalentSphericalPerimeter")
222 else if (s ==
"EquivalentEllipsoidDiameter")
226 else if (s ==
"Flatness")
230 else if (s ==
"PerimeterOnBorderRatio")
232 return PERIMETER_ON_BORDER_RATIO;
234 else if (s ==
"OrientedBoundingBoxOrigin")
236 return ORIENTED_BOUNDING_BOX_ORIGIN;
238 else if (s ==
"OrientedBoundingBoxSize")
240 return ORIENTED_BOUNDING_BOX_SIZE;
243 return Superclass::GetAttributeFromName(s);
253 name =
"NumberOfPixels";
256 name =
"PhysicalSize";
262 name =
"BoundingBox";
265 name =
"NumberOfPixelsOnBorder";
268 name =
"PerimeterOnBorder";
271 name =
"FeretDiameter";
274 name =
"PrincipalMoments";
277 name =
"PrincipalAxes";
289 name =
"EquivalentSphericalRadius";
292 name =
"EquivalentSphericalPerimeter";
295 name =
"EquivalentEllipsoidDiameter";
301 name =
"PerimeterOnBorderRatio";
304 name =
"OrientedBoundingBoxOrigin";
307 name =
"OrientedBoundingBoxSize";
540 const OrientedBoundingBoxPointType &
552 const OrientedBoundingBoxSizeType &
577 const OrientedBoundingBoxDirectionType &
593 OrientedBoundingBoxVerticesType
637 for (
unsigned int i = 0; i < VImageDimension; ++i)
640 for (
unsigned int j = 0; j < VImageDimension; ++j)
649 result->SetMatrix(matrix);
650 result->SetOffset(offset);
659 AffineTransformPointer
664 for (
unsigned int i = 0; i < VImageDimension; ++i)
667 for (
unsigned int j = 0; j < VImageDimension; ++j)
675 result->SetMatrix(matrix);
676 result->SetOffset(offset);
679 result->GetInverse(inverse);
684 template <
typename TSourceLabelObject>
711 template <
typename TSourceLabelObject>
715 itkAssertOrThrowMacro((src !=
nullptr),
"Null Pointer");
748 os << indent <<
"BoundingBox: " <<
m_BoundingBox << std::endl;
755 os << indent <<
"NumberOfPixelsOnBorder: "
761 os << indent <<
"Elongation: " <<
m_Elongation << std::endl;
762 os << indent <<
"Perimeter: " <<
m_Perimeter << std::endl;
763 os << indent <<
"Roundness: " <<
m_Roundness << std::endl;
767 os << indent <<
"Flatness: " <<
m_Flatness << std::endl;
769 os << indent <<
"OrientedBoundingBoxSize: "
772 os << indent <<
"OrientedBoundingBoxOrigin: "
Simulate a standard C array with copy semantics.
static constexpr unsigned int Length
An image region represents a structured region of data.
Control indentation during Print() invocation.
Templated n-dimensional image to store labeled objects.
itk::SizeValueType SizeValueType
LabelObjectLine< VImageDimension > LineType
void PrintSelf(std::ostream &os, Indent indent) const override
Index< VImageDimension > IndexType
unsigned int AttributeType
static std::string GetNameFromAttribute(const AttributeType &a)
void CopyLinesFrom(const TSourceLabelObject *src)
typename LineType::LengthType LengthType
A templated class holding a M x N size Matrix.
A templated class holding a geometric point in n-Dimensional space.
const double & GetEquivalentSphericalPerimeter() const
static constexpr AttributeType ORIENTED_BOUNDING_BOX_SIZE
WeakPointer< const Self > ConstWeakPointer
static constexpr AttributeType ROUNDNESS
static constexpr AttributeType FLATNESS
void SetEquivalentEllipsoidDiameter(const VectorType &v)
Matrix< double, VImageDimension, VImageDimension > MatrixType
void CopyAllFrom(const TSourceLabelObject *src)
const VectorType & GetPrincipalMoments() const
double m_PerimeterOnBorder
OrientedBoundingBoxPointType m_OrientedBoundingBoxOrigin
static constexpr AttributeType NUMBER_OF_PIXELS
void SetElongation(const double v)
AffineTransform< double, VImageDimension > AffineTransformType
const SizeValueType & GetNumberOfPixelsOnBorder() const
static constexpr AttributeType EQUIVALENT_SPHERICAL_PERIMETER
static constexpr AttributeType EQUIVALENT_SPHERICAL_RADIUS
const double & GetPerimeter() const
static constexpr AttributeType EQUIVALENT_ELLIPSOID_DIAMETER
const MatrixType & GetPrincipalAxes() const
VectorType m_EquivalentEllipsoidDiameter
void SetEquivalentSphericalRadius(const double v)
const RegionType & GetRegion() const
OrientedBoundingBoxVerticesType GetOrientedBoundingBoxVertices() const
const OrientedBoundingBoxPointType & GetOrientedBoundingBoxOrigin() const
Vector< double, VImageDimension > OrientedBoundingBoxSizeType
void SetPrincipalMoments(const VectorType &v)
void SetPerimeterOnBorder(const double v)
const double & GetFlatness() const
MatrixType m_PrincipalAxes
void SetNumberOfPixels(const SizeValueType &v)
void SetNumberOfPixelsOnBorder(const SizeValueType &v)
const CentroidType & GetCentroid() const
static AttributeType GetAttributeFromName(const std::string &s)
FixedArray< OrientedBoundingBoxPointType, Math::UnsignedPower< unsigned int >(2, ImageDimension)> OrientedBoundingBoxVerticesType
const RegionType & GetBoundingBox() const
static constexpr AttributeType FERET_DIAMETER
void SetPrincipalAxes(const MatrixType &v)
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
const double & GetEquivalentSphericalRadius() const
AffineTransformPointer GetPrincipalAxesToPhysicalAxesTransform() const
const double & GetFeretDiameter() const
void SetPerimeter(const double v)
void SetFeretDiameter(const double v)
double m_EquivalentSphericalRadius
const OrientedBoundingBoxSizeType & GetOrientedBoundingBoxSize() const
const OrientedBoundingBoxDirectionType & GetOrientedBoundingBoxDirection() const
static constexpr unsigned int ImageDimension
const double & GetElongation() const
static constexpr AttributeType PERIMETER
void SetOrientedBoundingBoxSize(const OrientedBoundingBoxSizeType &v)
void CopyAttributesFrom(const TSourceLabelObject *src)
const double & GetPhysicalSize() const
void SetPerimeterOnBorderRatio(const double v)
LabelMap< Self > LabelMapType
void SetBoundingBox(const RegionType &v)
static constexpr AttributeType CENTROID
LabelObject< LabelType, VImageDimension > Superclass
Point< double, VImageDimension > OrientedBoundingBoxPointType
typename Superclass::LabelObjectType LabelObjectType
const double & GetPerimeterOnBorder() const
ImageRegion< VImageDimension > RegionType
const SizeValueType & GetNumberOfPixels() const
SizeValueType m_NumberOfPixelsOnBorder
unsigned int AttributeType
static constexpr AttributeType PERIMETER_ON_BORDER
static constexpr AttributeType PERIMETER_ON_BORDER_RATIO
const VectorType & GetEquivalentEllipsoidDiameter() const
void PrintSelf(std::ostream &os, Indent indent) const override
static constexpr AttributeType BOUNDING_BOX
Vector< double, VImageDimension > VectorType
const double & GetPerimeterOnBorderRatio() const
typename AffineTransformType::Pointer AffineTransformPointer
void SetEquivalentSphericalPerimeter(const double v)
const double & GetRoundness() const
void SetFlatness(const double v)
static constexpr AttributeType ELONGATION
void SetCentroid(const CentroidType ¢roid)
AffineTransformPointer GetPhysicalAxesToPrincipalAxesTransform() const
static constexpr AttributeType ORIENTED_BOUNDING_BOX_ORIGIN
void SetOrientedBoundingBoxOrigin(const OrientedBoundingBoxPointType &v)
static constexpr AttributeType PHYSICAL_SIZE
static std::string GetNameFromAttribute(const AttributeType &a)
Point< double, VImageDimension > CentroidType
void SetPhysicalSize(const double v)
VectorType m_PrincipalMoments
static constexpr AttributeType NUMBER_OF_PIXELS_ON_BORDER
SizeValueType m_NumberOfPixels
double m_EquivalentSphericalPerimeter
static constexpr AttributeType PRINCIPAL_MOMENTS
void SetRoundness(const double v)
MatrixType OrientedBoundingBoxDirectionType
OrientedBoundingBoxSizeType m_OrientedBoundingBoxSize
static constexpr AttributeType PRINCIPAL_AXES
double m_PerimeterOnBorderRatio
Implements transparent reference counting.
A templated class holding a n-Dimensional vector.
Implements a weak reference to an object.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType