Medical Imaging Interaction Toolkit  2018.4.99-a3d2e8fb
Medical Imaging Interaction Toolkit
mitk::Mesh Class Reference

DataStructure which stores a set of points (incl. pointdata) where each point can be associated to an element of a cell. More...

#include <mitkMesh.h>

Inheritance diagram for mitk::Mesh:
Collaboration diagram for mitk::Mesh:

Public Types

typedef Superclass::DataType::CellType CellType
 
typedef CellType::CellAutoPointer CellAutoPointer
 
typedef Superclass::MeshTraits::CellTraits CellTraits
 
typedef CellTraits::PointIdConstIterator PointIdConstIterator
 
typedef CellTraits::PointIdIterator PointIdIterator
 
typedef DataType::CellDataContainer CellDataContainer
 
typedef DataType::CellDataContainerIterator CellDataIterator
 
typedef Superclass::DataType::CellsContainer::Iterator CellIterator
 
typedef Superclass::DataType::CellsContainer::ConstIterator ConstCellIterator
 
typedef itk::PolygonCell< CellTypePolygonType
 
typedef MeshType::CellType::MultiVisitor MeshMultiVisitor
 
- Public Types inherited from mitk::PointSet
typedef PointSet Self
 
typedef BaseData Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef mitk::ScalarType CoordinateType
 
typedef mitk::ScalarType InterpolationWeightType
 
typedef std::vector< unsigned int > SelectedLinesType
 cellDataType, that stores all indexes of the lines, that are selected e.g.: points A,B and C.Between A and B there is a line with index 0. If vector of cellData contains 1 and 2, then the lines between B and C and C and A is selected. More...
 
typedef SelectedLinesType::iterator SelectedLinesIter
 
typedef itk::DefaultDynamicMeshTraits< PointDataType, PointDimension, MaxTopologicalDimension, CoordinateType, InterpolationWeightType, CellDataTypeMeshTraits
 
typedef itk::Mesh< PointDataType, PointDimension, MeshTraitsMeshType
 
typedef MeshType DataType
 
typedef Point3D PointType
 
typedef DataType::PointIdentifier PointIdentifier
 
typedef DataType::PointsContainer PointsContainer
 
typedef DataType::PointsContainerIterator PointsIterator
 
typedef DataType::PointsContainer::ConstIterator PointsConstIterator
 
typedef DataType::PointDataContainer PointDataContainer
 
typedef DataType::PointDataContainerIterator PointDataIterator
 
typedef DataType::PointDataContainerIterator PointDataConstIterator
 
- Public Types inherited from mitk::BaseData
typedef BaseData Self
 
typedef itk::DataObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
- Public Types inherited from mitk::Identifiable
using UIDType = std::string
 

Public Member Functions

 mitkClassMacro (Mesh, PointSet)
 
Pointer Clone () const
 
virtual unsigned long GetNumberOfCells (int t=0)
 returns the current number of cells in the mesh More...
 
virtual const DataTypeGetMesh (int t=0) const
 returns the mesh More...
 
virtual DataTypeGetMesh (int t=0)
 returns the mesh More...
 
void SetMesh (DataType *mesh, int t=0)
 
virtual bool EvaluatePosition (Point3D point, unsigned long &cellId, float precision, int t=0)
 checks if the given point is in a cell and returns that cellId. Basicaly it searches lines and points that are hit. More...
 
unsigned long GetNewCellId (int t=0)
 searches for the next new cellId and returns that id More...
 
virtual int SearchFirstCell (unsigned long pointId, int t=0)
 returns the first cell that includes the given pointId More...
 
virtual bool SearchLine (Point3D point, float distance, unsigned long &lineId, unsigned long &cellId, int t=0)
 searches for a line, that is hit by the given point. Then returns the lineId and the cellId More...
 
virtual bool GetPointIds (unsigned long cellId, unsigned long lineId, int &idA, int &idB, int t=0)
 searches a line according to the cellId and lineId and returns the PointIds, that assign the line; if successful, then return param = true; More...
 
virtual int SearchSelectedCell (int t=0)
 searches a selected cell and returns the id of that cell. If no cell is found, then -1 is returned More...
 
virtual DataType::BoundingBoxPointer GetBoundingBoxFromCell (unsigned long cellId, int t=0)
 creates a BoundingBox and computes it with the given points of the cell. More...
 
void ExecuteOperation (Operation *operation) override
 executes the given Operation More...
 
- Public Member Functions inherited from mitk::PointSet
virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
void Expand (unsigned int timeSteps) override
 Expands the TimeGeometry to a number of TimeSteps. More...
 
virtual int GetSize (unsigned int t=0) const
 returns the current size of the point-list More...
 
