// std
#include <cassert>
-#define NO_RESLICE 1
-
//--------------------------------------------------------------------
vvImage::vvImage():mTransform(vtkSmartPointer<vtkTransform>::New())
{
void vvImage::Reset()
{
mVtkImages.resize(0);
+ mTransformedVtkImages.resize(0);
mVtkImageReslice.resize(0);
Init();
int vvImage::GetNumberOfSpatialDimensions()
{
return mImageDimension;
- // int dim=GetNumberOfDimensions();
- // if (IsTimeSequence())
- // return dim+1;
- // else
- // return dim;
}
//--------------------------------------------------------------------
return mImageDimension+1;
else
return mImageDimension;
- // int dimension = 3;
- // int extent[6];
- // mVtkImages[0]->GetWholeExtent(extent);
- // if (extent[5] - extent[4] >= 1)
- // dimension++;
- // // if (mVtkImages.size() > 1)
- // // dimension++;
- // return dimension;
}
return 0;
}
}
//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+const std::vector<vtkImageData*>& vvImage::GetTransformedVTKImages()
+{
+ return mTransformedVtkImages;
+}
+//--------------------------------------------------------------------
+
//--------------------------------------------------------------------
vtkImageData* vvImage::GetFirstVTKImageData()
{
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();
std::vector< ConverterPointer > mItkToVtkConverters;
std::vector<vtkImageData*> mVtkImages;
+
std::vector< vtkSmartPointer<vtkImageReslice> > mVtkImageReslice;
vtkSmartPointer<vtkTransform> mTransform;
+ std::vector<vtkImageData*> mTransformedVtkImages;
+
double mTimeOrigin;
double mTimeSpacing;
unsigned int mImageDimension;
mImageDimension = TItkImageType::ImageDimension;
typedef itk::ImageToVTKImageFilter <TItkImageType> ConverterType;
typename ConverterType::Pointer converter = ConverterType::New();
+ mItkToVtkConverters.push_back(dynamic_cast< itk::ProcessObject *>(converter.GetPointer()));
converter->SetInput(input);
converter->Update();
-
- mItkToVtkConverters.push_back(dynamic_cast< itk::ProcessObject *>(converter.GetPointer()));
- mVtkImages.push_back(converter->GetOutput());
+ mVtkImages.push_back( converter->GetOutput() );
- //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, image);
- //mVtkImageReslice.back()->Update();
- //mVtkImages.push_back( mVtkImageReslice.back()->GetOutput(0) );
+ 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) );
}
//--------------------------------------------------------------------