1 #include <itkImageToVTKImageFilter.h>
3 //--------------------------------------------------------------------
4 template<class TItkImageType>
5 void vvImage::AddItkImage(TItkImageType *input)
7 mImageDimension = TItkImageType::ImageDimension;
8 typedef itk::ImageToVTKImageFilter <TItkImageType> ConverterType;
9 typename ConverterType::Pointer converter = ConverterType::New();
10 mItkToVtkConverters.push_back(dynamic_cast< itk::ProcessObject *>(converter.GetPointer()));
11 converter->SetInput(input);
13 mVtkImages.push_back( converter->GetOutput() );
15 mVtkImageReslice.push_back(vtkSmartPointer<vtkImageReslice>::New());
16 mVtkImageReslice.back()->SetInterpolationModeToLinear();
17 mVtkImageReslice.back()->AutoCropOutputOn();
18 mVtkImageReslice.back()->SetBackgroundColor(-1000,-1000,-1000,1);
19 mVtkImageReslice.back()->SetResliceTransform(mTransform);
20 mVtkImageReslice.back()->SetInput(0, converter->GetOutput());
21 mVtkImageReslice.back()->UpdateInformation();
22 mTransformedVtkImages.push_back( mVtkImageReslice.back()->GetOutput(0) );
24 //--------------------------------------------------------------------