22 #ifndef otbShapeAttributesLabelMapFilter_h
23 #define otbShapeAttributesLabelMapFilter_h
25 #include "itkConfigure.h"
48 template<
unsigned int VOffsetDimension >
52 bool operator()(itk::Offset< VOffsetDimension >
const & l,
53 itk::Offset< VOffsetDimension >
const & r)
const
55 for (
unsigned int i = 0; i < VOffsetDimension; ++i ) {
59 else if ( l[i] > r[i] ) {
74 template <
class TLabelObject,
class TLabelImage>
99 itkStaticConstMacro(
ImageDimension,
unsigned int, TLabelObject::ImageDimension);
100 typedef itk::ImageRegion< TLabelObject::ImageDimension >
RegionType;
101 typedef itk::Offset< TLabelObject::ImageDimension >
OffsetType;
186 typedef std::map<Offset2Type, itk::SizeValueType, OffsetLexicographicCompare2>
MapIntercept2Type;
187 typedef std::map<Offset3Type, itk::SizeValueType, OffsetLexicographicCompare3>
MapIntercept3Type;
188 template<
class TMapIntercept,
class TSpacing>
double PerimeterFromInterceptCount( TMapIntercept & intercepts,
const TSpacing & spacing );
190 #if !defined(ITK_DO_NOT_USE_PERIMETER_SPECIALIZATION)
241 template <
class TImage,
class TLabelImage = Image<
typename TImage::PixelType, TImage::ImageDimension>>
262 itkStaticConstMacro(ImageDimension,
unsigned int, TImage::ImageDimension);
274 void SetComputeFeretDiameter(
bool flag);
275 bool GetComputeFeretDiameter()
const;
276 itkBooleanMacro(ComputeFeretDiameter);
283 void SetComputePerimeter(
bool flag);
284 bool GetComputePerimeter()
const;
285 itkBooleanMacro(ComputePerimeter);
292 void SetComputePolygon(
bool flag);
293 bool GetComputePolygon()
const;
294 itkBooleanMacro(ComputePolygon);
301 void SetComputeFlusser(
bool flag);
302 bool GetComputeFlusser()
const;
303 itkBooleanMacro(ComputeFlusser);
308 void SetReducedAttributeSet(
bool flag);
309 bool GetReducedAttributeSet()
const;
310 itkBooleanMacro(ReducedAttributeSet);
315 void SetLabelImage(
const TLabelImage*);
316 const TLabelImage* GetLabelImage()
const;
331 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
333 void AllocateOutputs()
override;
336 void BeforeThreadedGenerateData()
override;
338 void GenerateInputRequestedRegion()
override;
350 #ifndef OTB_MANUAL_INSTANTIATION
Calculate the Flusser's invariant parameters.
This class vectorizes a LabelObject to a Polygon.
Order Offset instances lexicographically.
bool operator()(itk::Offset< VOffsetDimension > const &l, itk::Offset< VOffsetDimension > const &r) const
Functor to compute shape attributes of one LabelObject.
static const unsigned int ImageDimension
bool m_ComputeFeretDiameter
static double hyperSpherePerimeter(double radius)
bool operator!=(const Self &self)
std::map< Offset2Type, itk::SizeValueType, OffsetLexicographicCompare2 > MapIntercept2Type
LabelObjectType::ConstLineIterator ConstLineIteratorType
Functor::LabelObjectToPolygonFunctor< LabelObjectType, PolygonType > PolygonFunctorType
otb::Functor::OffsetLexicographicCompare< 3 > OffsetLexicographicCompare3
static long factorial(long n)
void operator()(LabelObjectType *lo)
itk::Vector< double, 2 > Spacing2Type
void SetReducedAttributeSet(bool flag)
void SetComputeFlusser(bool flag)
static double gammaN2p1(long n)
void SetComputeFeretDiameter(bool flag)
double ComputePerimeter(LabelObjectType *labelObject, const RegionType ®ion)
static long doubleFactorial(long n)
itk::Offset< 3 > Offset3Type
bool m_ReducedAttributeSet
const TLabelImage * GetLabelImage() const
itk::ImageRegion< TLabelObject::ImageDimension > RegionType
bool GetComputePerimeter() const
itk::Offset< TLabelObject::ImageDimension > OffsetType
static double hyperSphereVolume(double radius)
unsigned int DimensionType
void SetComputePerimeter(bool flag)
TLabelObject::PolygonType PolygonType
otb::Functor::OffsetLexicographicCompare< TLabelObject::ImageDimension > OffsetLexicographicCompare
otb::Functor::OffsetLexicographicCompare< 2 > OffsetLexicographicCompare2
itk::Vector< double, 3 > Spacing3Type
bool GetComputePolygon() const
static double hyperSphereRadiusFromVolume(double volume)
void SetLabelImage(const TLabelImage *image)
ShapeAttributesLabelObjectFunctor()
void SetComputePolygon(bool flag)
bool GetReducedAttributeSet() const
TLabelImage LabelImageType
TLabelObject LabelObjectType
itk::Offset< 2 > Offset2Type
FlusserPathFunction< PolygonType > FlusserPathFunctionType
LabelImageType::ConstPointer m_LabelImage
SimplifyPathFunctor< PolygonType, PolygonType > SimplifyPolygonFunctorType
bool operator==(const Self &self)
ShapeAttributesLabelObjectFunctor Self
bool GetComputeFeretDiameter() const
double PerimeterFromInterceptCount(TMapIntercept &intercepts, const TSpacing &spacing)
bool GetComputeFlusser() const
virtual ~ShapeAttributesLabelObjectFunctor()
std::map< Offset3Type, itk::SizeValueType, OffsetLexicographicCompare3 > MapIntercept3Type
This class applies a functor to compute new features.
This class is a fork of the itk::ShapeLabelMapFilter working with AttributesMapLabelObject.
itk::SmartPointer< const Self > ConstPointer
ImageType::Pointer ImagePointer
ImageType::LabelObjectType LabelObjectType
LabelMapFeaturesFunctorImageFilter< ImageType, FunctorType > Superclass
ShapeAttributesLabelMapFilter()
~ShapeAttributesLabelMapFilter() override
ShapeAttributesLabelMapFilter Self
Functor::ShapeAttributesLabelObjectFunctor< LabelObjectType, LabelImageType > FunctorType
ShapeAttributesLabelMapFilter(const Self &)=delete
void EnlargeOutputRequestedRegion(itk::DataObject *) override
itk::SmartPointer< Self > Pointer
void operator=(const Self &)=delete
TLabelImage LabelImageType
ImageType::RegionType InputImageRegionType
This filter performs a simplification of the input path.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.