![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Fast Marching algorithm for surface front propagation. More...
#include <FastMarchingForPropagation.h>


Classes | |
| class | PropagationCell |
| A Fast Marching grid cell for surfacical propagation. More... | |
Public Member Functions | |
| FastMarchingForPropagation () | |
| Default constructor. More... | |
| int | init (GenericCloud *theCloud, DgmOctree *theOctree, unsigned char gridLevel, bool constantAcceleration=false) |
| Initializes the grid with a point cloud (and ist corresponding octree) More... | |
| bool | extractPropagatedPoints (ReferenceCloud *Zk) |
| bool | setPropagationTimingsAsDistances () |
| Sets the propagation timings as distances for each point. More... | |
| void | setDetectionThreshold (float value) |
| Sets the threshold for propagation stop. More... | |
| void | setJumpCoef (float value) |
| Sets the accceleration exageration factor. More... | |
| void | findPeaks () |
| Find peaks of local acceleration values. More... | |
| int | propagate () override |
| Propagates the front. More... | |
Public Member Functions inherited from cloudViewer::FastMarching | |
| FastMarching () | |
| Default constructor. More... | |
| virtual | ~FastMarching () |
| Destructor. More... | |
| virtual bool | setSeedCell (const Tuple3i &pos) |
| Sets a given cell as "seed". More... | |
| virtual void | cleanLastPropagation () |
| virtual float | getTime (Tuple3i &pos, bool absoluteCoordinates=false) const |
| Returns the front arrival time at a given cell. More... | |
| virtual void | setExtendedConnectivity (bool state) |
| Sets extended connectivity mode. More... | |
Protected Member Functions | |
| float | computeTCoefApprox (Cell *currentCell, Cell *neighbourCell) const override |
| Computes the front acceleration between two cells. More... | |
| int | step () override |
| Propagates the front (one step) More... | |
| bool | instantiateGrid (unsigned size) override |
| Instantiates grid in memory. More... | |
Protected Member Functions inherited from cloudViewer::FastMarching | |
| unsigned | pos2index (const Tuple3i &pos) const |
| virtual int | initGridWithOctree (DgmOctree *octree, unsigned char gridLevel) |
| virtual int | initGrid (float step, unsigned dim[3]) |
| Intializes the grid with a given step and dimensions. More... | |
| virtual int | initOther () |
| virtual float | computeT (unsigned index) |
| Computes the front arrival time at a given cell. More... | |
| virtual void | initTrialCells () |
| Initializes the TRIAL cells list. More... | |
| template<class T > | |
| bool | instantiateGridTpl (unsigned size) |
| Grid instantiation helper. More... | |
| virtual void | addTrialCell (unsigned index) |
| Add a cell to the TRIAL cells list. More... | |
| virtual void | addActiveCell (unsigned index) |
| Add a cell to the ACTIVE cells list. More... | |
| virtual void | addIgnoredCell (unsigned index) |
| Add a cell to the IGNORED cells list. More... | |
| virtual unsigned | getNearestTrialCell () |
| Returns the TRIAL cell with the smallest front arrival time. More... | |
| void | resetCells (std::vector< unsigned > &list) |
| Resets the state of cells in a given list. More... | |
Protected Attributes | |
| float | m_jumpCoef |
| Accceleration exageration factor. More... | |
| float | m_detectionThreshold |
| Threshold for propagation stop. More... | |
Protected Attributes inherited from cloudViewer::FastMarching | |
| std::vector< unsigned > | m_activeCells |
| ACTIVE cells list. More... | |
| std::vector< unsigned > | m_trialCells |
| TRIAL cells list. More... | |
| std::vector< unsigned > | m_ignoredCells |
| IGNORED cells lits. More... | |
| bool | m_initialized |
| Specifiies whether structure is initialized or not. More... | |
| unsigned | m_dx |
| Grid size along the X dimension. More... | |
| unsigned | m_dy |
| Grid size along the Y dimension. More... | |
| unsigned | m_dz |
| Grid size along the Z dimension. More... | |
| unsigned | m_rowSize |
| Shift for cell access acceleration (Y dimension) More... | |
| unsigned | m_sliceSize |
| Shift for cell access acceleration (Z dimension) More... | |
| unsigned | m_indexShift |
| First index of innerbound grid. More... | |
| unsigned | m_gridSize |
| Grid size. More... | |
| Cell ** | m_theGrid |
| Grid used to process Fast Marching. More... | |
| DgmOctree * | m_octree |
| Associated octree. More... | |
| unsigned char | m_gridLevel |
| Equivalent octree subdivision level. More... | |
| float | m_cellSize |
| Octree cell size at equivalent subdivision level. More... | |
| Tuple3i | m_minFillIndexes |
| Octree min fill indexes at 'm_gridLevel'. More... | |
| unsigned | m_numberOfNeighbours |
| Current number of neighbours (6 or 26) More... | |
| int | m_neighboursIndexShift [26] |
| Neighbours coordinates shifts in grid. More... | |
| float | m_neighboursDistance [26] |
| Neighbours distance weight. More... | |
Fast Marching algorithm for surface front propagation.
Extends the FastMarching class.
Definition at line 22 of file FastMarchingForPropagation.h.
| FastMarchingForPropagation::FastMarchingForPropagation | ( | ) |
Default constructor.
Definition at line 17 of file FastMarchingForPropagation.cpp.
|
overrideprotectedvirtual |
Computes the front acceleration between two cells.
| currentCell | the "central" cell |
| neighbourCell | the other cell |
Implements cloudViewer::FastMarching.
Definition at line 212 of file FastMarchingForPropagation.cpp.
References cloudViewer::FastMarchingForPropagation::PropagationCell::f, and m_jumpCoef.
| bool FastMarchingForPropagation::extractPropagatedPoints | ( | ReferenceCloud * | Zk | ) |
Returns a list of the points (references to) reached by the propagation process Returns a cloud of points (references to) corresponding to the points that are lying in cells that have been visited by the last propagation process.
| [out] | Zk | (reference) point cloud |
Definition at line 141 of file FastMarchingForPropagation.cpp.
References cloudViewer::FastMarchingForPropagation::PropagationCell::cellCode, cloudViewer::DgmOctree::getPointsInCell(), cloudViewer::FastMarching::m_activeCells, cloudViewer::FastMarching::m_gridLevel, cloudViewer::FastMarching::m_initialized, cloudViewer::FastMarching::m_octree, cloudViewer::FastMarching::m_theGrid, cloudViewer::DgmOctree::MAX_OCTREE_LEVEL, NAN_VALUE, and points.
Referenced by cloudViewer::AutoSegmentationTools::frontPropagationBasedSegmentation().
| void FastMarchingForPropagation::findPeaks | ( | ) |
Find peaks of local acceleration values.
This method is useful when using this Fast Marching algorithm in a Watershed process. Peak cells are automatically set as "seeds".
Definition at line 219 of file FastMarchingForPropagation.cpp.
References cloudViewer::FastMarching::addActiveCell(), CC_FM_MAX_NUMBER_OF_NEIGHBOURS, cloudViewer::FastMarchingForPropagation::PropagationCell::f, cloudViewer::FastMarching::m_dx, cloudViewer::FastMarching::m_dy, cloudViewer::FastMarching::m_dz, cloudViewer::FastMarching::m_initialized, cloudViewer::FastMarching::m_neighboursIndexShift, cloudViewer::FastMarching::m_rowSize, cloudViewer::FastMarching::m_sliceSize, cloudViewer::FastMarching::m_theGrid, and cloudViewer::FastMarching::Cell::T.
| int FastMarchingForPropagation::init | ( | GenericCloud * | theCloud, |
| DgmOctree * | theOctree, | ||
| unsigned char | gridLevel, | ||
| bool | constantAcceleration = false |
||
| ) |
Initializes the grid with a point cloud (and ist corresponding octree)
The points should be associated to scalar values. Warning: be sure to activate an OUTPUT scalar field on the input cloud The Fast Marching grid will have the same characteristics as the octree considered at a given level of subdivision. The local front acceleration in each cell is deduced from the scalar values associated to the points lying in the octree cell (mean value).
| theCloud | the point cloud |
| theOctree | the associated octree |
| gridLevel | the level of subdivision |
| constantAcceleration | specifies if the acceleration is constant or shoul be computed from the cell points scalar values |
Definition at line 27 of file FastMarchingForPropagation.cpp.
References cloudViewer::DgmOctree::associatedCloud(), cloudViewer::FastMarchingForPropagation::PropagationCell::cellCode, cloudViewer::ScalarFieldTools::computeMeanScalarValue(), cloudViewer::FastMarchingForPropagation::PropagationCell::f, cloudViewer::DgmOctree::getCellCodes(), cloudViewer::DgmOctree::getCellPos(), cloudViewer::DgmOctree::getPointsInCell(), cloudViewer::FastMarching::initGridWithOctree(), cloudViewer::FastMarching::m_initialized, cloudViewer::FastMarching::m_theGrid, cloudViewer::FastMarching::pos2index(), and result.
Referenced by cloudViewer::DistanceComputationTools::computeGeodesicDistances(), and cloudViewer::AutoSegmentationTools::frontPropagationBasedSegmentation().
|
inlineoverrideprotectedvirtual |
Instantiates grid in memory.
Grid is also filled with zeros.
| size | grid size |
Implements cloudViewer::FastMarching.
Definition at line 104 of file FastMarchingForPropagation.h.
References size.
|
overridevirtual |
Propagates the front.
The seeds should have already been initialized
Implements cloudViewer::FastMarching.
Definition at line 130 of file FastMarchingForPropagation.cpp.
References cloudViewer::FastMarching::initTrialCells(), result, and step().
Referenced by cloudViewer::DistanceComputationTools::computeGeodesicDistances(), and cloudViewer::AutoSegmentationTools::frontPropagationBasedSegmentation().
|
inline |
Sets the threshold for propagation stop.
This threshold corresponds to the maximum front arrival time increase allowed. If the delta between the fornt arrival time at two consecutive cells is higher, the propagation process is stoped.
| value | the threshold |
Definition at line 63 of file FastMarchingForPropagation.h.
References m_detectionThreshold.
Referenced by cloudViewer::AutoSegmentationTools::frontPropagationBasedSegmentation().
|
inline |
Sets the accceleration exageration factor.
In order to detect the front arrival time jumps (see FastMarchingForPropagation::setDetectionThreshold), it is possible to exaggerate the result of the acceleration computation with this factor.
| value | the acceleration exageration factor |
Definition at line 72 of file FastMarchingForPropagation.h.
References m_jumpCoef.
Referenced by cloudViewer::AutoSegmentationTools::frontPropagationBasedSegmentation().
| bool FastMarchingForPropagation::setPropagationTimingsAsDistances | ( | ) |
Sets the propagation timings as distances for each point.
Definition at line 168 of file FastMarchingForPropagation.cpp.
References cloudViewer::DgmOctree::associatedCloud(), cloudViewer::FastMarchingForPropagation::PropagationCell::cellCode, cloudViewer::ReferenceCloud::forwardIterator(), cloudViewer::DgmOctree::getPointsInCell(), cloudViewer::FastMarching::m_activeCells, cloudViewer::FastMarching::m_gridLevel, cloudViewer::FastMarching::m_initialized, cloudViewer::FastMarching::m_octree, cloudViewer::FastMarching::m_theGrid, cloudViewer::DgmOctree::MAX_OCTREE_LEVEL, cloudViewer::ReferenceCloud::placeIteratorAtBeginning(), cloudViewer::ReferenceCloud::setCurrentPointScalarValue(), cloudViewer::ReferenceCloud::size(), and cloudViewer::FastMarching::Cell::T.
Referenced by cloudViewer::DistanceComputationTools::computeGeodesicDistances().
|
overrideprotectedvirtual |
Propagates the front (one step)
Implements cloudViewer::FastMarching.
Definition at line 73 of file FastMarchingForPropagation.cpp.
References cloudViewer::FastMarching::Cell::ACTIVE_CELL, cloudViewer::FastMarching::addActiveCell(), cloudViewer::FastMarching::addIgnoredCell(), cloudViewer::FastMarching::addTrialCell(), cloudViewer::FastMarching::computeT(), cloudViewer::FastMarching::Cell::FAR_CELL, cloudViewer::FastMarching::getNearestTrialCell(), cloudViewer::FastMarching::m_activeCells, cloudViewer::FastMarching::m_cellSize, m_detectionThreshold, cloudViewer::FastMarching::m_initialized, cloudViewer::FastMarching::m_neighboursIndexShift, cloudViewer::FastMarching::m_numberOfNeighbours, cloudViewer::FastMarching::m_theGrid, cloudViewer::FastMarching::Cell::state, cloudViewer::FastMarching::Cell::T, cloudViewer::FastMarching::Cell::T_INF(), and cloudViewer::FastMarching::Cell::TRIAL_CELL.
Referenced by propagate().
|
protected |
Threshold for propagation stop.
Definition at line 111 of file FastMarchingForPropagation.h.
Referenced by setDetectionThreshold(), and step().
|
protected |
Accceleration exageration factor.
Definition at line 109 of file FastMarchingForPropagation.h.
Referenced by computeTCoefApprox(), and setJumpCoef().