]> Creatis software - creaRigidRegistration.git/blob - lib/Surface.h
Black box that generates a grid over an image in order to visualize the deformation...
[creaRigidRegistration.git] / lib / Surface.h
1 #include "vtkImageData.h"
2 #include "vtkProp3D.h"
3 #include "vtkRenderer.h"
4 #include "vtkPoints.h"
5 #include "vtkCellArray.h"
6
7 #include <string>
8
9 class Surface 
10 {
11         //----------------------------------------------------------------------------------------
12         // Methods definition
13         //----------------------------------------------------------------------------------------
14         public:
15         //--------------------------
16         //Constructor & Destructor
17         //--------------------------            
18                 Surface(vtkImageData* imageData, int ZHeight, std::string iColor);
19                 ~Surface();
20         //--------------------------
21         //Methods
22         //--------------------------
23                 /*
24                 getting ready the points
25                 */
26                 void initialize(int dimensions[],double spacing[]);
27                 /*
28                 Calculate the new image and save it in the attribute imageResult
29                 it is used if the user had given the imageData
30                 */
31                 void createSurface(vtkImageData* imageData);
32                 
33                 /*
34                 Returns the Surface
35                 */
36                 vtkActor* getSurface();
37                 
38                 /*
39                 constructing image surface
40                 */
41                 void surface(vtkImageData* imageData);
42
43                 /*
44                 Template for constructing the surface by image type
45                 */
46                 template <class T> void surfaceByType(T* dataImagePointer, vtkImageData* imageData, T max);
47                 
48
49
50         //----------------------------------------------------------------------------------------
51         // Attributes declaration
52         //----------------------------------------------------------------------------------------
53         private: 
54                 /*
55                  Surface
56                 */
57                 vtkActor* surfaceResult;
58                 
59                 /*
60                 Maximun height of the surface
61                 */
62                 int height;
63                 
64                 /*
65                 Color for the surface
66                 */
67                 std::string color;
68
69                 /*
70                 The type of image being viewed
71                 */
72                 int imageType;
73
74                 /*
75                 The points of the surface
76                 */
77                 vtkPoints* surfacePoints;
78
79                 /*
80                 Cells to be constructed from the surface
81                 */
82                 vtkCellArray* surfaceCells;
83 };
84