]> Creatis software - clitk.git/blob - common/vvImage.h
Removed vtkGridTransform and turned off vtkImageReslice with a define
[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 vtkTransform;
29
30 //------------------------------------------------------------------------------
31 class vvImage : public itk::LightObject
32 {
33 public :
34   typedef vvImage Self;
35   typedef itk::SmartPointer<Self> Pointer;
36   itkNewMacro(Self);
37
38   void Init();
39   void Reset();
40   void SetImage(std::vector<vtkImageData*> images);
41   void AddImage(vtkImageData* image);
42   const std::vector<vtkImageData*>& GetVTKImages();
43   vtkImageData* GetFirstVTKImageData();
44   int GetNumberOfDimensions() const;
45   int GetNumberOfSpatialDimensions();
46   void GetScalarRange(double* range);
47   unsigned long GetActualMemorySize();
48   std::vector<double> GetSpacing();
49   std::vector<double> GetOrigin() const;
50   std::vector<int> GetSize();
51   std::string GetScalarTypeAsITKString();
52   int GetNumberOfScalarComponents();
53   int GetScalarSize();
54   bool IsTimeSequence();
55   bool IsScalarTypeInteger();
56   bool IsScalarTypeInteger(int t);
57   vtkSmartPointer<vtkTransform> GetTransform();
58   void SetTimeSpacing(double s) { mTimeSpacing = s; }
59   void SetTimeOrigin(double o) { mTimeOrigin = o; }
60   void UpdateReslice();
61
62 private:
63   vvImage();
64   ~vvImage();
65
66   std::vector<vtkImageData*> mVtkImages;
67   std::vector< vtkSmartPointer<vtkImageReslice> > mVtkImageReslice;
68   vtkSmartPointer<vtkTransform> mTransform;
69   double mTimeOrigin;
70   double mTimeSpacing;
71 };
72 //------------------------------------------------------------------------------
73
74 //------------------------------------------------------------------------------
75 vtkImageData * CopyAndCastToFloatFrom(vtkImageData * p);
76 //------------------------------------------------------------------------------
77
78 #endif