Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are stored in a mitk::ContourElement is stored for each timestep. The contour line segments are implicitly defined by the given linked vertices. By default two control points are are linked by a straight line.It is possible to add vertices at front and end of the contour and to iterate in both directions. More...
#include <mitkContourModel.h>
Public Types | |
enum | LineSegmentInterpolation { LINEAR, B_SPLINE } |
Possible interpolation of the line segments between control points. More... | |
typedef mitk::ContourElement::VertexType | VertexType |
typedef mitk::ContourElement::VertexListType | VertexListType |
typedef mitk::ContourElement::VertexIterator | VertexIterator |
typedef mitk::ContourElement::ConstVertexIterator | ConstVertexIterator |
typedef std::vector< mitk::ContourElement::Pointer > | ContourModelSeries |
![]() | |
typedef BaseData | Self |
typedef itk::DataObject | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
![]() | |
using | UIDType = std::string |
Public Member Functions | |
mitkClassMacro (ContourModel, BaseData) | |
Pointer | Clone () const |
VertexType * | GetSelectedVertex () |
Get the current selected vertex. More... | |
void | Deselect () |
Deselect vertex. More... | |
void | SetSelectedVertexAsControlPoint (bool isControlPoint=true) |
Set selected vertex as control point. More... | |
void | SetLineSegmentInterpolation (LineSegmentInterpolation interpolation) |
Set the interpolation of the line segments between control points. More... | |
LineSegmentInterpolation | GetLineSegmentInterpolation () |
Get the interpolation of the line segments between control points. More... | |
void | AddVertex (mitk::Point3D &vertex, int timestep=0) |
Add a vertex to the contour at given timestep. The vertex is added at the end of contour. More... | |
void | AddVertex (VertexType &vertex, int timestep=0) |
Add a vertex to the contour at given timestep. The vertex is added at the end of contour. More... | |
void | AddVertex (const VertexType *vertex, int timestep=0) |
Add a vertex to the contour at given timestep. The vertex is added at the end of contour. More... | |
void | AddVertex (mitk::Point3D &vertex, bool isControlPoint, int timestep=0) |
Add a vertex to the contour. More... | |
void | AddVertexAtFront (mitk::Point3D &vertex, int timestep=0) |
Add a vertex to the contour at given timestep AT THE FRONT of the contour. The vertex is added at the FRONT of contour. More... | |
void | AddVertexAtFront (VertexType &vertex, int timestep=0) |
Add a vertex to the contour at given timestep AT THE FRONT of the contour. The vertex is added at the FRONT of contour. More... | |
void | AddVertexAtFront (mitk::Point3D &vertex, bool isControlPoint, int timestep=0) |
Add a vertex to the contour at given timestep AT THE FRONT of the contour. More... | |
void | InsertVertexAtIndex (mitk::Point3D &vertex, int index, bool isControlPoint=false, int timestep=0) |
Insert a vertex at given index. More... | |
bool | SetVertexAt (int pointId, const mitk::Point3D &point, unsigned int timestep=0) |
Set a coordinates for point at given index. More... | |
bool | SetVertexAt (int pointId, const VertexType *vertex, unsigned int timestep=0) |
Set a coordinates for point at given index. More... | |
bool | IsClosed (int timestep=0) const |
Return if the contour is closed or not. More... | |
void | Concatenate (mitk::ContourModel *other, int timestep=0, bool check=false) |
Concatenate two contours. The starting control point of the other will be added at the end of the contour. timestep - the timestep at which the vertex will be add ( default 0) check - check for intersections ( default false) More... | |
VertexIterator | Begin (int timestep=0) const |
Returns a const VertexIterator at the start element of the contour. More... | |
VertexIterator | IteratorBegin (int timestep=0) const |
Returns a const VertexIterator at the start element of the contour. More... | |
VertexIterator | End (int timestep=0) const |
Returns a const VertexIterator at the end element of the contour. More... | |
VertexIterator | IteratorEnd (int timestep=0) const |
Returns a const VertexIterator at the end element of the contour. More... | |
virtual void | Close (int timestep=0) |
Close the contour. The last control point will be linked with the first point. More... | |
virtual void | Open (int timestep=0) |
Set isClosed to false contour. The link between the last control point the first point will be removed. More... | |
virtual void | SetClosed (bool isClosed, int timestep=0) |
Set closed property to given boolean. More... | |
int | GetNumberOfVertices (int timestep=0) const |
Returns the number of vertices at a given timestep. More... | |
virtual bool | IsEmpty (int timestep) const |
Returns whether the contour model is empty at a given timestep. timestep - default = 0. More... | |
bool | IsEmpty () const override |
Returns whether the contour model is empty. More... | |
virtual const VertexType * | GetVertexAt (int index, int timestep=0) const |
Returns the vertex at the index position within the container. More... | |
int | GetIndex (const VertexType *vertex, int timestep=0) |
Remove a vertex at given timestep within the container. More... | |
bool | IsEmptyTimeStep (unsigned int t) const override |
Check if there isn't something at this timestep. More... | |
virtual bool | IsNearContour (mitk::Point3D &point, float eps, int timestep) |
Check if mouse cursor is near the contour. More... | |
bool | SelectVertexAt (int index, int timestep=0) |
Mark a vertex at an index in the container as selected. More... | |
bool | SetControlVertexAt (int index, int timestep=0) |
Mark a vertex at an index in the container as control point. More... | |
bool | SelectVertexAt (mitk::Point3D &point, float eps, int timestep=0) |
Mark a vertex at a given position in 3D space. More... | |
bool | SetControlVertexAt (mitk::Point3D &point, float eps, int timestep=0) |
bool | RemoveVertexAt (int index, int timestep=0) |
Remove a vertex at given index within the container. More... | |
bool | RemoveVertex (const VertexType *vertex, int timestep=0) |
Remove a vertex at given timestep within the container. More... | |
bool | RemoveVertexAt (mitk::Point3D &point, float eps, int timestep=0) |
Remove a vertex at a query position in 3D space. More... | |
void | ShiftSelectedVertex (mitk::Vector3D &translate) |
Shift the currently selected vertex by a translation vector. More... | |
void | ShiftContour (mitk::Vector3D &translate, int timestep=0) |
Shift the whole contour by a translation vector at given timestep. More... | |
virtual void | Clear (int timestep) |
Clear the storage container at given timestep. More... | |
void | Initialize () override |
Initialize all data objects. More... | |
void | Initialize (mitk::ContourModel &other) |
Initialize object with specs of other contour. Note: No data will be copied. More... | |
void | SetRequestedRegionToLargestPossibleRegion () override |
Inherit from base data - no region support available for contourModel objects. More... | |
bool | RequestedRegionIsOutsideOfTheBufferedRegion () override |
Inherit from base data - no region support available for contourModel objects. More... | |
bool | VerifyRequestedRegion () override |
Inherit from base data - no region support available for contourModel objects. More... | |
virtual const mitk::BaseGeometry * | GetUpdatedGeometry (int t=0) |
Get the updated geometry with recomputed bounds. More... | |
virtual mitk::BaseGeometry * | GetGeometry (int t=0) const |
Get the BaseGeometry for timestep t. More... | |
void | SetRequestedRegion (const itk::DataObject *data) override |
Inherit from base data - no region support available for contourModel objects. More... | |
void | Expand (unsigned int timeSteps) override |
Expand the timebounds of the TimeGeometry to given number of timesteps. More... | |
void | UpdateOutputInformation () override |
Update the OutputInformation of a ContourModel object. More... | |
void | Clear () override |
Clear the storage container. More... | |
void | ExecuteOperation (Operation *operation) override |
overwrite if the Data can be called by an Interactor (StateMachine). More... | |
virtual void | RedistributeControlVertices (int period, int timestep) |
Redistributes ontrol vertices with a given period (as number of vertices) More... | |
![]() | |
virtual std::vector< std::string > | GetClassHierarchy () const |
virtual const char * | GetClassName () const |
BaseProperty::ConstPointer | GetConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const override |
Get property by its key. More... | |
std::vector< std::string > | GetPropertyKeys (const std::string &contextName="", bool includeDefaultContext=false) const override |
Query keys of existing properties. More... | |
std::vector< std::string > | GetPropertyContextNames () const override |
Query names of existing contexts. More... | |
BaseProperty * | GetNonConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) override |
Get property by its key. More... | |
void | SetProperty (const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override |
Add new or change existent property. More... | |
void | RemoveProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=false) override |
Removes a property. If the property does not exist, nothing will be done. More... | |
const mitk::TimeGeometry * | GetTimeGeometry () const |
Return the TimeGeometry of the data as const pointer. More... | |
const mitk::TimeGeometry * | GetTimeSlicedGeometry () const |
Return the TimeGeometry of the data as const pointer. More... | |
mitk::TimeGeometry * | GetTimeGeometry () |
Return the TimeGeometry of the data as pointer. More... | |
const mitk::TimeGeometry * | GetUpdatedTimeGeometry () |
Return the TimeGeometry of the data. More... | |
const mitk::TimeGeometry * | GetUpdatedTimeSliceGeometry () |
Return the TimeGeometry of the data. More... | |
const mitk::BaseGeometry * | GetUpdatedGeometry (int t=0) |
Return the BaseGeometry of the data at time t. More... | |
mitk::BaseGeometry * | GetGeometry (int t=0) const |
Return the geometry, which is a TimeGeometry, of the data as non-const pointer. More... | |
void | UpdateOutputInformation () override |
Update the information for this BaseData (the geometry in particular) so that it can be used as an output of a BaseProcess. More... | |
void | CopyInformation (const itk::DataObject *data) override |
Copy information from the specified data set. More... | |
virtual bool | IsInitialized () const |
Check whether the data has been initialized, i.e., at least the Geometry and other header data has been set. More... | |
void | ExecuteOperation (Operation *operation) override |
overwrite if the Data can be called by an Interactor (StateMachine). More... | |
virtual void | SetGeometry (BaseGeometry *aGeometry3D) |
Set the BaseGeometry of the data, which will be referenced (not copied!). Assumes the data object has only 1 time step ( is a 3D object ) and creates a new TimeGeometry which saves the given BaseGeometry. If an TimeGeometry has already been set for the object, it will be replaced after calling this function. More... | |
virtual void | SetTimeGeometry (TimeGeometry *geometry) |
Set the TimeGeometry of the data, which will be referenced (not copied!). More... | |
virtual void | SetClonedGeometry (const BaseGeometry *aGeometry3D) |
Set a clone of the provided Geometry as Geometry of the data. Assumes the data object has only 1 time step ( is a 3D object ) and creates a new TimeGeometry. If an TimeGeometry has already been set for the object, it will be replaced after calling this function. More... | |
virtual void | SetClonedTimeGeometry (const TimeGeometry *geometry) |
Set a clone of the provided TimeGeometry as TimeGeometry of the data. More... | |
virtual void | SetClonedGeometry (const BaseGeometry *aGeometry3D, unsigned int time) |
Set a clone of the provided geometry as BaseGeometry of a given time step. More... | |
mitk::PropertyList::Pointer | GetPropertyList () const |
Get the data's property list. More... | |
void | SetPropertyList (PropertyList *propertyList) |
Set the data's property list. More... | |
mitk::BaseProperty::Pointer | GetProperty (const char *propertyKey) const |
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList, and set it to this, respectively;. More... | |
void | SetProperty (const char *propertyKey, BaseProperty *property) |
virtual void | SetOrigin (const Point3D &origin) |
Convenience method for setting the origin of the BaseGeometry instances of all time steps. More... | |
itk::SmartPointer< mitk::BaseDataSource > | GetSource () const |
Get the process object that generated this data object. More... | |
unsigned int | GetTimeSteps () const |
Get the number of time steps from the TimeGeometry As the base data has not a data vector given by itself, the number of time steps is defined over the time sliced geometry. In sub classes, a better implementation could be over the length of the data vector. More... | |
unsigned long | GetMTime () const override |
Get the modified time of the last change of the contents this data object or its geometry. More... | |
void | Graft (const DataObject *) override |
![]() | |
itkTypeMacroNoParent (OperationActor) virtual ~OperationActor() | |
![]() | |
Identifiable () | |
Identifiable (const UIDType &uid) | |
Identifiable (const Identifiable &)=delete | |
Identifiable (Identifiable &&) noexcept | |
virtual | ~Identifiable () |
Identifiable & | operator= (const Identifiable &)=delete |
Identifiable & | operator= (Identifiable &&other) noexcept |
UIDType | GetUID () const |
Get unique ID of an object. More... | |
![]() | |
~IPropertyOwner () override | |
![]() | |
virtual | ~IPropertyProvider () |
Static Public Member Functions | |
static Pointer | New () |
![]() | |
static const char * | GetStaticNameOfClass () |
Protected Member Functions | |
mitkCloneMacro (Self) | |
ContourModel () | |
ContourModel (const mitk::ContourModel &other) | |
~ContourModel () override | |
void | ClearData () override |
reset to non-initialized state, release memory More... | |
void | InitializeEmpty () override |
Pure virtual; Must be used in subclasses to get a data object to a valid state. Should at least create one empty object and call Superclass::InitializeTimeGeometry() to ensure an existing valid geometry. More... | |
void | ShiftVertex (VertexType *vertex, mitk::Vector3D &vector) |
![]() | |
BaseData () | |
BaseData (const BaseData &other) | |
~BaseData () override | |
virtual void | InitializeTimeGeometry (unsigned int timeSteps=1) |
Initialize the TimeGeometry for a number of time steps. The TimeGeometry is initialized empty and evenly timed. In many cases it will be necessary to overwrite this in sub-classes. More... | |
virtual void | InitializeTimeSlicedGeometry (unsigned int timeSteps=1) |
Initialize the TimeGeometry for a number of time steps. The TimeGeometry is initialized empty and evenly timed. In many cases it will be necessary to overwrite this in sub-classes. More... | |
void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
Protected Attributes | |
ContourModelSeries | m_ContourSeries |
VertexType * | m_SelectedVertex |
LineSegmentInterpolation | m_lineInterpolation |
bool | m_UpdateBoundingBox |
![]() | |
bool | m_LastRequestedRegionWasOutsideOfTheBufferedRegion |
unsigned int | m_SourceOutputIndexDuplicate |
bool | m_Initialized |
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are stored in a mitk::ContourElement is stored for each timestep. The contour line segments are implicitly defined by the given linked vertices. By default two control points are are linked by a straight line.It is possible to add vertices at front and end of the contour and to iterate in both directions.
Points are specified containing coordinates and additional (data) information, see mitk::ContourElement. For accessing a specific vertex either an index or a position in 3D Space can be used. The vertices are best accessed by using a VertexIterator. Interaction with the contour is thus available without any mitk interactor class using the api of ContourModel. It is possible to shift single vertices also as shifting the whole contour.
A contour can be either open like a single curved line segment or closed. A closed contour can for example represent a jordan curve.
The default mappers for this data structure are mitk::ContourModelGLMapper2D and mitk::ContourModelMapper3D. See these classes for display options which can can be set via properties.
Definition at line 47 of file mitkContourModel.h.
Definition at line 60 of file mitkContourModel.h.
typedef std::vector<mitk::ContourElement::Pointer> mitk::ContourModel::ContourModelSeries |
Definition at line 61 of file mitkContourModel.h.
Definition at line 59 of file mitkContourModel.h.
Definition at line 58 of file mitkContourModel.h.
Definition at line 54 of file mitkContourModel.h.
Possible interpolation of the line segments between control points.
Enumerator | |
---|---|
LINEAR | |
B_SPLINE |
Definition at line 65 of file mitkContourModel.h.
|
protected |
Definition at line 15 of file mitkContourModel.cpp.
References InitializeEmpty().
|
protected |
Definition at line 21 of file mitkContourModel.cpp.
References m_SelectedVertex.
|
overrideprotected |
Definition at line 27 of file mitkContourModel.cpp.
References m_ContourSeries, and m_SelectedVertex.
void mitk::ContourModel::AddVertex | ( | mitk::Point3D & | vertex, |
int | timestep = 0 |
||
) |
Add a vertex to the contour at given timestep. The vertex is added at the end of contour.
vertex | - coordinate representation of a control point |
timestep | - the timestep at which the vertex will be add ( default 0) |
Adding a vertex to a timestep which exceeds the timebounds of the contour will not be added, the TimeGeometry will not be expanded.
Definition at line 33 of file mitkContourModel.cpp.
References IsEmptyTimeStep().
Referenced by mitk::ContourTool::OnMouseMoved(), mitk::CorrectorTool2D::OnMouseMoved(), mitk::ContourTool::OnMousePressed(), mitk::CorrectorTool2D::OnMousePressed(), and mitk::ContourModelLiveWireInteractor::SplitContourFromSelectedVertex().
void mitk::ContourModel::AddVertex | ( | VertexType & | vertex, |
int | timestep = 0 |
||
) |
Add a vertex to the contour at given timestep. The vertex is added at the end of contour.
vertex | - coordinate representation of a control point |
timestep | - the timestep at which the vertex will be add ( default 0) |
Adding a vertex to a timestep which exceeds the timebounds of the contour will not be added, the TimeGeometry will not be expanded.
Definition at line 52 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
void mitk::ContourModel::AddVertex | ( | const VertexType * | vertex, |
int | timestep = 0 |
||
) |
Add a vertex to the contour at given timestep. The vertex is added at the end of contour.
vertex | - coordinate representation of a control point |
timestep | - the timestep at which the vertex will be add ( default 0) |
Adding a vertex to a timestep which exceeds the timebounds of the contour will not be added, the TimeSlicedGeometry will not be expanded.
Definition at line 63 of file mitkContourModel.cpp.
References m_ContourSeries.
void mitk::ContourModel::AddVertex | ( | mitk::Point3D & | vertex, |
bool | isControlPoint, | ||
int | timestep = 0 |
||
) |
Add a vertex to the contour.
vertex | - coordinate representation of a control point |
timestep | - the timestep at which the vertex will be add ( default 0) |
isControlPoint | - specifies the vertex to be handled in a special way (e.g. control points will be rendered). |
Adding a vertex to a timestep which exceeds the timebounds of the contour will not be added, the TimeGeometry will not be expanded.
Definition at line 41 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
void mitk::ContourModel::AddVertexAtFront | ( | mitk::Point3D & | vertex, |
int | timestep = 0 |
||
) |
Add a vertex to the contour at given timestep AT THE FRONT of the contour. The vertex is added at the FRONT of contour.
vertex | - coordinate representation of a control point |
timestep | - the timestep at which the vertex will be add ( default 0) |
Adding a vertex to a timestep which exceeds the timebounds of the contour will not be added, the TimeGeometry will not be expanded.
Definition at line 71 of file mitkContourModel.cpp.
References IsEmptyTimeStep().
void mitk::ContourModel::AddVertexAtFront | ( | VertexType & | vertex, |
int | timestep = 0 |
||
) |
Add a vertex to the contour at given timestep AT THE FRONT of the contour. The vertex is added at the FRONT of contour.
vertex | - coordinate representation of a control point |
timestep | - the timestep at which the vertex will be add ( default 0) |
Adding a vertex to a timestep which exceeds the timebounds of the contour will not be added, the TimeGeometry will not be expanded.
Definition at line 90 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
void mitk::ContourModel::AddVertexAtFront | ( | mitk::Point3D & | vertex, |
bool | isControlPoint, | ||
int | timestep = 0 |
||
) |
Add a vertex to the contour at given timestep AT THE FRONT of the contour.
vertex | - coordinate representation of a control point |
timestep | - the timestep at which the vertex will be add ( default 0) |
isControlPoint | - specifies the vertex to be handled in a special way (e.g. control points will be rendered). |
Adding a vertex to a timestep which exceeds the timebounds of the contour will not be added, the TimeGeometry will not be expanded.
Definition at line 79 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
mitk::ContourModel::VertexIterator mitk::ContourModel::Begin | ( | int | timestep = 0 | ) | const |
Returns a const VertexIterator at the start element of the contour.
mitk::Exception | if the timestep is invalid. |
Definition at line 252 of file mitkContourModel.cpp.
References IteratorBegin().
Referenced by mitk::ContourModelUtils::BackProjectContourFrom2DSlice(), mitk::ContourModelSetMapper3D::GenerateDataForRenderer(), mitk::ContourModelUtils::MoveZerothContourTimeStep(), mitk::CorrectorTool2D::OnMouseReleased(), and mitk::ContourModelUtils::ProjectContourTo2DSlice().
|
virtual |
Clear the storage container at given timestep.
All control points are removed at timestep.
Definition at line 426 of file mitkContourModel.cpp.
References InitializeEmpty(), IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
Referenced by mitk::ContourModelLiveWireInteractor::OnFinishEditing().
|
overridevirtual |
Clear the storage container.
The object is set to initial state. All control points are removed and the number of timesteps are set to 1.
Reimplemented from mitk::BaseData.
Definition at line 488 of file mitkContourModel.cpp.
References ClearData(), InitializeEmpty(), and m_UpdateBoundingBox.
|
overrideprotectedvirtual |
reset to non-initialized state, release memory
Reimplemented from mitk::BaseData.
Definition at line 508 of file mitkContourModel.cpp.
References m_ContourSeries.
Referenced by Clear().
Pointer mitk::ContourModel::Clone | ( | ) | const |
|
virtual |
Close the contour. The last control point will be linked with the first point.
Definition at line 191 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
void mitk::ContourModel::Concatenate | ( | mitk::ContourModel * | other, |
int | timestep = 0 , |
||
bool | check = false |
||
) |
Concatenate two contours. The starting control point of the other will be added at the end of the contour. timestep - the timestep at which the vertex will be add ( default 0) check - check for intersections ( default false)
Definition at line 238 of file mitkContourModel.cpp.
References IsClosed(), IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
|
inline |
Deselect vertex.
Definition at line 78 of file mitkContourModel.h.
Referenced by mitk::ContourModelInteractor::OnCheckPointClick(), and mitk::ContourModelInteractor::OnFinishEditing().
mitk::ContourModel::VertexIterator mitk::ContourModel::End | ( | int | timestep = 0 | ) | const |
Returns a const VertexIterator at the end element of the contour.
mitk::Exception | if the timestep is invalid. |
Definition at line 270 of file mitkContourModel.cpp.
References IteratorEnd().
Referenced by mitk::ContourModelUtils::BackProjectContourFrom2DSlice(), mitk::ContourModelSetMapper3D::GenerateDataForRenderer(), mitk::ContourModelUtils::MoveZerothContourTimeStep(), mitk::CorrectorTool2D::OnMouseReleased(), and mitk::ContourModelUtils::ProjectContourTo2DSlice().
|
overridevirtual |
overwrite if the Data can be called by an Interactor (StateMachine).
Implements mitk::OperationActor.
Definition at line 632 of file mitkContourModel.cpp.
|
overridevirtual |
Expand the timebounds of the TimeGeometry to given number of timesteps.
Reimplemented from mitk::BaseData.
Definition at line 438 of file mitkContourModel.cpp.
References m_ContourSeries, and mitk::ContourElement::New().
Referenced by mitk::ContourTool::OnMousePressed(), and mitk::CorrectorTool2D::OnMousePressed().
|
virtual |
Get the BaseGeometry for timestep t.
Definition at line 478 of file mitkContourModel.cpp.
Referenced by UpdateOutputInformation().
int mitk::ContourModel::GetIndex | ( | const VertexType * | vertex, |
int | timestep = 0 |
||
) |
Remove a vertex at given timestep within the container.
Definition at line 182 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), and m_ContourSeries.
|
inline |
Get the interpolation of the line segments between control points.
Definition at line 100 of file mitkContourModel.h.
References mitk::eps, and mitkCloneMacro.
int mitk::ContourModel::GetNumberOfVertices | ( | int | timestep = 0 | ) | const |
Returns the number of vertices at a given timestep.
timestep | - default = 0 |
Definition at line 164 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), and m_ContourSeries.
Referenced by mitk::ContourModelSetToImageFilter::GenerateData(), mitk::ContourModelSetMapper3D::GenerateDataForRenderer(), mitk::ContourModelLiveWireInteractor::OnDeletePoint(), and mitk::RegionGrowingTool::OnMouseReleased().
|
inline |
Get the current selected vertex.
Definition at line 75 of file mitkContourModel.h.
Referenced by mitk::ContourModelGLMapper2DBase::InternalDrawContour(), RedistributeControlVertices(), and mitk::ContourModelLiveWireInteractor::SplitContourFromSelectedVertex().
|
virtual |
Get the updated geometry with recomputed bounds.
Definition at line 473 of file mitkContourModel.cpp.
|
virtual |
Returns the vertex at the index position within the container.
Definition at line 173 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), and m_ContourSeries.
Referenced by mitk::ContourModelSetToImageFilter::GenerateData(), mitk::ContourModelGLMapper2DBase::InternalDrawContour(), mitk::RegionGrowingTool::OnMouseReleased(), and SelectVertexAt().
|
override |
Initialize all data objects.
Definition at line 517 of file mitkContourModel.cpp.
References InitializeEmpty(), and m_UpdateBoundingBox.
Referenced by mitk::ContourTool::OnMousePressed(), and mitk::CorrectorTool2D::OnMousePressed().
void mitk::ContourModel::Initialize | ( | mitk::ContourModel & | other | ) |
Initialize object with specs of other contour. Note: No data will be copied.
Definition at line 524 of file mitkContourModel.cpp.
References mitk::TimeGeometry::CountTimeSteps(), mitk::BaseData::GetTimeGeometry(), mitk::BaseData::InitializeTimeGeometry(), IsClosed(), m_ContourSeries, m_lineInterpolation, m_SelectedVertex, m_UpdateBoundingBox, mitk::ContourElement::New(), and SetClosed().
|
overrideprotectedvirtual |
Pure virtual; Must be used in subclasses to get a data object to a valid state. Should at least create one empty object and call Superclass::InitializeTimeGeometry() to ensure an existing valid geometry.
Reimplemented from mitk::BaseData.
Definition at line 541 of file mitkContourModel.cpp.
References mitk::BaseData::InitializeTimeGeometry(), LINEAR, m_ContourSeries, m_lineInterpolation, m_SelectedVertex, and mitk::ContourElement::New().
Referenced by Clear(), ContourModel(), and Initialize().
void mitk::ContourModel::InsertVertexAtIndex | ( | mitk::Point3D & | vertex, |
int | index, | ||
bool | isControlPoint = false , |
||
int | timestep = 0 |
||
) |
Insert a vertex at given index.
Definition at line 136 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
bool mitk::ContourModel::IsClosed | ( | int | timestep = 0 | ) | const |
Return if the contour is closed or not.
Definition at line 288 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), and m_ContourSeries.
Referenced by Concatenate(), mitk::ContourModelMapper3D::CreateVtkPolyDataFromContour(), Initialize(), mitk::ContourModelGLMapper2DBase::InternalDrawContour(), and mitk::ContourModelWriter::WriteXML().
|
virtual |
Returns whether the contour model is empty at a given timestep. timestep - default = 0.
Definition at line 150 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), and m_ContourSeries.
Referenced by mitk::ContourModelLiveWireInteractor::OnDeletePoint().
|
overridevirtual |
Returns whether the contour model is empty.
Reimplemented from mitk::BaseData.
Definition at line 159 of file mitkContourModel.cpp.
|
overridevirtual |
Check if there isn't something at this timestep.
Reimplemented from mitk::BaseData.
Definition at line 224 of file mitkContourModel.cpp.
References m_ContourSeries.
Referenced by AddVertex(), AddVertexAtFront(), Clear(), Close(), Concatenate(), GetIndex(), GetNumberOfVertices(), GetVertexAt(), InsertVertexAtIndex(), mitk::ContourModelGLMapper2DBase::InternalDrawContour(), IsClosed(), IsEmpty(), IsNearContour(), IteratorBegin(), IteratorEnd(), Open(), RedistributeControlVertices(), RemoveVertex(), RemoveVertexAt(), SelectVertexAt(), SetClosed(), SetControlVertexAt(), SetVertexAt(), and ShiftContour().
|
virtual |
Check if mouse cursor is near the contour.
Definition at line 229 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), and m_ContourSeries.
mitk::ContourModel::VertexIterator mitk::ContourModel::IteratorBegin | ( | int | timestep = 0 | ) | const |
Returns a const VertexIterator at the start element of the contour.
mitk::Exception | if the timestep is invalid. |
Definition at line 257 of file mitkContourModel.cpp.
References mitk::BaseData::GetTimeSteps(), IsEmptyTimeStep(), m_ContourSeries, and mitkThrow.
Referenced by Begin(), mitk::ImageLiveWireContourModelFilter::CreateDynamicCostMapByITK(), mitk::ContourModelMapper3D::CreateVtkPolyDataFromContour(), mitk::ContourModelGLMapper2DBase::InternalDrawContour(), mitk::ContourModelLiveWireInteractor::SplitContourFromSelectedVertex(), UpdateOutputInformation(), and mitk::ContourModelWriter::WriteXML().
mitk::ContourModel::VertexIterator mitk::ContourModel::IteratorEnd | ( | int | timestep = 0 | ) | const |
Returns a const VertexIterator at the end element of the contour.
mitk::Exception | if the timestep is invalid. |
Definition at line 275 of file mitkContourModel.cpp.
References mitk::BaseData::GetTimeSteps(), IsEmptyTimeStep(), m_ContourSeries, and mitkThrow.
Referenced by mitk::ImageLiveWireContourModelFilter::CreateDynamicCostMapByITK(), mitk::ContourModelMapper3D::CreateVtkPolyDataFromContour(), End(), mitk::ContourModelGLMapper2DBase::InternalDrawContour(), mitk::ContourModelLiveWireInteractor::SplitContourFromSelectedVertex(), UpdateOutputInformation(), and mitk::ContourModelWriter::WriteXML().
mitk::ContourModel::mitkClassMacro | ( | ContourModel | , |
BaseData | |||
) |
|
protected |
|
static |
Referenced by mitk::ContourModelUtils::BackProjectContourFrom2DSlice(), mitk::ContourUtils::BackProjectContourFrom2DSlice(), mitk::LiveWireTool2D::ClearSegmentation(), mitk::ContourModelMapper2D::CreateVtkPolyDataFromContour(), mitk::FeedbackContourTool::FeedbackContourTool(), mitk::ContourUtils::FillContourInSlice(), mitk::ContourModelSubDivisionFilter::GenerateData(), mitk::ImageToContourModelFilter::Itk2DContourExtraction(), mitk::ContourModelSource::MakeOutput(), mitk::PaintbrushTool::MouseMoved(), mitk::ContourModelUtils::MoveZerothContourTimeStep(), mitk::ContourModelLiveWireInteractor::OnCheckPointClick(), mitk::ContourModelLiveWireInteractor::OnDeletePoint(), mitk::RegionGrowingTool::OnMouseMoved(), mitk::RegionGrowingTool::OnMousePressedOutside(), mitk::CorrectorTool2D::OnMouseReleased(), mitk::RegionGrowingTool::OnMouseReleased(), mitk::ContourModelLiveWireInteractor::OnMovePoint(), mitk::PaintbrushTool::PaintbrushTool(), mitk::ContourModelUtils::ProjectContourTo2DSlice(), mitk::ContourUtils::ProjectContourTo2DSlice(), mitk::ContourModelReader::Read(), mitk::RTStructureSetReaderService::Read(), and mitk::PaintbrushTool::UpdateContour().
|
virtual |
Set isClosed to false contour. The link between the last control point the first point will be removed.
Definition at line 202 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
|
virtual |
Redistributes ontrol vertices with a given period (as number of vertices)
period | - the number of vertices between control points. |
timestep | - at this timestep all lines will be rebuilt. |
Definition at line 497 of file mitkContourModel.cpp.
References GetSelectedVertex(), IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
bool mitk::ContourModel::RemoveVertex | ( | const VertexType * | vertex, |
int | timestep = 0 |
||
) |
Remove a vertex at given timestep within the container.
Definition at line 343 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
Referenced by mitk::ContourModelInteractor::OnDeletePoint().
bool mitk::ContourModel::RemoveVertexAt | ( | int | index, |
int | timestep = 0 |
||
) |
Remove a vertex at given index within the container.
Definition at line 358 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
Referenced by mitk::ContourModelLiveWireInteractor::OnDeletePoint(), and RemoveVertexAt().
bool mitk::ContourModel::RemoveVertexAt | ( | mitk::Point3D & | point, |
float | eps, | ||
int | timestep = 0 |
||
) |
Remove a vertex at a query position in 3D space.
The vertex to be removed will be search by nearest neighbour search. Note that possibly no vertex at this position and eps is stored inside the contour.
Definition at line 373 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, m_UpdateBoundingBox, and RemoveVertexAt().
|
overridevirtual |
Inherit from base data - no region support available for contourModel objects.
Implements mitk::BaseData.
Definition at line 461 of file mitkContourModel.cpp.
bool mitk::ContourModel::SelectVertexAt | ( | int | index, |
int | timestep = 0 |
||
) |
Mark a vertex at an index in the container as selected.
Definition at line 306 of file mitkContourModel.cpp.
References GetVertexAt(), IsEmptyTimeStep(), m_ContourSeries, and m_SelectedVertex.
bool mitk::ContourModel::SelectVertexAt | ( | mitk::Point3D & | point, |
float | eps, | ||
int | timestep = 0 |
||
) |
Mark a vertex at a given position in 3D space.
point | - query point in 3D space |
eps | - radius for nearest neighbour search (error bound). |
timestep | - search at this timestep |
Definition at line 297 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, and m_SelectedVertex.
|
virtual |
Set closed property to given boolean.
false - The link between the last control point the first point will be removed. true - The last control point will be linked with the first point.
Definition at line 213 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
Referenced by mitk::CorrectorTool2D::CorrectorTool2D(), Initialize(), mitk::ContourTool::OnMousePressed(), and mitk::CorrectorTool2D::OnMousePressed().
bool mitk::ContourModel::SetControlVertexAt | ( | int | index, |
int | timestep = 0 |
||
) |
Mark a vertex at an index in the container as control point.
Definition at line 329 of file mitkContourModel.cpp.
References mitk::ContourElement::ContourModelVertex::IsControlPoint, IsEmptyTimeStep(), and m_ContourSeries.
bool mitk::ContourModel::SetControlVertexAt | ( | mitk::Point3D & | point, |
float | eps, | ||
int | timestep = 0 |
||
) |
Definition at line 315 of file mitkContourModel.cpp.
References mitk::ContourElement::ContourModelVertex::IsControlPoint, IsEmptyTimeStep(), and m_ContourSeries.
|
inline |
Set the interpolation of the line segments between control points.
Definition at line 92 of file mitkContourModel.h.
|
overridevirtual |
Inherit from base data - no region support available for contourModel objects.
Implements mitk::BaseData.
Definition at line 483 of file mitkContourModel.cpp.
|
overridevirtual |
Inherit from base data - no region support available for contourModel objects.
Implements mitk::BaseData.
Definition at line 456 of file mitkContourModel.cpp.
|
inline |
Set selected vertex as control point.
Definition at line 81 of file mitkContourModel.h.
bool mitk::ContourModel::SetVertexAt | ( | int | pointId, |
const mitk::Point3D & | point, | ||
unsigned int | timestep = 0 |
||
) |
Set a coordinates for point at given index.
Definition at line 101 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
bool mitk::ContourModel::SetVertexAt | ( | int | pointId, |
const VertexType * | vertex, | ||
unsigned int | timestep = 0 |
||
) |
Set a coordinates for point at given index.
Definition at line 117 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, and m_UpdateBoundingBox.
void mitk::ContourModel::ShiftContour | ( | mitk::Vector3D & | translate, |
int | timestep = 0 |
||
) |
Shift the whole contour by a translation vector at given timestep.
translate | - the translation vector. |
timestep | - at this timestep the contour will be shifted. |
Definition at line 398 of file mitkContourModel.cpp.
References IsEmptyTimeStep(), m_ContourSeries, m_UpdateBoundingBox, and ShiftVertex().
void mitk::ContourModel::ShiftSelectedVertex | ( | mitk::Vector3D & | translate | ) |
Shift the currently selected vertex by a translation vector.
translate | - the translation vector. |
Definition at line 388 of file mitkContourModel.cpp.
References m_SelectedVertex, m_UpdateBoundingBox, and ShiftVertex().
|
protected |
Definition at line 419 of file mitkContourModel.cpp.
References mitk::ContourElement::ContourModelVertex::Coordinates.
Referenced by ShiftContour(), and ShiftSelectedVertex().
|
override |
Update the OutputInformation of a ContourModel object.
The BoundingBox of the contour will be updated, if necessary.
Definition at line 554 of file mitkContourModel.cpp.
References GetGeometry(), mitk::BaseData::GetMTime(), mitk::BaseData::GetSource(), mitk::BaseData::GetTimeGeometry(), mitk::BaseData::GetTimeSteps(), IteratorBegin(), IteratorEnd(), m_UpdateBoundingBox, mitk::BaseGeometry::SetBounds(), and mitk::TimeGeometry::Update().
Referenced by mitk::ContourModelGLMapper2DBase::InternalDrawContour().
|
overridevirtual |
Inherit from base data - no region support available for contourModel objects.
Implements mitk::BaseData.
Definition at line 467 of file mitkContourModel.cpp.
|
protected |
Definition at line 432 of file mitkContourModel.h.
Referenced by AddVertex(), AddVertexAtFront(), Clear(), ClearData(), Close(), Concatenate(), Expand(), GetIndex(), GetNumberOfVertices(), GetVertexAt(), Initialize(), InitializeEmpty(), InsertVertexAtIndex(), IsClosed(), IsEmpty(), IsEmptyTimeStep(), IsNearContour(), IteratorBegin(), IteratorEnd(), Open(), RedistributeControlVertices(), RemoveVertex(), RemoveVertexAt(), SelectVertexAt(), SetClosed(), SetControlVertexAt(), SetVertexAt(), ShiftContour(), and ~ContourModel().
|
protected |
Definition at line 438 of file mitkContourModel.h.
Referenced by Initialize(), and InitializeEmpty().
|
protected |
Definition at line 435 of file mitkContourModel.h.
Referenced by ContourModel(), Initialize(), InitializeEmpty(), SelectVertexAt(), ShiftSelectedVertex(), and ~ContourModel().
|
protected |
Definition at line 441 of file mitkContourModel.h.
Referenced by AddVertex(), AddVertexAtFront(), Clear(), Close(), Concatenate(), Initialize(), InsertVertexAtIndex(), Open(), RedistributeControlVertices(), RemoveVertex(), RemoveVertexAt(), SetClosed(), SetVertexAt(), ShiftContour(), ShiftSelectedVertex(), and UpdateOutputInformation().