]> Creatis software - clitk.git/blobdiff - common/vvImage.h
Implemented new vvImage scheme: the itk to vtk image converter is now kept as a class...
[clitk.git] / common / vvImage.h
index b56f38c2ff753f2f58329155409e8743ed1e319c..cc0ce76028dd3734eeeb342aa80c9de996846d05 100644 (file)
@@ -1,7 +1,7 @@
 /*=========================================================================
   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
 
-  Authors belong to: 
+  Authors belong to:
   - University of LYON              http://www.universite-lyon.fr/
   - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
 ======================================================================-====*/
 #ifndef VVIMAGE_H
 #define VVIMAGE_H
+
 #include <iostream>
 #include <vector>
 #include <itkObjectFactory.h>
+#include <itkProcessObject.h>
+#include <vtkSmartPointer.h>
 
 class vtkImageData;
+class vtkImageReslice;
+class vtkTransform;
 
-class vvImage : public itk::LightObject {
+//------------------------------------------------------------------------------
+class vvImage : public itk::LightObject
+{
 public :
   typedef vvImage Self;
   typedef itk::SmartPointer<Self> Pointer;
+  typedef itk::ProcessObject::Pointer ConverterPointer;
   itkNewMacro(Self);
 
   void Init();
-  void SetImage(std::vector<vtkImageData*> images);
-  void AddImage(vtkImageData* image);
+  void Reset();
+  template<class TItkImageType> void AddItkImage(TItkImageType *input);
   const std::vector<vtkImageData*>& GetVTKImages();
   vtkImageData* GetFirstVTKImageData();
-  
   int GetNumberOfDimensions() const;
   int GetNumberOfSpatialDimensions();
-  ///Writes the scalar range to the provided array, which must have room for two doubles
   void GetScalarRange(double* range);
   unsigned long GetActualMemorySize();
   std::vector<double> GetSpacing();
   std::vector<double> GetOrigin() const;
   std::vector<int> GetSize();
-  std::string GetScalarTypeAsString();
+  std::string GetScalarTypeAsITKString();
   int GetNumberOfScalarComponents();
   int GetScalarSize();
   bool IsTimeSequence();
   bool IsScalarTypeInteger();
   bool IsScalarTypeInteger(int t);
+  vtkSmartPointer<vtkTransform> GetTransform();
+  void SetTimeSpacing(double s) { mTimeSpacing = s; }
+  void SetTimeOrigin(double o) { mTimeOrigin = o; }
+  void UpdateReslice();
 
 private:
   vvImage();
   ~vvImage();
-  std::vector<vtkImageData*> mVtkImages;
 
+  std::vector< ConverterPointer > mItkToVtkConverters;
+  std::vector<vtkImageData*> mVtkImages;
+  std::vector< vtkSmartPointer<vtkImageReslice> > mVtkImageReslice;
+  vtkSmartPointer<vtkTransform> mTransform;
+  double mTimeOrigin;
+  double mTimeSpacing;
 };
+//------------------------------------------------------------------------------
+
+#include "vvImage.txx"
 
 #endif