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);
520 template<
typename TSourceLabelObject >
523 Superclass::template CopyAttributesFrom<TSourceLabelObject>(src);
544 template<
typename TSourceLabelObject >
547 itkAssertOrThrowMacro ( ( src != ITK_NULLPTR ),
"Null Pointer" );
548 this->
template CopyLinesFrom<TSourceLabelObject>( src );
549 this->
template CopyAttributesFrom<TSourceLabelObject>( src );
579 os << indent <<
"Perimeter: " <<
m_Perimeter << std::endl;
583 os << indent <<
"Elongation: " <<
m_Elongation << std::endl;
584 os << indent <<
"Flatness: " <<
m_Flatness << std::endl;
585 os << indent <<
"Roundness: " <<
m_Roundness << std::endl;
586 os << indent <<
"Centroid: " <<
m_Centroid << std::endl;
587 os << indent <<
"BoundingBox: ";
599 void operator=(const
Self &) ITK_DELETE_FUNCTION;
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
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
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 PrintSelf(std::ostream &os, Indent indent) const override
void SetNumberOfPixels(const SizeValueType &v)
Superclass::IndexType IndexType
void SetNumberOfPixelsOnBorder(const SizeValueType &v)
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
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
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
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
void CopyAllFrom(const TSourceLabelObject *src)
AffineTransformPointer GetPrincipalAxesToPhysicalAxesTransform() const
SmartPointer< Self > Pointer
static const AttributeType ELONGATION