]> Creatis software - creaRigidRegistration.git/blob - lib/Transparency.h
*** empty log message ***
[creaRigidRegistration.git] / lib / Transparency.h
1 #include "vtkImageData.h"
2 #include "vtkImageResample.h"
3 #include <iostream>
4 #include <fstream>
5 #include <string>
6 #include <vector>
7
8 class Transparency
9 {
10         public: 
11                 Transparency();
12                 ~Transparency();
13
14                 //Calculate the new image and save it in the attribute image
15                 void calculateImage();
16                 
17                 //Gets the result
18                 vtkImageData* getImage();
19                 
20                 void setImage1(vtkImageData *image);
21
22                 void setImage2(vtkImageData *image);
23
24                 void setPercent(int percent);
25
26                 //Initialize newImage points
27                 void initialize(int dimensions[], double spacing[]);
28
29                 //Constructs a new transparent image
30                 void createImage(vtkImageData *img1, vtkImageData *img2, int sizeX, int sizeY);
31
32                 //Template for constructing the image by image type
33                 template <class T> void createImageByType(T* dataImagePointer1, T* dataImagePointer2, T* dataImageResultPointer, vtkImageData *img1, vtkImageData *img2, int sizeX, int sizeY);
34
35         // --- Atributes --- //
36         private: 
37
38                 bool _processed;
39
40                 int _type;
41
42                 vtkImageData *_image1;
43
44                 vtkImageData *_image2;
45
46                 //Resulting image
47                 vtkImageData *_newImage;
48
49                 //Percent of transparency for the second image
50                 double _percent;
51
52                 // Image 1 extent (iniX, finX, iniY, finY, iniZ, finZ)
53                 int extImg1[6];
54                 // Dimensionality image 1
55                 int dimImg1[3];
56                 // Image 1 spacing
57                 double spcImg1[3];
58
59                 // Image 2 extent (iniX, finX, iniY, finY, iniZ, finZ)
60                 int extImg2[6];
61                 // Dimensionality image 2
62                 int dimImg2[3];
63                 // Image 2 spacing
64                 double spcImg2[3];
65
66 };
67