From: srit Date: Tue, 12 Oct 2010 21:30:15 +0000 (+0000) Subject: Removed vtkGridTransform and turned off vtkImageReslice with a define X-Git-Tag: v1.2.0~348 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=e11a1cffe5f20b584f80d534d400b00afc594146;p=clitk.git Removed vtkGridTransform and turned off vtkImageReslice with a define --- diff --git a/common/vvImage.cxx b/common/vvImage.cxx index 4675cf5..79f2381 100644 --- a/common/vvImage.cxx +++ b/common/vvImage.cxx @@ -23,17 +23,13 @@ #include #include -#include #include -#include + +#define NO_RESLICE 1 //-------------------------------------------------------------------- -vvImage::vvImage():mGeneralTransform(vtkSmartPointer::New()), - mTransform (vtkSmartPointer::New()), - mGridTransform (vtkSmartPointer::New()) +vvImage::vvImage():mTransform(vtkSmartPointer::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::New()); +#ifdef NO_RESLICE + mVtkImages.push_back(image); + return; +#endif + mVtkImageReslice.push_back(vtkSmartPointer::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 vvImage::GetTransform() { - return mTransform; -} -//-------------------------------------------------------------------- - -//-------------------------------------------------------------------- -vtkSmartPointer vvImage::GetGridTransform() -{ - return mGridTransform; + return this->mTransform; } //-------------------------------------------------------------------- diff --git a/common/vvImage.h b/common/vvImage.h index 07987c7..6a30a45 100644 --- a/common/vvImage.h +++ b/common/vvImage.h @@ -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 GetTransform(); - vtkSmartPointer GetGridTransform(); - void SetTransform(vtkSmartPointer transform); void SetTimeSpacing(double s) { mTimeSpacing = s; } void SetTimeOrigin(double o) { mTimeOrigin = o; } void UpdateReslice(); @@ -69,9 +65,7 @@ private: std::vector mVtkImages; std::vector< vtkSmartPointer > mVtkImageReslice; - vtkSmartPointer mGeneralTransform; vtkSmartPointer mTransform; - vtkSmartPointer mGridTransform; double mTimeOrigin; double mTimeSpacing; };