]> Creatis software - clitk.git/commitdiff
Removed vtkGridTransform and turned off vtkImageReslice with a define
authorsrit <srit>
Tue, 12 Oct 2010 21:30:15 +0000 (21:30 +0000)
committersrit <srit>
Tue, 12 Oct 2010 21:30:15 +0000 (21:30 +0000)
common/vvImage.cxx
common/vvImage.h

index 4675cf5b661453428bd561d81bbc623c75be092c..79f2381fc8c5f4e13992ab8099d3e109f9b08e96 100644 (file)
 #include <vtkImageReslice.h>
 #include <cassert>
 
-#include <vtkGeneralTransform.h>
 #include <vtkTransform.h>
-#include <vtkGridTransform.h>
+
+#define NO_RESLICE 1
 
 //--------------------------------------------------------------------
-vvImage::vvImage():mGeneralTransform(vtkSmartPointer<vtkGeneralTransform>::New()),
-                  mTransform       (vtkSmartPointer<vtkTransform>::New()),
-                  mGridTransform   (vtkSmartPointer<vtkGridTransform>::New())
+vvImage::vvImage():mTransform(vtkSmartPointer<vtkTransform>::New())
 {
-  mGeneralTransform->Concatenate(mTransform);
-  mGeneralTransform->Concatenate(mGridTransform);
   Init();
 }
 //--------------------------------------------------------------------
@@ -59,7 +55,11 @@ vvImage::~vvImage()
 void vvImage::Reset()
 {
   for (unsigned int i = 0; i < mVtkImages.size(); i++)
+#ifdef NO_RESLICE
+    mVtkImages[i]->Delete();
+#else
     mVtkImageReslice[i]->GetInput()->Delete();
+#endif
 
   mVtkImages.resize(0);
   mVtkImageReslice.resize(0);
@@ -81,15 +81,18 @@ void vvImage::SetImage(std::vector< vtkImageData* > images)
 //--------------------------------------------------------------------
 void vvImage::AddImage(vtkImageData* image)
 {
-  mVtkImageReslice.push_back(vtkSmartPointer<vtkImageReslice>::New());
+#ifdef NO_RESLICE
+  mVtkImages.push_back(image);
+  return;
+#endif
 
+  mVtkImageReslice.push_back(vtkSmartPointer<vtkImageReslice>::New());
   mVtkImageReslice.back()->SetInterpolationModeToLinear();
   mVtkImageReslice.back()->AutoCropOutputOn();
   mVtkImageReslice.back()->SetBackgroundColor(-1000,-1000,-1000,1);
-  mVtkImageReslice.back()->SetResliceTransform(mGeneralTransform);
+  mVtkImageReslice.back()->SetResliceTransform(mTransform);
   mVtkImageReslice.back()->SetInput(0, image);
   mVtkImageReslice.back()->Update();
-
   mVtkImages.push_back( mVtkImageReslice.back()->GetOutput(0) );
 }
 //--------------------------------------------------------------------
@@ -272,14 +275,7 @@ bool vvImage::IsScalarTypeInteger(int t)
 //--------------------------------------------------------------------
 vtkSmartPointer<vtkTransform> vvImage::GetTransform()
 {
-  return mTransform;
-}
-//--------------------------------------------------------------------
-
-//--------------------------------------------------------------------
-vtkSmartPointer<vtkGridTransform> vvImage::GetGridTransform()
-{
-  return mGridTransform;
+  return this->mTransform;
 }
 //--------------------------------------------------------------------
 
index 07987c78cda75b16c5d40d3c5f3949643dc083e8..6a30a454569d67021084ba8757c294c78f1b3088 100644 (file)
@@ -25,9 +25,7 @@
 
 class vtkImageData;
 class vtkImageReslice;
-class vtkGeneralTransform;
 class vtkTransform;
-class vtkGridTransform;
 
 //------------------------------------------------------------------------------
 class vvImage : public itk::LightObject
@@ -57,8 +55,6 @@ public :
   bool IsScalarTypeInteger();
   bool IsScalarTypeInteger(int t);
   vtkSmartPointer<vtkTransform> GetTransform();
-  vtkSmartPointer<vtkGridTransform> GetGridTransform();
-  void SetTransform(vtkSmartPointer<vtkTransform> transform);
   void SetTimeSpacing(double s) { mTimeSpacing = s; }
   void SetTimeOrigin(double o) { mTimeOrigin = o; }
   void UpdateReslice();
@@ -69,9 +65,7 @@ private:
 
   std::vector<vtkImageData*> mVtkImages;
   std::vector< vtkSmartPointer<vtkImageReslice> > mVtkImageReslice;
-  vtkSmartPointer<vtkGeneralTransform> mGeneralTransform;
   vtkSmartPointer<vtkTransform> mTransform;
-  vtkSmartPointer<vtkGridTransform> mGridTransform;
   double mTimeOrigin;
   double mTimeSpacing;
 };