]> Creatis software - clitk.git/blob - common/vvImage.h
a0ab108b95e16a323f691b88ef87cd33ec5ef22f
[clitk.git] / common / vvImage.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
18 #ifndef VVIMAGE_H
19 #define VVIMAGE_H
20
21 #include <iostream>
22 #include <vector>
23 #include <itkObjectFactory.h>
24 #include <vtkSmartPointer.h>
25
26 class vtkImageData;
27 class vtkImageReslice;
28 class vtkAbstractTransform;
29
30 class vvImage : public itk::LightObject {
31 public :
32   typedef vvImage Self;
33   typedef itk::SmartPointer<Self> Pointer;
34   itkNewMacro(Self);
35
36   void Init();
37   void Reset();
38
39   void SetImage(std::vector<vtkImageData*> images);
40   void AddImage(vtkImageData* image);
41   const std::vector<vtkImageData*>& GetVTKImages();
42   vtkImageData* GetFirstVTKImageData();
43   
44   int GetNumberOfDimensions() const;
45   int GetNumberOfSpatialDimensions();
46   ///Writes the scalar range to the provided array, which must have room for two doubles
47   void GetScalarRange(double* range);
48   unsigned long GetActualMemorySize();
49   std::vector<double> GetSpacing();
50   std::vector<double> GetOrigin() const;
51   std::vector<int> GetSize();
52   std::string GetScalarTypeAsString();
53   int GetNumberOfScalarComponents();
54   int GetScalarSize();
55   bool IsTimeSequence();
56   bool IsScalarTypeInteger();
57   bool IsScalarTypeInteger(int t);
58
59   void SetTimeSpacing(double s) { mTimeSpacing = s; }
60   void SetTimeOrigin(double o) { mTimeOrigin = o; }
61   void SetTransform(vtkAbstractTransform  *transform);
62
63 private:
64   vvImage();
65   ~vvImage();
66   std::vector<vtkImageData*> mVtkImages;
67   double mTimeOrigin;
68   double mTimeSpacing;
69   vtkSmartPointer<vtkImageReslice> mVtkImageReslice;
70 };
71
72 #endif