virtual unsigned int GetPointSetSeriesSize () const
 
virtual DataType::Pointer GetPointSet (int t=0) const
 returns the pointset More...
 
PointsIterator Begin (int t=0)
 
PointsConstIterator Begin (int t=0) const
 
PointsIterator End (int t=0)
 
PointsConstIterator End (int t=0) const
 
PointsIterator GetMaxId (int t=0)
 Get an iterator to the max ID element if existent. Return End() otherwise. More...
 
PointType GetPoint (PointIdentifier id, int t=0) const
 Get the point with ID id in world coordinates. More...
 
bool GetPointIfExists (PointIdentifier id, PointType *point, int t=0) const
 Get the point with ID id in world coordinates. More...
 
void SetPoint (PointIdentifier id, PointType point, int t=0)
 Set the given point in world coordinate system into the itkPointSet. More...
 
void SetPoint (PointIdentifier id, PointType point, PointSpecificationType spec, int t=0)
 Set the given point in world coordinate system with the given PointSpecificationType. More...
 
void InsertPoint (PointIdentifier id, PointType point, int t=0)
 Set the given point in world coordinate system into the itkPointSet. More...
 
void InsertPoint (PointIdentifier id, PointType point, PointSpecificationType spec, int t)
 Set the given point in world coordinate system with given PointSpecificationType. More...
 
PointIdentifier InsertPoint (PointType point, int t=0)
 Insert the given point in world coordinate system with incremented max id at time step t. More...
 
bool RemovePointIfExists (PointIdentifier id, int t=0)
 Remove point with given id at timestep t, if existent. More...
 
PointsIterator RemovePointAtEnd (int t=0)
 Remove max id point at timestep t and return iterator to precedent point. More...
 
bool SwapPointPosition (PointIdentifier id, bool moveUpwards, int t=0)
 Swap a point at the given position (id) with the upper point (moveUpwards=true) or with the lower point (moveUpwards=false). If upper or lower index does not exist false is returned, if swap was successful true. More...
 
virtual int SearchSelectedPoint (int t=0) const
 searches a selected point and returns the id of that point. If no point is found, then -1 is returned More...
 
virtual bool IndexExists (int position, int t=0) const
 returns true if a point exists at this position More...
 
virtual bool GetSelectInfo (int position, int t=0) const
 to get the state selected/unselected of the point on the position More...
 
virtual void SetSelectInfo (int position, bool selected, int t=0)
 
virtual PointSpecificationType GetSpecificationTypeInfo (int position, int t) const
 to get the type of the point at the position and the moment More...
 
virtual int GetNumberOfSelected (int t=0) const
 returns the number of selected points More...
 
int SearchPoint (Point3D point, ScalarType distance, int t=0) const
 searches a point in the list == point +/- distance More...
 
bool IsEmptyTimeStep (unsigned int t) const override
 Check whether object contains data (at a specified time), e.g., a set of points may be empty. More...
 
void UpdateOutputInformation () override
 
void SetRequestedRegionToLargestPossibleRegion () override
 Set the RequestedRegion to the LargestPossibleRegion. More...
 
bool RequestedRegionIsOutsideOfTheBufferedRegion () override
 Determine whether the RequestedRegion is outside of the BufferedRegion. More...
 
bool VerifyRequestedRegion () override
 Verify that the RequestedRegion is within the LargestPossibleRegion. More...
 
void SetRequestedRegion (const itk::DataObject *data) override
 Set the requested region from this data object to match the requested region of the data object passed in as a parameter. More...
 
virtual void OnPointSetChange ()
 
- Public Member Functions inherited from mitk::BaseData
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...
 
