18 #ifndef __itkShapeLabelObject_h
19 #define __itkShapeLabelObject_h
41 template<
typename TLabel,
unsigned int VImageDimension >
147 if ( s ==
"NumberOfPixels" )
151 else if ( s ==
"PhysicalSize" )
155 else if ( s ==
"Centroid" )
159 else if ( s ==
"BoundingBox" )
163 else if ( s ==
"NumberOfPixelsOnBorder" )
167 else if ( s ==
"PerimeterOnBorder" )
171 else if ( s ==
"FeretDiameter" )
175 else if ( s ==
"PrincipalMoments" )
179 else if ( s ==
"PrincipalAxes" )
183 else if ( s ==
"Elongation" )
187 else if ( s ==
"Perimeter" )
191 else if ( s ==
"Roundness" )
195 else if ( s ==
"EquivalentSphericalRadius" )
199 else if ( s ==
"EquivalentSphericalPerimeter" )
203 else if ( s ==
"EquivalentEllipsoidDiameter" )
207 else if ( s ==
"Flatness" )
211 else if ( s ==
"PerimeterOnBorderRatio" )
225 name =
"NumberOfPixels";
228 name =
"PhysicalSize";
234 name =
"BoundingBox";
237 name =
"NumberOfPixelsOnBorder";
240 name =
"PerimeterOnBorder";
243 name =
"FeretDiameter";
246 name =
"PrincipalMoments";
249 name =
"PrincipalAxes";
261 name =
"EquivalentSphericalRadius";
264 name =
"EquivalentSphericalPerimeter";
267 name =
"EquivalentEllipsoidDiameter";
273 name =
"PerimeterOnBorderRatio";
474 for (
unsigned int i = 0; i < VImageDimension; i++ )
477 for (
unsigned int j = 0; j < VImageDimension; j++ )
486 result->SetMatrix(matrix);
487 result->SetOffset(offset);
500 for (
unsigned int i = 0; i < VImageDimension; i++ )
503 for (
unsigned int j = 0; j < VImageDimension; j++ )
511 result->SetMatrix(matrix);
512 result->SetOffset(offset);
515 result->GetInverse(inverse);
525 const Self *src =
dynamic_cast< const Self *
>( lo );
526 if ( src == ITK_NULLPTR )
576 os << indent <<
"Perimeter: " <<
m_Perimeter << std::endl;
580 os << indent <<
"Elongation: " <<
m_Elongation << std::endl;
581 os << indent <<
"Flatness: " <<
m_Flatness << std::endl;
582 os << indent <<
"Roundness: " <<
m_Roundness << std::endl;
583 os << indent <<
"Centroid: " <<
m_Centroid << std::endl;
584 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
Superclass::LengthType LengthType
Superclass::LabelObjectType LabelObjectType
Point< double, VImageDimension > CentroidType
VectorType m_PrincipalMoments
void SetEquivalentEllipsoidDiameter(const VectorType &v)
static const AttributeType BOUNDING_BOX
virtual void CopyAttributesFrom(const Self *src)
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
static const AttributeType PERIMETER_ON_BORDER_RATIO
Implements a weak reference to an object.
static const AttributeType CENTROID
const double & GetFlatness() const
LabelObjectLine< VImageDimension > LineType
void Fill(const ValueType &)
static const AttributeType NUMBER_OF_PIXELS
MatrixType m_PrincipalAxes
virtual void CopyAttributesFrom(const LabelObjectType *lo)
static const AttributeType EQUIVALENT_SPHERICAL_RADIUS
unsigned int AttributeType
static const AttributeType PRINCIPAL_AXES
Index< VImageDimension > IndexType
static std::string GetNameFromAttribute(const AttributeType &a)
SizeValueType m_NumberOfPixels
void SetNumberOfPixels(const SizeValueType &v)
Superclass::IndexType IndexType
void SetNumberOfPixelsOnBorder(const SizeValueType &v)
const double & GetPhysicalSize() const
void operator=(const Self &)
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
Superclass::AttributeType AttributeType
Superclass::LineType LineType
AffineTransformPointer GetPhysicalAxesToPrincipalAxesTransform(void) const
static AttributeType GetAttributeFromName(const std::string &s)
const double & GetEquivalentSphericalPerimeter() const
const MatrixType & GetPrincipalAxes() const
A Label object to store the common attributes related to the shape of the object. ...
const double & GetFeretDiameter() const
const SizeValueType & GetNumberOfPixels() const
static const AttributeType PERIMETER
AffineTransformType::Pointer AffineTransformPointer
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
void PrintSelf(std::ostream &os, Indent indent) const
SmartPointer< const Self > ConstPointer
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
void SetPrincipalAxes(const MatrixType &v)
const double & GetPerimeterOnBorderRatio() const
double m_EquivalentSphericalRadius
AffineTransform< double, VImageDimension > AffineTransformType
static std::string GetNameFromAttribute(const AttributeType &a)
static const AttributeType EQUIVALENT_SPHERICAL_PERIMETER
AffineTransformPointer GetPrincipalAxesToPhysicalAxesTransform() const
SmartPointer< Self > Pointer
static const AttributeType ELONGATION
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE