From b29eb65e42740eaea460a8c503f3df05bb554ffe Mon Sep 17 00:00:00 2001 From: srit Date: Wed, 13 Apr 2011 17:16:36 +0000 Subject: [PATCH] Remove reslice from vvImage. The transform is kept but it's up to the user to use it... --- common/vvImage.cxx | 25 +------------------------ common/vvImage.h | 6 ------ common/vvImage.txx | 12 +----------- 3 files changed, 2 insertions(+), 41 deletions(-) diff --git a/common/vvImage.cxx b/common/vvImage.cxx index 2db040b..71986c6 100644 --- a/common/vvImage.cxx +++ b/common/vvImage.cxx @@ -26,7 +26,6 @@ // vtk #include -#include #include // 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& vvImage::GetVTKImages() } //-------------------------------------------------------------------- -//-------------------------------------------------------------------- -const std::vector& vvImage::GetTransformedVTKImages() -{ - return mTransformedVtkImages; -} -//-------------------------------------------------------------------- - //-------------------------------------------------------------------- vtkImageData* vvImage::GetFirstVTKImageData() { @@ -239,7 +227,6 @@ bool vvImage::IsScalarTypeInteger(int t) return false; } } - //-------------------------------------------------------------------- //-------------------------------------------------------------------- @@ -250,16 +237,6 @@ vtkSmartPointer vvImage::GetTransform() //-------------------------------------------------------------------- -//-------------------------------------------------------------------- -void vvImage::UpdateReslice() -{ - for (unsigned int i=0; iUpdate(); - } -} -//-------------------------------------------------------------------- - - //-------------------------------------------------------------------- bool vvImage::HaveSameSizeAndSpacingThan(vvImage * other) { diff --git a/common/vvImage.h b/common/vvImage.h index 37fa547..b592306 100644 --- a/common/vvImage.h +++ b/common/vvImage.h @@ -23,7 +23,6 @@ #include #include -#include #include #include @@ -42,7 +41,6 @@ public : void Reset(); template void AddItkImage(TItkImageType *input); const std::vector& GetVTKImages(); - const std::vector& GetTransformedVTKImages(); vtkImageData* GetFirstVTKImageData(); int GetNumberOfDimensions() const; int GetNumberOfSpatialDimensions(); @@ -60,7 +58,6 @@ public : vtkSmartPointer 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 mVtkImages; - - std::vector< vtkSmartPointer > mVtkImageReslice; vtkSmartPointer mTransform; - std::vector mTransformedVtkImages; double mTimeOrigin; double mTimeSpacing; diff --git a/common/vvImage.txx b/common/vvImage.txx index c3491f8..43631f6 100755 --- a/common/vvImage.txx +++ b/common/vvImage.txx @@ -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 matrix = vtkSmartPointer::New(); matrix->Identity(); @@ -25,16 +25,6 @@ void vvImage::AddItkImage(TItkImageType *input) for(unsigned int i=0; iGetImageDimension(); i++) (*matrix)[i][j] = input->GetDirection()[i][j]; mTransform->SetMatrix(matrix); - - // Create the corresponding transformed image - mVtkImageReslice.push_back(vtkSmartPointer::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) ); } //-------------------------------------------------------------------- -- 2.47.1