]> Creatis software - clitk.git/blob - common/vvImage.h
- set correct spacing/origin for 4D
[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
25 class vtkImageData;
26
27 class vvImage : public itk::LightObject {
28 public :
29   typedef vvImage Self;
30   typedef itk::SmartPointer<Self> Pointer;
31   itkNewMacro(Self);
32
33   void Init();
34   void SetImage(std::vector<vtkImageData*> images);
35   void AddImage(vtkImageData* image);
36   const std::vector<vtkImageData*>& GetVTKImages();
37   vtkImageData* GetFirstVTKImageData();
38   
39   int GetNumberOfDimensions() const;
40   int GetNumberOfSpatialDimensions();
41   ///Writes the scalar range to the provided array, which must have room for two doubles
42   void GetScalarRange(double* range);
43   unsigned long GetActualMemorySize();
44   std::vector<double> GetSpacing();
45   std::vector<double> GetOrigin() const;
46   std::vector<int> GetSize();
47   std::string GetScalarTypeAsString();
48   int GetNumberOfScalarComponents();
49   int GetScalarSize();
50   bool IsTimeSequence();
51   bool IsScalarTypeInteger();
52   bool IsScalarTypeInteger(int t);
53
54   void SetTimeSpacing(double s) { mTimeSpacing = s; }
55   void SetTimeOrigin(double o) { mTimeOrigin = o; }
56
57 private:
58   vvImage();
59   ~vvImage();
60   std::vector<vtkImageData*> mVtkImages;
61   double mTimeOrigin;
62   double mTimeSpacing;
63
64 };
65
66 #endif