18 #ifndef itkShapeLabelObject_h
19 #define itkShapeLabelObject_h
41 template<
typename TLabel,
unsigned int VImageDimension >
164 if ( s ==
"NumberOfPixels" )
168 else if ( s ==
"PhysicalSize" )
172 else if ( s ==
"Centroid" )
176 else if ( s ==
"BoundingBox" )
180 else if ( s ==
"NumberOfPixelsOnBorder" )
184 else if ( s ==
"PerimeterOnBorder" )
188 else if ( s ==
"FeretDiameter" )
192 else if ( s ==
"PrincipalMoments" )
196 else if ( s ==
"PrincipalAxes" )
200 else if ( s ==
"Elongation" )
204 else if ( s ==
"Perimeter" )
208 else if ( s ==
"Roundness" )
212 else if ( s ==
"EquivalentSphericalRadius" )
216 else if ( s ==
"EquivalentSphericalPerimeter" )
220 else if ( s ==
"EquivalentEllipsoidDiameter" )
224 else if ( s ==
"Flatness" )
228 else if ( s ==
"PerimeterOnBorderRatio" )
232 else if ( s ==
"OrientedBoundingBoxOrigin")
236 else if ( s ==
"OrientedBoundingBoxSize")
250 name =
"NumberOfPixels";
253 name =
"PhysicalSize";
259 name =
"BoundingBox";
262 name =
"NumberOfPixelsOnBorder";
265 name =
"PerimeterOnBorder";
268 name =
"FeretDiameter";
271 name =
"PrincipalMoments";
274 name =
"PrincipalAxes";
286 name =
"EquivalentSphericalRadius";
289 name =
"EquivalentSphericalPerimeter";
292 name =
"EquivalentEllipsoidDiameter";
298 name =
"PerimeterOnBorderRatio";
301 name =
"OrientedBoundingBoxOrigin";
304 name =
"OrientedBoundingBoxSize";
325 template <
size_t VX,
unsigned short VY>
584 const unsigned int msb = 1 << (ImageDimension-1);
589 vertices[i][j] = max[j];
593 vertices[i][j] = min[j];
611 for (
unsigned int i = 0; i < VImageDimension; i++ )
614 for (
unsigned int j = 0; j < VImageDimension; j++ )
623 result->SetMatrix(matrix);
624 result->SetOffset(offset);
637 for (
unsigned int i = 0; i < VImageDimension; i++ )
640 for (
unsigned int j = 0; j < VImageDimension; j++ )
648 result->SetMatrix(matrix);
649 result->SetOffset(offset);
652 result->GetInverse(inverse);
657 template<
typename TSourceLabelObject >
660 Superclass::template CopyAttributesFrom<TSourceLabelObject>(src);
683 template<
typename TSourceLabelObject >
686 itkAssertOrThrowMacro ( ( src !=
nullptr ),
"Null Pointer" );
687 this->
template CopyLinesFrom<TSourceLabelObject>( src );
688 this->
template CopyAttributesFrom<TSourceLabelObject>( src );
720 os << indent <<
"Perimeter: " <<
m_Perimeter << std::endl;
724 os << indent <<
"Elongation: " <<
m_Elongation << std::endl;
725 os << indent <<
"Flatness: " <<
m_Flatness << std::endl;
726 os << indent <<
"Roundness: " <<
m_Roundness << std::endl;
727 os << indent <<
"Centroid: " <<
m_Centroid << std::endl;
728 os << indent <<
"BoundingBox: ";
double m_PerimeterOnBorderRatio
void SetPerimeter(const double &v)
static constexpr AttributeType FERET_DIAMETER
Light weight base class for most itk classes.
void SetPhysicalSize(const double &v)
double m_EquivalentSphericalPerimeter
OrientedBoundingBoxVerticesType GetOrientedBoundingBoxVertices() const
void SetOrientedBoundingBoxSize(const OrientedBoundingBoxSizeType &v)
VectorType m_PrincipalMoments
void SetEquivalentEllipsoidDiameter(const VectorType &v)
const double & GetRoundness() const
LabelObjectLine< VImageDimension > LineType
unsigned int AttributeType
void SetElongation(const double &v)
void SetCentroid(const CentroidType ¢roid)
void SetEquivalentSphericalRadius(const double &v)
static constexpr AttributeType PERIMETER
Matrix< double, VImageDimension, VImageDimension > MatrixType
void SetBoundingBox(const RegionType &v)
Index< VImageDimension > IndexType
void SetFlatness(const double &v)
An image region represents a structured region of data.
static AttributeType GetAttributeFromName(const std::string &s)
virtual void Print(std::ostream &os, Indent indent=0) const
void SetEquivalentSphericalPerimeter(const double &v)
SizeValueType m_NumberOfPixelsOnBorder
const OrientedBoundingBoxPointType & GetOrientedBoundingBoxOrigin() const
static constexpr AttributeType PERIMETER_ON_BORDER
Implements a weak reference to an object.
static constexpr AttributeType ELONGATION
void PrintSelf(std::ostream &os, Indent indent) const override
const OrientedBoundingBoxDirectionType & GetOrientedBoundingBoxDirection() const
const double & GetFlatness() const
void Fill(const ValueType &)
static constexpr AttributeType ORIENTED_BOUNDING_BOX_ORIGIN
MatrixType m_PrincipalAxes
static constexpr AttributeType PHYSICAL_SIZE
Simulate a standard C array with copy semnatics.
static constexpr AttributeType EQUIVALENT_ELLIPSOID_DIAMETER
static constexpr AttributeType ORIENTED_BOUNDING_BOX_SIZE
static constexpr unsigned int ImageDimension
itk::SizeValueType SizeValueType
static constexpr AttributeType PRINCIPAL_AXES
static std::string GetNameFromAttribute(const AttributeType &a)
SizeValueType m_NumberOfPixels
void PrintSelf(std::ostream &os, Indent indent) const override
static constexpr AttributeType NUMBER_OF_PIXELS_ON_BORDER
void SetNumberOfPixels(const SizeValueType &v)
void SetNumberOfPixelsOnBorder(const SizeValueType &v)
const OrientedBoundingBoxSizeType & GetOrientedBoundingBoxSize() const
const double & GetPhysicalSize() const
static constexpr AttributeType BOUNDING_BOX
void CopyAttributesFrom(const TSourceLabelObject *src)
static constexpr AttributeType NUMBER_OF_PIXELS
const CentroidType & GetCentroid() const
double m_PerimeterOnBorder
void SetRoundness(const double &v)
AffineTransformPointer GetPhysicalAxesToPrincipalAxesTransform() const
const VectorType & GetPrincipalMoments() const
const RegionType & GetRegion() const
static AttributeType GetAttributeFromName(const std::string &s)
const double & GetEquivalentSphericalPerimeter() const
static const vcl_size_t Result
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
static constexpr unsigned int Length
const SizeValueType & GetNumberOfPixels() const
void SetOrientedBoundingBoxOrigin(const OrientedBoundingBoxPointType &v)
typename LineType::LengthType LengthType
void SetPerimeterOnBorderRatio(const double &v)
const double & GetPerimeter() const
const double & GetEquivalentSphericalRadius() const
const VectorType & GetEquivalentEllipsoidDiameter() const
const double & GetPerimeterOnBorder() const
static constexpr AttributeType PERIMETER_ON_BORDER_RATIO
static constexpr AttributeType PRINCIPAL_MOMENTS
const double & GetElongation() const
The base class for the representation of an labeled binary object in an image.
const RegionType & GetBoundingBox() const
static constexpr AttributeType EQUIVALENT_SPHERICAL_PERIMETER
typename AffineTransformType::Pointer AffineTransformPointer
Control indentation during Print() invocation.
void Fill(const T &value)
VectorType m_EquivalentEllipsoidDiameter
void SetPrincipalMoments(const VectorType &v)
Templated n-dimensional image to store labeled objects.
void SetFeretDiameter(const double &v)
void SetPerimeterOnBorder(const double &v)
const SizeValueType & GetNumberOfPixelsOnBorder() const
static constexpr AttributeType CENTROID
void SetPrincipalAxes(const MatrixType &v)
const double & GetPerimeterOnBorderRatio() const
double m_EquivalentSphericalRadius
OrientedBoundingBoxSizeType m_OrientedBoundingBoxSize
static std::string GetNameFromAttribute(const AttributeType &a)
static constexpr AttributeType FLATNESS
typename Superclass::AttributeType AttributeType
static constexpr AttributeType EQUIVALENT_SPHERICAL_RADIUS
void CopyAllFrom(const TSourceLabelObject *src)
static constexpr AttributeType ROUNDNESS
AffineTransformPointer GetPrincipalAxesToPhysicalAxesTransform() const