#include <CSOLiveWireGraph.h>
Public Member Functions | |
| CSOLiveWireGraph () | |
| Standard constructor. | |
| CSOLiveWireGraph (float *imageData, unsigned int sizex, unsigned int sizey, const bool useCostsDirectly, float voxelSizeX=1.0f, float voxelSizeY=1.0f) | |
| Constructor, takes an array with image values and the image's size as arguments. | |
| ~CSOLiveWireGraph () | |
| Standard destructor. | |
| void | setStartPosition (VoxelPos startVoxelPos) |
| Sets the starting position. | |
| void | setWeights (float w1, float w2, float w3) |
| set weights for individual costs | |
| void | setLengthPenalty (float weight) |
| set weight for length penalty | |
| void | setPathCostThreshold (bool useThreshold, float threshold) |
| Set whether the path cost threshold shall be used, and its value. | |
| void | getShortestPathToStart (VoxelPos endPos, std::vector< VoxelPos > &intermediatePositions, int neighborhoodMode, bool reverse=true) |
| Computes the shortest path from the given endPos to the graph's internal start position. | |
| void | resetGraphAndHeap () |
| Resets all costs and visited states. | |
| void | setMaxPathLength (float maxLength) |
| Set the maximal allowed length of the path. | |
| void | updateResultCosts () |
| Compute the costs for all edges as a preprocessing step to speedup runtime computation. | |
Protected Member Functions | |
| void | _computeCosts () |
| compute the costs of all nodes | |
| float | _getEdgeCosts (unsigned char direction, int posx, int posy) |
| Returns the edge costs in the given direction of the node, given by its position. | |
| void | _computeAdditionalCostsAndNormalizeValues () |
| compute additional costs and normalizes the nodes' values. | |
| void | _normalizeValues () |
| Normalize node values (for using input costs directly). | |
Protected Attributes | |
| std::vector< VoxelPos > | _lastPathPositions |
| The last found path (used to determine intersections with the new path). | |
| unsigned int | _imageSizeX |
| The image size x. | |
| unsigned int | _imageSizeY |
| The image size y. | |
| float | _voxelSizeX |
| The size of the voxels in x direction. | |
| float | _voxelSizeY |
| The size of the voxels in y direction. | |
| CSOLiveWireNode ** | _lwGraph |
| The 2D array of nodes, representing the graph (edges exists from each voxel to its 8 neighborhood). | |
| CSOObjectHeap< CSOLiveWireNode > * | _nodeHeap |
| A heap for the shortest path algorithm. | |
| VoxelPos | _startVoxelPos |
| The starting voxel position. | |
| int | _offsetX [8] |
| Array of x-offsets depending on a direction. | |
| int | _offsetY [8] |
| Array of y-offsets depending on a direction. | |
| float | _maxGlobalGradient |
| the max gradient found in the whole graph | |
| float | _w1 |
| the weights for the individual costs | |
| float | _w2 |
| float | _w3 |
| float | _lengthPenalty |
| the higher this value the more direct path are preferred over longer paths | |
| bool | _usePathCostThreshold |
| Shall the path cost threshold be used? | |
| float | _pathConstThreshold |
| Threshold value for path costs: if the path costs are greater than this value, the according section is not added to the output list of positions. | |
| bool | _useCostsDirectly |
| Should we use the cost values from the image directly? | |
| float | _maxPathLength |
| The maximal allowed length of a path that are search by live-wire. | |
| float | _directionLengths [8] |
| The lengths of all possible 8 edges. | |
Definition at line 64 of file CSOLiveWireGraph.h.
| ml::CSOLiveWireGraph::CSOLiveWireGraph | ( | ) |
Standard constructor.
| ml::CSOLiveWireGraph::CSOLiveWireGraph | ( | float * | imageData, | |
| unsigned int | sizex, | |||
| unsigned int | sizey, | |||
| const bool | useCostsDirectly, | |||
| float | voxelSizeX = 1.0f, |
|||
| float | voxelSizeY = 1.0f | |||
| ) |
Constructor, takes an array with image values and the image's size as arguments.
| ml::CSOLiveWireGraph::~CSOLiveWireGraph | ( | ) |
Standard destructor.
| void ml::CSOLiveWireGraph::_computeAdditionalCostsAndNormalizeValues | ( | ) | [protected] |
compute additional costs and normalizes the nodes' values.
| void ml::CSOLiveWireGraph::_computeCosts | ( | ) | [protected] |
compute the costs of all nodes
| float ml::CSOLiveWireGraph::_getEdgeCosts | ( | unsigned char | direction, | |
| int | posx, | |||
| int | posy | |||
| ) | [protected] |
Returns the edge costs in the given direction of the node, given by its position.
| void ml::CSOLiveWireGraph::_normalizeValues | ( | ) | [protected] |
Normalize node values (for using input costs directly).
| void ml::CSOLiveWireGraph::getShortestPathToStart | ( | VoxelPos | endPos, | |
| std::vector< VoxelPos > & | intermediatePositions, | |||
| int | neighborhoodMode, | |||
| bool | reverse = true | |||
| ) |
Computes the shortest path from the given endPos to the graph's internal start position.
The voxel positions of the computed path are filled into the given vector 'intermediatePositions'. The given neighborhood mode sets if whether a 4- or a 8-neighborhood should be searched. reverse indicates that the path should go from end to start instead of start to end
| void ml::CSOLiveWireGraph::resetGraphAndHeap | ( | ) |
Resets all costs and visited states.
| void ml::CSOLiveWireGraph::setLengthPenalty | ( | float | weight | ) | [inline] |
| void ml::CSOLiveWireGraph::setMaxPathLength | ( | float | maxLength | ) | [inline] |
| void ml::CSOLiveWireGraph::setPathCostThreshold | ( | bool | useThreshold, | |
| float | threshold | |||
| ) | [inline] |
Set whether the path cost threshold shall be used, and its value.
Definition at line 89 of file CSOLiveWireGraph.h.
| void ml::CSOLiveWireGraph::setStartPosition | ( | VoxelPos | startVoxelPos | ) |
Sets the starting position.
| void ml::CSOLiveWireGraph::setWeights | ( | float | w1, | |
| float | w2, | |||
| float | w3 | |||
| ) |
set weights for individual costs
| void ml::CSOLiveWireGraph::updateResultCosts | ( | ) |
Compute the costs for all edges as a preprocessing step to speedup runtime computation.
float ml::CSOLiveWireGraph::_directionLengths[8] [protected] |
unsigned int ml::CSOLiveWireGraph::_imageSizeX [protected] |
unsigned int ml::CSOLiveWireGraph::_imageSizeY [protected] |
std::vector< VoxelPos > ml::CSOLiveWireGraph::_lastPathPositions [protected] |
The last found path (used to determine intersections with the new path).
Definition at line 114 of file CSOLiveWireGraph.h.
float ml::CSOLiveWireGraph::_lengthPenalty [protected] |
the higher this value the more direct path are preferred over longer paths
Definition at line 143 of file CSOLiveWireGraph.h.
CSOLiveWireNode** ml::CSOLiveWireGraph::_lwGraph [protected] |
The 2D array of nodes, representing the graph (edges exists from each voxel to its 8 neighborhood).
Definition at line 125 of file CSOLiveWireGraph.h.
float ml::CSOLiveWireGraph::_maxGlobalGradient [protected] |
float ml::CSOLiveWireGraph::_maxPathLength [protected] |
The maximal allowed length of a path that are search by live-wire.
Definition at line 155 of file CSOLiveWireGraph.h.
CSOObjectHeap<CSOLiveWireNode>* ml::CSOLiveWireGraph::_nodeHeap [protected] |
int ml::CSOLiveWireGraph::_offsetX[8] [protected] |
int ml::CSOLiveWireGraph::_offsetY[8] [protected] |
float ml::CSOLiveWireGraph::_pathConstThreshold [protected] |
Threshold value for path costs: if the path costs are greater than this value, the according section is not added to the output list of positions.
Definition at line 149 of file CSOLiveWireGraph.h.
VoxelPos ml::CSOLiveWireGraph::_startVoxelPos [protected] |
bool ml::CSOLiveWireGraph::_useCostsDirectly [protected] |
Should we use the cost values from the image directly?
Definition at line 152 of file CSOLiveWireGraph.h.
bool ml::CSOLiveWireGraph::_usePathCostThreshold [protected] |
float ml::CSOLiveWireGraph::_voxelSizeX [protected] |
float ml::CSOLiveWireGraph::_voxelSizeY [protected] |
float ml::CSOLiveWireGraph::_w1 [protected] |
float ml::CSOLiveWireGraph::_w2 [protected] |
Definition at line 141 of file CSOLiveWireGraph.h.
float ml::CSOLiveWireGraph::_w3 [protected] |
Definition at line 141 of file CSOLiveWireGraph.h.
1.5.8