MeVisLab Toolbox Reference
CSOLiveWireGraph.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 
15 
16 #pragma once
17 
18 
19 #include "MLCSOSystem.h"
20 
21 #include "CSOLiveWireNode.h"
22 #include "CSOObjectHeap.h"
23 
24 
25 ML_START_NAMESPACE
26 
28 
31 {
34 };
35 
37 
38 class CSOLiveWireGraphBase;
39 
42 {
43 
44 public:
46  CSOLiveWireGraph(float* imageData, unsigned int sizex, unsigned int sizey, bool useCostsDirectly, float voxelSizeX=1.0f, float voxelSizeY=1.0f);
47 
50 
52  void setStartPosition(VoxelPos startVoxelPos);
53 
58  void getShortestPathToStart(VoxelPos endPos, std::vector<VoxelPos>& intermediatePositions, CSOLiveWireNeighborhoodMode neighborhoodMode, bool reverse=true);
59 
61  void setWeights(float weightGradient, float weightLaplace, float weightDirection);
62 
63 protected:
64  CSOLiveWireGraphBase* _impl;
65 };
66 
68 
69 ML_END_NAMESPACE
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
Definition: MLCSOSystem.h:23
The class maintains a graph for applying a shortest path algorithm on.
void getShortestPathToStart(VoxelPos endPos, std::vector< VoxelPos > &intermediatePositions, CSOLiveWireNeighborhoodMode neighborhoodMode, bool reverse=true)
Computes the shortest path from the given endPos to the graph's internal start position.
CSOLiveWireGraph(float *imageData, unsigned int sizex, unsigned int sizey, bool useCostsDirectly, float voxelSizeX=1.0f, float voxelSizeY=1.0f)
Constructor, takes an array with image values and the image's size as arguments.
void setWeights(float weightGradient, float weightLaplace, float weightDirection)
Sets the weights for individual costs (only used if useCostsDirectly == false)
CSOLiveWireGraphBase * _impl
void setStartPosition(VoxelPos startVoxelPos)
Sets the starting position.
~CSOLiveWireGraph()
Standard destructor.
CSOLiveWireNeighborhoodMode
The neighborhood modes for the graph search.
@ CSO_LIVE_WIRE_8_NEIGHBORHOOD
8 neighborhood (main directions and the diagonals).
@ CSO_LIVE_WIRE_4_NEIGHBORHOOD
4 neighborhood (just the main directions).
Structure holding a 2D voxel position.