]> Creatis software - clitk.git/blob - common/vvImage.h
again
[clitk.git] / common / vvImage.h
1 /*=========================================================================
2
3  Program:   vv
4  Language:  C++
5  Author :   Pierre Seroul (pierre.seroul@gmail.com)
6
7 Copyright (C) 2008
8 Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
9 CREATIS-LRMN http://www.creatis.insa-lyon.fr
10
11 This program is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, version 3 of the License.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
23 =========================================================================*/
24 #ifndef vvImage_h
25 #define vvImage_h
26
27 #include <iostream>
28 #include <vector>
29 #include <itkObjectFactory.h>
30
31 class vtkImageData;
32
33 class vvImage : public itk::LightObject
34 {
35 public :
36     typedef vvImage Self;
37     typedef itk::SmartPointer<Self> Pointer;
38     itkNewMacro(Self);
39
40     void Init();
41     void SetImage(std::vector<vtkImageData*> images);
42     void AddImage(vtkImageData* image);
43     const std::vector<vtkImageData*>& GetVTKImages() {
44         return mVtkImages;
45     }
46
47     int GetNumberOfDimensions() const;
48     int GetNumberOfSpatialDimensions();
49     ///Writes the scalar range to the provided array, which must have room for two doubles
50     void GetScalarRange(double* range);
51     unsigned long GetActualMemorySize();
52     std::vector<double> GetSpacing();
53     std::vector<double> GetOrigin() const;
54     std::vector<int> GetSize();
55     std::string GetScalarTypeAsString();
56     int GetNumberOfScalarComponents();
57     int GetScalarSize();
58     bool IsTimeSequence() {
59         return mVtkImages.size()>1;
60     }
61
62 private:
63     vvImage();
64     ~vvImage();
65     std::vector<vtkImageData*> mVtkImages;
66
67 };
68
69 #endif