]> Creatis software - clitk.git/commitdiff
Remove reslice from vvImage. The transform is kept but it's up to the user to use...
authorsrit <srit>
Wed, 13 Apr 2011 17:16:36 +0000 (17:16 +0000)
committersrit <srit>
Wed, 13 Apr 2011 17:16:36 +0000 (17:16 +0000)
common/vvImage.cxx
common/vvImage.h
common/vvImage.txx

index 2db040b4bb89969e7cfac3b5c5079ff74e0eba53..71986c64f94c42296c86828c08c97e9a9c818e4c 100644 (file)
@@ -26,7 +26,6 @@
 
 // vtk
 #include <vtkImageData.h>
-#include <vtkImageReslice.h>
 #include <vtkTransform.h>
 
 // std
@@ -52,7 +51,6 @@ void vvImage::Init()
 //--------------------------------------------------------------------
 vvImage::~vvImage()
 {
-  //  DD("vvImage got deleted!");
   Reset();
 }
 //--------------------------------------------------------------------
@@ -60,10 +58,7 @@ vvImage::~vvImage()
 //--------------------------------------------------------------------
 void vvImage::Reset()
 {
-  mVtkImages.resize(0);
-  mTransformedVtkImages.resize(0);
-  mVtkImageReslice.resize(0);
-
+  mVtkImages.clear();
   Init();
 }
 //--------------------------------------------------------------------
@@ -199,13 +194,6 @@ const std::vector<vtkImageData*>& vvImage::GetVTKImages()
 }
 //--------------------------------------------------------------------
 
-//--------------------------------------------------------------------
-const std::vector<vtkImageData*>& vvImage::GetTransformedVTKImages()
-{
-  return mTransformedVtkImages;
-}
-//--------------------------------------------------------------------
-
 //--------------------------------------------------------------------
 vtkImageData* vvImage::GetFirstVTKImageData()
 {
@@ -239,7 +227,6 @@ bool vvImage::IsScalarTypeInteger(int t)
     return false;
   }
 }
-
 //--------------------------------------------------------------------
 
 //--------------------------------------------------------------------
@@ -250,16 +237,6 @@ vtkSmartPointer<vtkTransform> vvImage::GetTransform()
 //--------------------------------------------------------------------
 
 
-//--------------------------------------------------------------------
-void vvImage::UpdateReslice()
-{
-  for (unsigned int i=0; i<mVtkImageReslice.size(); i++) {
-    mVtkImageReslice[i]->Update();
-  }
-}
-//--------------------------------------------------------------------
-
-
 //--------------------------------------------------------------------
 bool vvImage::HaveSameSizeAndSpacingThan(vvImage * other)
 {
index 37fa547cf163b6dcae1e0f0a9c8e4383bcd10270..b592306712005a9d18a85ade4ccf712e0af09930 100644 (file)
@@ -23,7 +23,6 @@
 #include <itkObjectFactory.h>
 #include <itkProcessObject.h>
 
-#include <vtkImageReslice.h>
 #include <vtkSmartPointer.h>
 #include <vtkTransform.h>
 
@@ -42,7 +41,6 @@ public :
   void Reset();
   template<class TItkImageType> void AddItkImage(TItkImageType *input);
   const std::vector<vtkImageData*>& GetVTKImages();
-  const std::vector<vtkImageData*>& GetTransformedVTKImages();
   vtkImageData* GetFirstVTKImageData();
   int GetNumberOfDimensions() const;
   int GetNumberOfSpatialDimensions();
@@ -60,7 +58,6 @@ public :
   vtkSmartPointer<vtkTransform> GetTransform();
   void SetTimeSpacing(double s) { mTimeSpacing = s; }
   void SetTimeOrigin(double o) { mTimeOrigin = o; }
-  void UpdateReslice();
   bool HaveSameSizeAndSpacingThan(vvImage * other);
 
 private:
@@ -69,10 +66,7 @@ private:
 
   std::vector< ConverterPointer > mItkToVtkConverters;
   std::vector<vtkImageData*> mVtkImages;
-
-  std::vector< vtkSmartPointer<vtkImageReslice> > mVtkImageReslice;
   vtkSmartPointer<vtkTransform> mTransform;
-  std::vector<vtkImageData*> mTransformedVtkImages;
 
   double mTimeOrigin;
   double mTimeSpacing;
index c3491f8be4e3d9497528317d107bff9eefbb5858..43631f6138adfbac36fcab5fcc5704a1a73f6dae 100755 (executable)
@@ -17,7 +17,7 @@ void vvImage::AddItkImage(TItkImageType *input)
   converter->Update();
   mVtkImages.push_back( converter->GetOutput() );
   
- // Account for direction in transform. The offset is already accounted for
 // Account for direction in transform. The offset is already accounted for
   // in the VTK image coordinates, no need to put it in the transform.
   vtkSmartPointer<vtkMatrix4x4> matrix = vtkSmartPointer<vtkMatrix4x4>::New();
   matrix->Identity();
@@ -25,16 +25,6 @@ void vvImage::AddItkImage(TItkImageType *input)
     for(unsigned int i=0; i<input->GetImageDimension(); i++)
       (*matrix)[i][j] = input->GetDirection()[i][j];
   mTransform->SetMatrix(matrix);
-
-  // Create the corresponding transformed image
-  mVtkImageReslice.push_back(vtkSmartPointer<vtkImageReslice>::New());
-  mVtkImageReslice.back()->SetInterpolationModeToLinear();
-  mVtkImageReslice.back()->AutoCropOutputOn();
-  mVtkImageReslice.back()->SetBackgroundColor(-1000,-1000,-1000,1);
-  mVtkImageReslice.back()->SetResliceTransform(mTransform);
-  mVtkImageReslice.back()->SetInput(0, converter->GetOutput());
-  mVtkImageReslice.back()->UpdateInformation();
-  mTransformedVtkImages.push_back( mVtkImageReslice.back()->GetOutput(0) );
 }
 //--------------------------------------------------------------------