Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::ContourElement Class Reference

Represents a contour in 3D space. A ContourElement is consisting of linked vertices implicitely defining the contour. They are stored in a double ended queue making it possible to add vertices at front and end of the contour and to iterate in both directions. To mark a vertex as a special one it can be set as a control point. More...

#include <mitkContourElement.h>

Inheritance diagram for mitk::ContourElement:
Collaboration diagram for mitk::ContourElement:

Classes

struct  ContourModelVertex
 Represents a single vertex of contour. More...
 

Public Types

typedef ContourModelVertex VertexType
 
typedef std::deque< VertexType * > VertexListType
 
typedef VertexListType::iterator VertexIterator
 
typedef VertexListType::const_iterator ConstVertexIterator
 

Public Member Functions

 mitkClassMacroItkParent (ContourElement, itk::LightObject)
 
Pointer Clone () const
 
virtual ConstVertexIterator ConstIteratorBegin ()
 Return a const iterator a the front. More...
 
virtual ConstVertexIterator ConstIteratorEnd ()
 Return a const iterator a the end. More...
 
virtual VertexIterator IteratorBegin ()
 Return an iterator a the front. More...
 
virtual VertexIterator IteratorEnd ()
 Return an iterator a the end. More...
 
virtual int GetSize ()
 Returns the number of contained vertices. More...
 
virtual void AddVertex (mitk::Point3D &point, bool isControlPoint)
 Add a vertex at the end of the contour. More...
 
virtual void AddVertex (VertexType &vertex)
 Add a vertex at the end of the contour. More...
 
virtual void AddVertexAtFront (mitk::Point3D &point, bool isControlPoint)
 Add a vertex at the front of the contour. More...
 
virtual void AddVertexAtFront (VertexType &vertex)
 Add a vertex at the front of the contour. More...
 
virtual void InsertVertexAtIndex (mitk::Point3D &point, bool isControlPoint, int index)
 Add a vertex at a given index of the contour. More...
 
virtual void SetVertexAt (int pointId, const mitk::Point3D &point)
 Set coordinates a given index. More...
 
virtual void SetVertexAt (int pointId, const VertexType *vertex)
 Set vertex a given index. More...
 
virtual VertexTypeGetVertexAt (int index)
 Returns the vertex a given index. More...
 
virtual VertexTypeGetVertexAt (const mitk::Point3D &point, float eps)
 Returns the approximate nearest vertex a given posoition in 3D space. More...
 
virtual int GetIndex (const VertexType *vertex)
 Returns the index of the given vertex within the contour. More...
 
VertexListTypeGetVertexList ()
 Returns the container of the vertices. More...
 
bool IsEmpty ()
 Returns whether the contour element is empty. More...
 
virtual bool IsClosed ()
 Returns if the conour is closed or not. More...
 
virtual bool IsNearContour (const mitk::Point3D &point, float eps)
 Returns whether a given point is near a contour, according to eps. More...
 
virtual void Close ()
 Close the contour. Connect first with last element. More...
 
virtual void Open ()
 Open the contour. Disconnect first and last element. More...
 
virtual void SetClosed (bool isClosed)
 Set the contours IsClosed property. More...
 
void Concatenate (mitk::ContourElement *other, bool check)
 Concatenate the contuor with a another contour. All vertices of the other contour will be added after last vertex. More...
 
virtual bool RemoveVertex (const VertexType *vertex)
 Remove the given vertex from the container if exists. More...
 
virtual bool RemoveVertexAt (int index)
 Remove a vertex at given index within the container if exists. More...
 
virtual bool RemoveVertexAt (mitk::Point3D &point, float eps)
 Remove the approximate nearest vertex at given position in 3D space if one exists. More...
 
virtual void Clear ()
 Clear the storage container. More...
 
VertexTypeBruteForceGetVertexAt (const mitk::Point3D &point, float eps)
 Returns the approximate nearest vertex a given posoition in 3D space. More...
 
VertexListTypeGetControlVertices ()
 Returns the approximate nearest vertex a given posoition in 3D space. More...
 
void RedistributeControlVertices (const VertexType *vertex, int period)
 Uniformly redistribute control points with a given period (in number of vertices) More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 mitkCloneMacro (Self)
 
 ContourElement ()
 
 ContourElement (const mitk::ContourElement &other)
 
virtual ~ContourElement ()
 

Protected Attributes

VertexListTypem_Vertices
 
bool m_IsClosed
 

Detailed Description

Represents a contour in 3D space. A ContourElement is consisting of linked vertices implicitely defining the contour. They are stored in a double ended queue making it possible to add vertices at front and end of the contour and to iterate in both directions. To mark a vertex as a special one it can be set as a control point.

