]> Creatis software - creaContours.git/blob - lib/kernel_ManagerContour_NDimensions/ImageSourceThing.cxx
be82051c9343e55298165e4f6af39a0d98a5358c
[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[2] = {x1, x2};
85                 return retVal;
86         }
87
88         /**
89         * Gets the max value of the y-axis
90         * @return y-extend_MAX
91         */
92         int ImageSourceThing :: getMax_Y()
93         {
94                 int x1, x2, y1, y2, z1, z2;
95                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
96                 return y2;
97         }
98
99         /**
100         * Gets the min value of the y-axis
101         * @return y-extend_MIN
102         */
103         int ImageSourceThing :: getMin_Y()
104         {
105                 int x1, x2, y1, y2, z1, z2;
106                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
107                 return y1;
108         }
109
110         
111         /**
112         * Gets the range values of the y-axis
113         * @return y-extend pointer to a 2 sized []
114         */
115         int * ImageSourceThing :: getRangeY()
116         { 
117                 int x1, x2, y1, y2, z1, z2;
118                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
119                 int retVal[2] = {y1, y2};
120                 return retVal;
121         }
122
123         /**
124         * Gets the max value of the z-axis
125         * @return z-extend_MAX
126         */
127         int ImageSourceThing :: getMax_Z()
128         {
129                 int x1, x2, y1, y2, z1, z2;
130                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
131                 return z2;
132         }
133
134         /**
135         * Gets the min value of the z-axis
136         * @return z-extend_MIN
137         */
138         int ImageSourceThing :: getMin_Z()
139         { 
140                 int x1, x2, y1, y2, z1, z2;
141                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
142                 return z1;
143         }
144
145         
146         /**
147         * Gets the range values of the z-axis
148         * @return z-extend pointer to a 2 sized []
149         */
150         int * ImageSourceThing :: getRangeZ()
151         { 
152                 int x1, x2, y1, y2, z1, z2;
153                 sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
154                 int retVal[2] = {z1, z2};
155                 return retVal;
156         }
157
158         
159         /**
160         * Gets the range values of the x-axis
161         * @return x-extend pointer to a 6 sized []
162         */
163         int * ImageSourceThing :: getAllRanges()
164         { 
165                 return sourceImage-> GetExtent();
166         }