]> Creatis software - clitk.git/blob - common/vvImage.h
Added Manual Registration Tool with updated Median Filter tool
[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 class vtkImageReslice;
30 class vtkAbstractTransform;
31
32 class vvImage : public itk::LightObject {
33 public :
34   typedef vvImage Self;
35   typedef itk::SmartPointer<Self> Pointer;
36   itkNewMacro(Self);
37
38   void Init();
39   void Reset();
40
41   void SetImage(std::vector<vtkImageData*> images);
42   void AddImage(vtkImageData* image);
43   const std::vector<vtkImageData*>& GetVTKImages();
44   vtkImageData* GetFirstVTKImageData();
45   
46   int GetNumberOfDimensions() const;
47   int GetNumberOfSpatialDimensions();
48   ///Writes the scalar range to the provided array, which must have room for two doubles
49   void GetScalarRange(double* range);
50   unsigned long GetActualMemorySize();
51   std::vector<double> GetSpacing();
52   std::vector<double> GetOrigin() const;
53   std::vector<int> GetSize();
54   std::string GetScalarTypeAsString();
55   int GetNumberOfScalarComponents();
56   int GetScalarSize();
57   bool IsTimeSequence();
58   bool IsScalarTypeInteger();
59   bool IsScalarTypeInteger(int t);
60   vtkAbstractTransform * GetTransform();
61   void SetTransform(vtkAbstractTransform  *transform);
62   vtkImageReslice* GetVTKImageReslice();
63   void SetVTKImageReslice(vtkImageReslice *reslice);
64   
65   void SetRotateX(int xvalue);  
66   void SetRotateY(int yvalue);  
67   void SetRotateZ(int zvalue);
68
69   void SetTranslationX(int xvalue);  
70   void SetTranslationY(int yvalue);  
71   void SetTranslationZ(int zvalue);
72   void SetOrigin(double value[3]);
73  private:
74
75   void SetTimeSpacing(double s) { mTimeSpacing = s; }
76   void SetTimeOrigin(double o) { mTimeOrigin = o; }
77
78  private:
79   vvImage();
80   ~vvImage();
81   std::vector<vtkImageData*> mVtkImages;
82   vtkSmartPointer<vtkImageReslice> mVtkImageReslice;
83   vtkSmartPointer<vtkTransform> transform;
84   double mTimeOrigin;
85   double mTimeSpacing;
86   double * origin;
87 };
88
89 #endif