]> Creatis software - creaRigidRegistration.git/blob - lib/CheckBoard.h
Black box that generates a grid over an image in order to visualize the deformation...
[creaRigidRegistration.git] / lib / CheckBoard.h
1 #include "vtkImageData.h"
2 #include "vtkImageResample.h"
3 #include <iostream>
4 #include <fstream>
5 #include <string>
6 #include <vector>
7
8 class CheckBoard
9 {
10         public: 
11                 CheckBoard();
12                 ~CheckBoard();
13
14                 //Initialize newImage points
15                 void initialize(int dimensions[], double spacing[]);
16
17                 //Calculate the new image and save it in the attribute image
18                 void calculateImage();
19                 
20                 //Gets the result
21                 vtkImageData* getFilteredImage();
22                 
23                 //Gets the image Size
24                 int getImageSize();
25
26                 //Constructs new image from image 2
27                 void createImage(vtkImageData *img1, vtkImageData *img2, int sizeX, int sizeY);
28
29                 void setInputImage1(vtkImageData *_image);
30
31                 void setInputImage2(vtkImageData *_image);
32
33                 void setCols(int cols);
34
35                 void setRows(int rows);
36                 template <class T> void createImageByType(T* dataImagePointer1, T* dataImagePointer2, T* dataImageResultPointer, vtkImageData *img1, vtkImageData *img2, int sizeX, int sizeY);
37
38         // --- Atributes --- //
39         private: 
40
41                 bool processed;
42
43                 int type;
44
45                 vtkImageData *image1;
46
47                 vtkImageData *image2;
48
49                 //Resulting image
50                 vtkImageData *newImage;
51
52                 //Image Resampler
53                 vtkImageResample *resample;
54
55                 //Rsulting image from the resampler
56                 vtkImageData *result;
57
58                 //Total number of divisions for the X axis (colums)
59                 int squaresX;
60
61                 //Total number of divisions for the Y axis (rows)
62                 int squaresY; 
63
64                 // Image 1 extent (iniX, finX, iniY, finY, iniZ, finZ)
65                 int extImg1[6];
66                 // Dimensionality image 1
67                 int dimImg1[3];
68                 // Image 1 spacing
69                 double spcImg1[3];
70
71                 // Image 2 extent (iniX, finX, iniY, finY, iniZ, finZ)
72                 int extImg2[6];
73                 // Dimensionality image 2
74                 int dimImg2[3];
75                 // Image 2 spacing
76                 double spcImg2[3];
77
78 };
79
80 //#endif
81
82