#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();
}
//--------------------------------------------------------------------
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);
//--------------------------------------------------------------------
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) );
}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
vtkSmartPointer<vtkTransform> vvImage::GetTransform()
{
- return mTransform;
-}
-//--------------------------------------------------------------------
-
-//--------------------------------------------------------------------
-vtkSmartPointer<vtkGridTransform> vvImage::GetGridTransform()
-{
- return mGridTransform;
+ return this->mTransform;
}
//--------------------------------------------------------------------
class vtkImageData;
class vtkImageReslice;
-class vtkGeneralTransform;
class vtkTransform;
-class vtkGridTransform;
//------------------------------------------------------------------------------
class vvImage : public itk::LightObject
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();
std::vector<vtkImageData*> mVtkImages;
std::vector< vtkSmartPointer<vtkImageReslice> > mVtkImageReslice;
- vtkSmartPointer<vtkGeneralTransform> mGeneralTransform;
vtkSmartPointer<vtkTransform> mTransform;
- vtkSmartPointer<vtkGridTransform> mGridTransform;
double mTimeOrigin;
double mTimeSpacing;
};