It is highly not recommend to use this class directly as no secure mechanism is used here. Use mitk::ContourModel instead providing some additional features.

Definition at line 38 of file mitkContourElement.h.

Member Typedef Documentation

typedef VertexListType::const_iterator mitk::ContourElement::ConstVertexIterator

Definition at line 68 of file mitkContourElement.h.

typedef VertexListType::iterator mitk::ContourElement::VertexIterator

Definition at line 67 of file mitkContourElement.h.

Definition at line 66 of file mitkContourElement.h.

Constructor & Destructor Documentation

mitk::ContourElement::ContourElement ( )
protected

Definition at line 20 of file mitkContourElement.cpp.

References m_IsClosed, and m_Vertices.

mitk::ContourElement::ContourElement ( const mitk::ContourElement other)
protected

Definition at line 26 of file mitkContourElement.cpp.

mitk::ContourElement::~ContourElement ( )
protectedvirtual

Definition at line 31 of file mitkContourElement.cpp.

Member Function Documentation

void mitk::ContourElement::AddVertex ( mitk::Point3D point,
bool  isControlPoint 
)
virtual

Add a vertex at the end of the contour.

Parameters
point- coordinates in 3D space.
isControlPoint- is the vertex a special control point.

Definition at line 36 of file mitkContourElement.cpp.

void mitk::ContourElement::AddVertex ( VertexType vertex)
virtual

Add a vertex at the end of the contour.

Parameters
vertex- a contour element vertex.

Definition at line 41 of file mitkContourElement.cpp.

void mitk::ContourElement::AddVertexAtFront ( mitk::Point3D point,
bool  isControlPoint 
)
virtual

Add a vertex at the front of the contour.

Parameters
point- coordinates in 3D space.
isControlPoint- is the vertex a control point.

Definition at line 46 of file mitkContourElement.cpp.

void mitk::ContourElement::AddVertexAtFront ( VertexType vertex)
virtual

Add a vertex at the front of the contour.

Parameters
vertex- a contour element vertex.

Definition at line 51 of file mitkContourElement.cpp.

mitk::ContourElement::VertexType * mitk::ContourElement::BruteForceGetVertexAt ( const mitk::Point3D point,
float  eps 
)

Returns the approximate nearest vertex a given posoition in 3D space.

Parameters
point- query position in 3D space.
eps- the error bound for search algorithm.

Definition at line 105 of file mitkContourElement.cpp.

void mitk::ContourElement::Clear ( )
virtual

Clear the storage container.

Definition at line 433 of file mitkContourElement.cpp.

Pointer mitk::ContourElement::Clone ( ) const
void mitk::ContourElement::Close ( )
virtual

Close the contour. Connect first with last element.

Definition at line 278 of file mitkContourElement.cpp.

void mitk::ContourElement::Concatenate ( mitk::ContourElement other,
bool  check 
)

Concatenate the contuor with a another contour. All vertices of the other contour will be added after last vertex.

Parameters
other- the other contour
check- set it true to avoid intersections

Definition at line 312 of file mitkContourElement.cpp.

References GetSize(), and m_Vertices.

virtual ConstVertexIterator mitk::ContourElement::ConstIteratorBegin ( )
inlinevirtual

Return a const iterator a the front.

Definition at line 74 of file mitkContourElement.h.

virtual ConstVertexIterator mitk::ContourElement::ConstIteratorEnd ( )
inlinevirtual

Return a const iterator a the end.

Definition at line 77 of file mitkContourElement.h.

mitk::ContourElement::VertexListType * mitk::ContourElement::GetControlVertices ( )

Returns the approximate nearest vertex a given posoition in 3D space.

Parameters
point- query position in 3D space.
eps- the error bound for search algorithm.

Definition at line 293 of file mitkContourElement.cpp.

int mitk::ContourElement::GetIndex ( const VertexType vertex)
virtual

Returns the index of the given vertex within the contour.

Parameters
vertex- the vertex to be searched.
Returns
index of vertex. -1 if not found.

Definition at line 369 of file mitkContourElement.cpp.

virtual int mitk::ContourElement::GetSize ( )
inlinevirtual

Returns the number of contained vertices.

Definition at line 86 of file mitkContourElement.h.

Referenced by Concatenate().

mitk::ContourElement::VertexType * mitk::ContourElement::GetVertexAt ( int  index)
virtual

Returns the vertex a given index.

Parameters
index

Definition at line 83 of file mitkContourElement.cpp.

