]> Creatis software - creaContours.git/blob - lib/kernel_ManagerContour_NDimensions/ImageSourceThing.cxx
855b196c918e9a73b8257d264b05e9d360433ea2
[creaContours.git] / lib / kernel_ManagerContour_NDimensions / ImageSourceThing.cxx
1
2 //----------------------------------------------------------------------------------------------------------------
3 // Class definition include
4 //----------------------------------------------------------------------------------------------------------------
5 #include "ImageSourceThing.h"
6
7 //----------------------------------------------------------------------------------------------------------------
8 // Class implementation
9 //----------------------------------------------------------------------------------------------------------------
10 /** @file ImageSourceThing.cxx */
11
12 //------------------------------------------------------------------------------------------------------------
13 // Constructors & Destructors
14 //------------------------------------------------------------------------------------------------------------
15
16         /*
17         * Creates the source image with the given parameter
18         * @param sourceImage The image source to set.
19         */
20         ImageSourceThing :: ImageSourceThing(vtkImageData * theSource)
21         {
22                 setSourceImage(theSource);
23         }
24
25         /*
26         * Destroys the image source
27         */
28         ImageSourceThing :: ~ImageSourceThing()
29         {
30
31         }
32 //------------------------------------------------------------------------------------------------------------
33 // Methods
34 //------------------------------------------------------------------------------------------------------------
35
36         /*
37         * Gets the source image 
38         * @return sourceImage The image source.
39         */
40         vtkImageData * ImageSourceThing :: getSourceImage()
41         {
42                 return sourceImage;
43         }
44
45         /*
46         * Sets the source image 
47         * @param sourceImage The image source.
48         */
49         void ImageSourceThing :: setSourceImage( vtkImageData *  theSource)
50         {
51                 sourceImage = theSource;
52         }
53    
54    /**
55         * Gets the max value of the x-axis
56         * @return x-extend_MAX
57         */
58         int ImageSourceThing :: getMax_X()
59         { 
60                 int x1, x2, y1, y2, z1, z2;
61                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
62                 return x2;
63         }
64
65         /**
66         * Gets the min value of the x-axis
67         * @return x-extend_MIN
68         */
69         int ImageSourceThing :: getMin_X()
70         { 
71                 int x1, x2, y1, y2, z1, z2;
72                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
73                 return x1;
74         }
75
76         /**
77         * Gets the range values of the x-axis
78         * @return x-extend pointer to a 2 sized []
79         */
80         int * ImageSourceThing :: getRangeX()
81         {
82                 int x1, x2, y1, y2, z1, z2;
83                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
84                 int* retVal = new int[2];
85                 retVal[0]= x1;
86                 retVal[1]= x2;
87                 return retVal;
88         }
89
90         /**
91         * Gets the max value of the y-axis
92         * @return y-extend_MAX
93         */
94         int ImageSourceThing :: getMax_Y()
95         {
96                 int x1, x2, y1, y2, z1, z2;
97                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
98                 return y2;
99         }
100
101         /**
102         * Gets the min value of the y-axis
103         * @return y-extend_MIN
104         */
105         int ImageSourceThing :: getMin_Y()
106         {
107                 int x1, x2, y1, y2, z1, z2;
108                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
109                 return y1;
110         }
111
112         
113         /**
114         * Gets the range values of the y-axis
115         * @return y-extend pointer to a 2 sized []
116         */
117         int * ImageSourceThing :: getRangeY()
118         { 
119                 int x1, x2, y1, y2, z1, z2;
120                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
121                 int* retVal = new int[2];
122                 retVal[0]= y1;
123                 retVal[1]= y2;
124                 return retVal;
125
126         }
127
128         /**
129         * Gets the max value of the z-axis
130         * @return z-extend_MAX
131         */
132         int ImageSourceThing :: getMax_Z()
133         {
134                 int x1, x2, y1, y2, z1, z2;
135                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
136                 return z2;
137         }
138
139         /**
140         * Gets the min value of the z-axis
141         * @return z-extend_MIN
142         */
143         int ImageSourceThing :: getMin_Z()
144         { 
145                 int x1, x2, y1, y2, z1, z2;
146                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
147                 return z1;
148         }
149
150         
151         /**
152         * Gets the range values of the z-axis
153         * @return z-extend pointer to a 2 sized []
154         */
155         int * ImageSourceThing :: getRangeZ()
156         { 
157                 int x1, x2, y1, y2, z1, z2;
158                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
159                 int* retVal = new int[2];
160                 retVal[0]= z1;
161                 retVal[1]= z2;
162                 return retVal;
163
164
165         }
166
167         
168         /**
169         * Gets the range values of the x-axis
170         * @return x-extend pointer to a 6 sized []
171         */
172         int * ImageSourceThing :: getAllRanges()
173         { 
174                 return sourceImage-> GetExtent();
175         }