21 #ifndef otbLabelObjectToPolygonFunctor_h
22 #define otbLabelObjectToPolygonFunctor_h
61 template <
class TLabelObject,
class TPolygon>
71 typedef typename LabelObjectType::LineType
LineType;
89 return "LabelObjectToPolygonFunctor";
249 #ifndef OTB_MANUAL_INSTANTIATION
This class vectorizes a LabelObject to a Polygon.
IndexType LeftEnd(const IndexType &runIndex) const
Return the left-end of the run.
std::vector< IndexType > IndexVectorType
Internal enums.
PolygonPointerType m_Polygon
Internal enums.
std::vector< LineType > RunsPerLineType
Internal structures.
SpacingType m_Spacing
Internal enums.
LabelObjectType::LineType LineType
RegionIndexType m_StartIndex
Internal enums.
IndexType RightMostLeftEndInside(unsigned int line, const IndexType &point, const IndexType &run) const
itk::Point< double, 2 > PointType
void SetStartIndex(const RegionIndexType &index)
RunsPerLineVectorType m_InternalDataSet
Internal enums.
const RegionIndexType & GetStartIndex() const
bool IsRunIndexValid(const IndexType &index) const
Check if the given run index (index in line, line) is valid.
LineType::IndexType IndexType
PolygonType::Pointer PolygonPointerType
PositionFlagType m_PositionFlag
The position flag.
void WalkRight(unsigned int line, const IndexType &startPoint, const IndexType &endPoint, PolygonType *polygon, const StateType state)
Walk right to update the finite states machine.
IndexType RightEnd(const IndexType &runIndex) const
Return the right-end of the run.
PolygonType * operator()(LabelObjectType *labelObject)
itk::Index< 2 > RegionIndexType
virtual ~LabelObjectToPolygonFunctor()
void SetSpacing(const SpacingType &spacing)
itk::Vector< double, 2 > SpacingType
const char * GetNameOfClass()
StateType m_CurrentState
The current state.
IndexType LeftMostRightEndInside(unsigned int line, const IndexType &point, const IndexType &run) const
IndexType m_CurrentPoint
The current point for vectorization.
IndexType m_StartingPoint
Internal enums.
void WalkLeft(unsigned int line, const IndexType &startPoint, const IndexType &endPoint, PolygonType *polygon, const StateType state)
Walk left to update the finite states machine.
PolygonType::VertexType VertexType
PositionFlagType
Internal enums.
int m_CurrentLine
The current line for vectorization.
static bool LexicographicalLineCompare(const LineType &l1, const LineType &l2)
Compare two line in the lexicographical order.
const SpacingType & GetSpacing() const
LabelObjectType::ConstLineIterator ConstLineIteratorType
void SetOrigin(const PointType &origin)
TLabelObject LabelObjectType
unsigned int m_LineOffset
The line offset from start of the region.
VertexType IndexToPoint(const VertexType &index) const
Internal enums.
PointType m_Origin
Internal enums.
const PointType & GetOrigin() const
IndexVectorType m_Solution
The vector of vectorized boundaries.
std::vector< RunsPerLineType > RunsPerLineVectorType
Internal enums.
IndexType m_CurrentRun
The current run for vectorization.
LabelObjectToPolygonFunctor()
IndexType Within(const IndexType &point, unsigned int line) const
Check if the point lies within the range of the line.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.