BasePropertyGetNonConstProperty (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::TimeGeometryGetTimeGeometry () const
 Return the TimeGeometry of the data as const pointer. More...
 
const mitk::TimeGeometryGetTimeSlicedGeometry () const
 Return the TimeGeometry of the data as const pointer. More...
 
mitk::TimeGeometryGetTimeGeometry ()
 Return the TimeGeometry of the data as pointer. More...
 
const mitk::TimeGeometryGetUpdatedTimeGeometry ()
 Return the TimeGeometry of the data. More...
 
const mitk::TimeGeometryGetUpdatedTimeSliceGeometry ()
 Return the TimeGeometry of the data. More...
 
const mitk::BaseGeometryGetUpdatedGeometry (int t=0)
 Return the BaseGeometry of the data at time t. More...
 
mitk::BaseGeometryGetGeometry (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...
 
virtual void Clear ()
 Calls ClearData() and InitializeEmpty();. More...
 
virtual bool IsEmpty () const
 Check whether object contains data (at least at one point in time), e.g., a set of points may be empty. 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::BaseDataSourceGetSource () 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
 
- Public Member Functions inherited from mitk::OperationActor
 itkTypeMacroNoParent (OperationActor) virtual ~OperationActor()
 
- Public Member Functions inherited from mitk::Identifiable
 Identifiable ()
 
 Identifiable (const UIDType &uid)
 
 Identifiable (const Identifiable &)=delete
 
 Identifiable (Identifiable &&) noexcept
 
virtual ~Identifiable ()
 
Identifiableoperator= (const Identifiable &)=delete
 
Identifiableoperator= (Identifiable &&other) noexcept
 
UIDType GetUID () const
 Get unique ID of an object. More...
 
- Public Member Functions inherited from mitk::IPropertyOwner
 ~IPropertyOwner () override
 
- Public Member Functions inherited from mitk::IPropertyProvider
virtual ~IPropertyProvider ()
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from mitk::PointSet
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::BaseData
static const char * GetStaticNameOfClass ()
 

Protected Member Functions

 Mesh ()
 
 ~Mesh () override
 
- Protected Member Functions inherited from mitk::PointSet
virtual itk::LightObject::Pointer InternalClone () const override
 
 PointSet ()
 
 PointSet (const PointSet &other)
 
 ~PointSet () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 print content of the object to os More...
 
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...
 
bool SwapPointContents (PointIdentifier id1, PointIdentifier id2, int t=0)
 swaps point coordinates and point data of the points with identifiers id1 and id2 More...
 
- Protected Member Functions inherited from mitk::BaseData
 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
 

Additional Inherited Members

- Static Public Attributes inherited from mitk::PointSet
static const unsigned int PointDimension
 
static const unsigned int MaxTopologicalDimension
 
- Protected Types inherited from mitk::PointSet
typedef std::vector< DataType::Pointer > PointSetSeries
 
- Protected Attributes inherited from mitk::PointSet
PointSetSeries m_PointSetSeries
 
DataType::PointsContainer::Pointer m_EmptyPointsContainer
 
bool m_CalculateBoundingBox
 flag to indicate the right time to call SetBounds More...
 
- Protected Attributes inherited from mitk::BaseData
bool m_LastRequestedRegionWasOutsideOfTheBufferedRegion
 
unsigned int m_SourceOutputIndexDuplicate
 
bool m_Initialized
 

Detailed Description

DataStructure which stores a set of points (incl. pointdata) where each point can be associated to an element of a cell.

A mesh contains several cells that can be of different celltypes (Line, Triangle, Polygone...). A cell is always closed. If a linestrip is to be created, then declare several cells, each containing one line.

The operations take care of the coherence. If a line is added to an existing LineCell, then a TriangleCell is built with the old and the new parameter (and so on). Deletion is done the opposite way.

Example for inserting a line into a TriangleCell: existing PIds ind the cell: 1, 2, 4; inserting (2, 3) so that new PIds in Cell: 1, 2, 3, 4

The cell is now of type QuadrilateralCell

Definition at line 50 of file mitkMesh.h.

Member Typedef Documentation

◆ CellAutoPointer

typedef CellType::CellAutoPointer mitk::Mesh::CellAutoPointer

Definition at line 60 of file mitkMesh.h.

◆ CellDataContainer

typedef DataType::CellDataContainer mitk::Mesh::CellDataContainer

Definition at line 64 of file mitkMesh.h.

◆ CellDataIterator

typedef DataType::CellDataContainerIterator mitk::Mesh::CellDataIterator

Definition at line 65 of file mitkMesh.h.

◆ CellIterator

typedef Superclass::DataType::CellsContainer::Iterator mitk::Mesh::CellIterator

Definition at line 66 of file mitkMesh.h.

◆ CellTraits

typedef Superclass::MeshTraits::CellTraits mitk::Mesh::CellTraits

Definition at line 61 of file mitkMesh.h.

◆ CellType

typedef Superclass::DataType::CellType mitk::Mesh::CellType

Definition at line 57 of file mitkMesh.h.

◆ ConstCellIterator

typedef Superclass::DataType::CellsContainer::ConstIterator mitk::Mesh::ConstCellIterator

Definition at line 67 of file mitkMesh.h.

◆ MeshMultiVisitor

typedef MeshType::CellType::MultiVisitor mitk::Mesh::MeshMultiVisitor

Definition at line 69 of file mitkMesh.h.

◆ PointIdConstIterator

typedef CellTraits::PointIdConstIterator mitk::Mesh::PointIdConstIterator

Definition at line 62 of file mitkMesh.h.

◆ PointIdIterator

typedef CellTraits::PointIdIterator mitk::Mesh::PointIdIterator

Definition at line 63 of file mitkMesh.h.

◆ PolygonType

typedef itk::PolygonCell<CellType> mitk::Mesh::PolygonType

Definition at line 68 of file mitkMesh.h.

Constructor & Destructor Documentation

◆ Mesh()

mitk::Mesh::Mesh ( )
protected

Definition at line 25 of file mitkMesh.cpp.

◆ ~Mesh()

mitk::Mesh::~Mesh ( )
overrideprotected

Definition at line 29 of file mitkMesh.cpp.

Member Function Documentation

◆ Clone()

Pointer mitk::Mesh::Clone ( ) const

◆ EvaluatePosition()

bool mitk::Mesh::EvaluatePosition ( mitk::Point3D  point,
unsigned long &  cellId,
float  precision,
int  t = 0 
)
virtual

checks if the given point is in a cell and returns that cellId. Basicaly it searches lines and points that are hit.

Definition at line 150 of file mitkMesh.cpp.

References SearchFirstCell(), SearchLine(), and mitk::PointSet::SearchPoint().

◆ ExecuteOperation()

◆ GetBoundingBoxFromCell()

mitk::Mesh::DataType::BoundingBoxPointer mitk::Mesh::GetBoundingBoxFromCell ( unsigned long  cellId,
int  t = 0 
)
virtual

creates a BoundingBox and computes it with the given points of the cell.

Returns the BoundingBox != IsNull() if successful.

Definition at line 781 of file mitkMesh.cpp.

References mitk::PointSet::m_PointSetSeries.

◆ GetMesh() [1/2]

const mitk::Mesh::DataType * mitk::Mesh::GetMesh ( int  t = 0) const
virtual

returns the mesh

Definition at line 33 of file mitkMesh.cpp.

References mitk::PointSet::m_PointSetSeries.

◆ GetMesh() [2/2]

mitk::Mesh::DataType * mitk::Mesh::GetMesh ( int  t = 0)
virtual

returns the mesh

Definition at line 38 of file mitkMesh.cpp.

References mitk::PointSet::m_PointSetSeries.

◆ GetNewCellId()

unsigned long mitk::Mesh::GetNewCellId ( int  t = 0)

searches for the next new cellId and returns that id

Definition at line 168 of file mitkMesh.cpp.

References mitk::PointSet::m_PointSetSeries.

◆ GetNumberOfCells()

unsigned long mitk::Mesh::GetNumberOfCells ( int  t = 0)
virtual

returns the current number of cells in the mesh

Definition at line 49 of file mitkMesh.cpp.

References mitk::PointSet::m_PointSetSeries.

◆ GetPointIds()

bool mitk::Mesh::GetPointIds ( unsigned long  cellId,
unsigned long  lineId,
int &  idA,
int &  idB,
int  t = 0 
)
virtual

searches a line according to the cellId and lineId and returns the PointIds, that assign the line; if successful, then return param = true;

Definition at line 201 of file mitkMesh.cpp.

References mitk::PointSet::CellDataType::closed, and mitk::PointSet::m_PointSetSeries.

◆ mitkClassMacro()

mitk::Mesh::mitkClassMacro ( Mesh  ,
PointSet   
)

◆ New()

static Pointer mitk::Mesh::New ( )
static

Referenced by mitkMeshTest().

◆ SearchFirstCell()

int mitk::Mesh::SearchFirstCell ( unsigned long  pointId,
int  t = 0 
)
virtual

returns the first cell that includes the given pointId

Definition at line 128 of file mitkMesh.cpp.

References mitk::PointSet::m_PointSetSeries.

Referenced by EvaluatePosition().

◆ SearchLine()

bool mitk::Mesh::SearchLine ( Point3D  point,
float  distance,
unsigned long &  lineId,
unsigned long &  cellId,
int  t = 0 
)
virtual

searches for a line, that is hit by the given point. Then returns the lineId and the cellId

Definition at line 55 of file mitkMesh.cpp.

References mitk::PointSet::CellDataType::closed, mitk::PointSet::GetPoint(), line, and mitk::PointSet::m_PointSetSeries.

Referenced by EvaluatePosition().

◆ SearchSelectedCell()

int mitk::Mesh::SearchSelectedCell ( int  t = 0)
virtual

searches a selected cell and returns the id of that cell. If no cell is found, then -1 is returned

Definition at line 183 of file mitkMesh.cpp.

References mitk::PointSet::Begin(), and mitk::PointSet::m_PointSetSeries.

Referenced by ExecuteOperation().

◆ SetMesh()

void mitk::Mesh::SetMesh ( DataType mesh,
int  t = 0 
)

Definition at line 43 of file mitkMesh.cpp.

References mitk::PointSet::Expand(), and mitk::PointSet::m_PointSetSeries.


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