mitk::ContourElement::VertexType * mitk::ContourElement::GetVertexAt ( const mitk::Point3D point,
float  eps 
)
virtual

Returns the approximate nearest vertex a given posoition in 3D space.

Parameters
point- query position in 3D space.
eps- the error bound for search algorithm.

Definition at line 93 of file mitkContourElement.cpp.

mitk::ContourElement::VertexListType * mitk::ContourElement::GetVertexList ( )

Returns the container of the vertices.

Definition at line 224 of file mitkContourElement.cpp.

void mitk::ContourElement::InsertVertexAtIndex ( mitk::Point3D point,
bool  isControlPoint,
int  index 
)
virtual

Add a vertex at a given index of the contour.

Parameters
point- coordinates in 3D space.
isControlPoint- is the vertex a special control point.
index- the index to be inserted at.

Definition at line 56 of file mitkContourElement.cpp.

bool mitk::ContourElement::IsClosed ( )
virtual

Returns if the conour is closed or not.

Definition at line 229 of file mitkContourElement.cpp.

bool mitk::ContourElement::IsEmpty ( )

Returns whether the contour element is empty.

Definition at line 88 of file mitkContourElement.cpp.

bool mitk::ContourElement::IsNearContour ( const mitk::Point3D point,
float  eps 
)
virtual

Returns whether a given point is near a contour, according to eps.

Parameters
point- query position in 3D space.
eps- the error bound for search algorithm.

Definition at line 234 of file mitkContourElement.cpp.

virtual VertexIterator mitk::ContourElement::IteratorBegin ( )
inlinevirtual

Return an iterator a the front.

Definition at line 80 of file mitkContourElement.h.

virtual VertexIterator mitk::ContourElement::IteratorEnd ( )
inlinevirtual

Return an iterator a the end.

Definition at line 83 of file mitkContourElement.h.

mitk::ContourElement::mitkClassMacroItkParent ( ContourElement  ,
itk::LightObject   
)
mitk::ContourElement::mitkCloneMacro ( Self  )
protected
static Pointer mitk::ContourElement::New ( )
static
void mitk::ContourElement::Open ( )
virtual

Open the contour. Disconnect first and last element.

Definition at line 283 of file mitkContourElement.cpp.

void mitk::ContourElement::RedistributeControlVertices ( const VertexType vertex,
int  period 
)

Uniformly redistribute control points with a given period (in number of vertices)

Parameters
vertex- the vertex around which the redistribution is done.
period- number of vertices between control points.

Definition at line 438 of file mitkContourElement.cpp.

bool mitk::ContourElement::RemoveVertex ( const VertexType vertex)
virtual

Remove the given vertex from the container if exists.

Parameters
vertex- the vertex to be removed.

Definition at line 348 of file mitkContourElement.cpp.

bool mitk::ContourElement::RemoveVertexAt ( int  index)
virtual

Remove a vertex at given index within the container if exists.

Parameters
index- the index where the vertex should be removed.

Definition at line 392 of file mitkContourElement.cpp.

bool mitk::ContourElement::RemoveVertexAt ( mitk::Point3D point,
float  eps 
)
virtual

Remove the approximate nearest vertex at given position in 3D space if one exists.

Parameters
point- query point in 3D space.
eps- error bound for search algorithm.

Definition at line 405 of file mitkContourElement.cpp.

References mitk::eps.

void mitk::ContourElement::SetClosed ( bool  isClosed)
virtual

Set the contours IsClosed property.

Parameters
isClosed- true = closed; false = open;

Definition at line 288 of file mitkContourElement.cpp.

void mitk::ContourElement::SetVertexAt ( int  pointId,
const mitk::Point3D point 
)
virtual

Set coordinates a given index.

Parameters
pointIdIndex of vertex.
pointCoordinates.

Definition at line 66 of file mitkContourElement.cpp.

void mitk::ContourElement::SetVertexAt ( int  pointId,
const VertexType vertex 
)
virtual

Set vertex a given index.

Parameters
pointIdIndex of vertex.
vertexVertex.

Definition at line 74 of file mitkContourElement.cpp.

References mitk::ContourElement::ContourModelVertex::Coordinates, and mitk::ContourElement::ContourModelVertex::IsControlPoint.

Member Data Documentation

bool mitk::ContourElement::m_IsClosed
protected

Definition at line 235 of file mitkContourElement.h.

Referenced by ContourElement().

VertexListType* mitk::ContourElement::m_Vertices
protected

Definition at line 234 of file mitkContourElement.h.

Referenced by Concatenate(), and ContourElement().


The documentation for this class was generated from the following files: