creaContours_lib
ImageSourceThing.cxx
Go to the documentation of this file.
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 # pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
15 #
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
20 # liability.
21 #
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25 
26 
27 //----------------------------------------------------------------------------------------------------------------
28 // Class definition include
29 //----------------------------------------------------------------------------------------------------------------
30 #include "ImageSourceThing.h"
31 
32 //----------------------------------------------------------------------------------------------------------------
33 // Class implementation
34 //----------------------------------------------------------------------------------------------------------------
37 //------------------------------------------------------------------------------------------------------------
38 // Constructors & Destructors
39 //------------------------------------------------------------------------------------------------------------
40 
41  /*
42  * Creates the source image with the given parameter
43  * @param sourceImage The image source to set.
44  */
45  ImageSourceThing :: ImageSourceThing(vtkImageData * theSource)
46  {
47  setSourceImage(theSource);
48  }
49 
50  /*
51  * Destroys the image source
52  */
54  {
55 
56  }
57 //------------------------------------------------------------------------------------------------------------
58 // Methods
59 //------------------------------------------------------------------------------------------------------------
60 
61  /*
62  * Gets the source image
63  * @return sourceImage The image source.
64  */
66  {
67  return sourceImage;
68  }
69 
70  /*
71  * Sets the source image
72  * @param sourceImage The image source.
73  */
74  void ImageSourceThing :: setSourceImage( vtkImageData * theSource)
75  {
76  sourceImage = theSource;
77  }
78 
84  {
85  int x1, x2, y1, y2, z1, z2;
86  sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
87  return x2;
88  }
89 
95  {
96  int x1, x2, y1, y2, z1, z2;
97  sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
98  return x1;
99  }
100 
106  {
107  int x1, x2, y1, y2, z1, z2;
108  sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
109  int* retVal = new int[2];
110  retVal[0]= x1;
111  retVal[1]= x2;
112  return retVal;
113  }
114 
120  {
121  int x1, x2, y1, y2, z1, z2;
122  sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
123  return y2;
124  }
125 
131  {
132  int x1, x2, y1, y2, z1, z2;
133  sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
134  return y1;
135  }
136 
137 
143  {
144  int x1, x2, y1, y2, z1, z2;
145  sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
146  int* retVal = new int[2];
147  retVal[0]= y1;
148  retVal[1]= y2;
149  return retVal;
150 
151  }
152 
158  {
159  int x1, x2, y1, y2, z1, z2;
160  sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
161  return z2;
162  }
163 
169  {
170  int x1, x2, y1, y2, z1, z2;
171  sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
172  return z1;
173  }
174 
175 
181  {
182  int x1, x2, y1, y2, z1, z2;
183  sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2);
184  int* retVal = new int[2];
185  retVal[0]= z1;
186  retVal[1]= z2;
187  return retVal;
188 
189 
190  }
191 
192 
198  {
199  return sourceImage-> GetExtent();
200  }