1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
29 #ifndef __VTK__VTK__DIJKSTRA__IMAGE__DATA__H
30 #define __VTK__VTK__DIJKSTRA__IMAGE__DATA__H
32 #include "vtkPolyDataSource.h"
33 #include "vtkImageData.h"
34 #include "vtkPoints.h"
35 #include "vtkCellArray.h"
36 #include "vtkPolyData.h"
41 class vtkPriorityQueue;
43 class vtkDijkstraImageData : public vtkPolyDataSource
46 static vtkDijkstraImageData *New();
47 vtkTypeMacro(vtkDijkstraImageData,vtkPolyDataSource);
48 void PrintSelf(ostream& os, vtkIndent indent);
50 vtkSetMacro(SourceID,int);
51 vtkGetMacro(SourceID,int);
54 vtkSetMacro(SinkID,int);
55 vtkGetMacro(SinkID,int);
57 vtkGetObjectMacro(Parent,vtkIntArray);
61 virtual void SetBoundaryScalars(vtkDataArray*);
62 vtkGetObjectMacro(BoundaryScalars,vtkDataArray);
65 vtkSetMacro(NumberOfInputPoints,int);
66 vtkGetMacro(NumberOfInputPoints,int);
69 vtkSetMacro(NumberOfGraphNodes,int);
70 vtkGetMacro(NumberOfGraphNodes,int);
73 vtkIdList* GetShortestPathIdList();
76 vtkSetMacro(UseInverseDistance,int);
77 vtkGetMacro(UseInverseDistance,int);
80 vtkSetMacro(UseInverseSquaredDistance,int);
81 vtkGetMacro(UseInverseSquaredDistance,int);
84 vtkSetMacro(UseInverseExponentialDistance,int);
85 vtkGetMacro(UseInverseExponentialDistance,int);
87 vtkSetMacro(UseSquaredDistance,int);
88 vtkGetMacro(UseSquaredDistance,int);
92 unsigned long GetMTime();
95 void InitTraversePath();
96 int GetNextPathNode();
97 int GetNumberOfPathNodes();
100 void SetInput(vtkImageData*);
101 vtkImageData* GetInput();
104 void CreateGraph(vtkImageData *inData);
106 void FindNeighbors(vtkIdList *list,int id, vtkDataArray *scalars);
108 int findClosestPointInGraph(vtkDataArray *scalars,int id,int dim0,int dim1, int dim2);
113 void InitSingleSource(int startv);
115 void RunDijkstra(vtkDataArray *scalars,int source, int sink);
117 float EdgeCost(vtkDataArray *scalars, int u, int v);
118 void BuildShortestPath(int start,int end);
129 vtkDataArray *BoundaryScalars;
132 int NumberOfInputPoints;
133 int NumberOfGraphNodes;
135 int UseInverseDistance;
136 int UseInverseSquaredDistance;
137 int UseInverseExponentialDistance;
138 int UseSquaredDistance;
142 vtkPriorityQueue *PQ;
145 vtkIdList *ShortestPathIdList;
149 vtkIntArray *Visited;
154 int StopWhenEndReached;
158 vtkCellArray *lineas;
163 void init(vtkImageData *inData);
165 void printPointData(int pointID);
167 float fuerzaAtraccion(int u, float w);
171 vtkDijkstraImageData();
172 ~vtkDijkstraImageData();
179 // vtkDijstraImageData(const vtkDijkstraImageData&);
180 void operator=(const vtkDijkstraImageData&);
183 #endif //__VTK__VTK__DIJKSTRA__IMAGE__DATA__H