[ITK] [ITK-users] Error converting ITK to VTK

viana vianamp at gmail.com
Fri May 22 15:43:27 EDT 2015


This is what my current code looks like:

#include <itkImage.h>
#include <vtkPNGReader.h>
#include <vtkImageData.h>
#include <vtkTIFFReader.h>
#include <vtkSmartPointer.h>
#include <itkVTKImageToImageFilter.h>
#include <itkFFTConvolutionImageFilter.h>
#include <itkSimpleFilterWatcher.h>
#include <itkConvolutionImageFilter.h>
#include <itkImageFileReader.h>
#include <itkImageFileWriter.h>
#include <itkImageToVTKImageFilter.h>

 
int main(int argc, char*argv[]) {

  const int dim = 3;
  
  typedef unsigned char PType;
  typedef itk::Image< PType, dim > IType;
  typedef itk::ImageToVTKImageFilter<IType> ITK2VTK;

  typedef itk::ImageFileReader< IType > ReaderType;
  ReaderType::Pointer reader = ReaderType::New();
  reader->SetFileName( argv[1] );

  ReaderType::Pointer reader2 = ReaderType::New();
  reader2->SetFileName( argv[2] );

  typedef itk::FFTConvolutionImageFilter< IType > FFTConvolutionType;
  FFTConvolutionType::Pointer conv = FFTConvolutionType::New();
  conv->SetInput( reader->GetOutput() );
  conv->SetKernelImage( reader2->GetOutput() );

  ITK2VTK::Pointer Filter = ITK2VTK::New();
  Filter -> SetInput(conv->GetOutput());
  Filter -> Update();

return 0;

}



--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Error-converting-ITK-to-VTK-tp7587392p7587394.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list