Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
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>
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 VertexType * | GetVertexAt (int index) |
Returns the vertex a given index. More... | |
virtual VertexType * | GetVertexAt (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... | |
VertexListType * | GetVertexList () |
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... | |
VertexType * | BruteForceGetVertexAt (const mitk::Point3D &point, float eps) |
Returns the approximate nearest vertex a given posoition in 3D space. More... | |
VertexListType * | GetControlVertices () |
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 | |
VertexListType * | m_Vertices |
bool | m_IsClosed |
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.
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.
typedef std::deque<VertexType *> mitk::ContourElement::VertexListType |
Definition at line 66 of file mitkContourElement.h.
Definition at line 65 of file mitkContourElement.h.
|
protected |
Definition at line 20 of file mitkContourElement.cpp.
References m_IsClosed, and m_Vertices.
|
protected |
Definition at line 26 of file mitkContourElement.cpp.
|
protectedvirtual |
Definition at line 31 of file mitkContourElement.cpp.
|
virtual |
Add a vertex at the end of the contour.
point | - coordinates in 3D space. |
isControlPoint | - is the vertex a special control point. |
Definition at line 36 of file mitkContourElement.cpp.
|
virtual |
Add a vertex at the end of the contour.
vertex | - a contour element vertex. |
Definition at line 41 of file mitkContourElement.cpp.
|
virtual |
Add a vertex at the front of the contour.
point | - coordinates in 3D space. |
isControlPoint | - is the vertex a control point. |
Definition at line 46 of file mitkContourElement.cpp.
|
virtual |
Add a vertex at the front of the contour.
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.
point | - query position in 3D space. |
eps | - the error bound for search algorithm. |
Definition at line 105 of file mitkContourElement.cpp.
|
virtual |
Clear the storage container.
Definition at line 433 of file mitkContourElement.cpp.
Pointer mitk::ContourElement::Clone | ( | ) | const |
|
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.
other | - the other contour |
check | - set it true to avoid intersections |
Definition at line 312 of file mitkContourElement.cpp.
References GetSize(), and m_Vertices.
|
inlinevirtual |
Return a const iterator a the front.
Definition at line 74 of file mitkContourElement.h.
|
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.
point | - query position in 3D space. |
eps | - the error bound for search algorithm. |
Definition at line 293 of file mitkContourElement.cpp.
|
virtual |
Returns the index of the given vertex within the contour.
vertex | - the vertex to be searched. |
Definition at line 369 of file mitkContourElement.cpp.
|
inlinevirtual |
Returns the number of contained vertices.
Definition at line 86 of file mitkContourElement.h.
Referenced by Concatenate().
|
virtual |
Returns the vertex a given index.
index |
Definition at line 83 of file mitkContourElement.cpp.
|
virtual |
Returns the approximate nearest vertex a given posoition in 3D space.
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.
|
virtual |
Add a vertex at a given index of the contour.
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.
|
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.
|
virtual |
Returns whether a given point is near a contour, according to eps.
point | - query position in 3D space. |
eps | - the error bound for search algorithm. |
Definition at line 234 of file mitkContourElement.cpp.
|
inlinevirtual |
Return an iterator a the front.
Definition at line 80 of file mitkContourElement.h.
|
inlinevirtual |
Return an iterator a the end.
Definition at line 83 of file mitkContourElement.h.
mitk::ContourElement::mitkClassMacroItkParent | ( | ContourElement | , |
itk::LightObject | |||
) |
|
protected |
|
static |
|
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)
vertex | - the vertex around which the redistribution is done. |
period | - number of vertices between control points. |
Definition at line 438 of file mitkContourElement.cpp.
|
virtual |
Remove the given vertex from the container if exists.
vertex | - the vertex to be removed. |
Definition at line 348 of file mitkContourElement.cpp.
|
virtual |
Remove a vertex at given index within the container if exists.
index | - the index where the vertex should be removed. |
Definition at line 392 of file mitkContourElement.cpp.
|
virtual |
Remove the approximate nearest vertex at given position in 3D space if one exists.
point | - query point in 3D space. |
eps | - error bound for search algorithm. |
Definition at line 405 of file mitkContourElement.cpp.
References mitk::eps.
|
virtual |
Set the contours IsClosed property.
isClosed | - true = closed; false = open; |
Definition at line 288 of file mitkContourElement.cpp.
|
virtual |
Set coordinates a given index.
pointId | Index of vertex. |
point | Coordinates. |
Definition at line 66 of file mitkContourElement.cpp.
|
virtual |
Set vertex a given index.
pointId | Index of vertex. |
vertex | Vertex. |
Definition at line 74 of file mitkContourElement.cpp.
References mitk::ContourElement::ContourModelVertex::Coordinates, and mitk::ContourElement::ContourModelVertex::IsControlPoint.
|
protected |
Definition at line 235 of file mitkContourElement.h.
Referenced by ContourElement().
|
protected |
Definition at line 234 of file mitkContourElement.h.
Referenced by Concatenate(), and ContourElement().