[vtkusers] vtk PolyDATA and vtkUnstructuredGrid

jeanita jeanita.frank at gmail.com
Tue Oct 16 13:27:54 EDT 2012


Thanks Nelson but that's not my problem.
here is my code and the test image is attached to this mail. 

#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkImageToVTKImageFilter.h"
#include "vtkImageViewer.h"
#include "vtkRenderWindowInteractor.h"
int main( int argc, char **argv ) {
typedef itk::Image<float,3>     ImageType;
typedef itk::ImageFileReader<ImageType>  ReaderType;
typedef itk::ImageToVTKImageFilter< ImageType>   ConnectorType;
ReaderType::Pointer reader = ReaderType::New();
ConnectorType::Pointer connector = ConnectorType::New();
reader->SetFileName( argv[1] );
connector->SetInput( reader->GetOutput() );
vtkImageViewer * viewer = vtkImageViewer::New();
vtkRenderWindowInteractor * renderWindowInteractor = 
vtkRenderWindowInteractor::New();
viewer->SetupInteractor( renderWindowInteractor );
viewer->SetInput( connector->GetOutput() );
viewer->Render();
viewer->SetColorWindow( 255 );
viewer->SetColorLevel( 128 );
renderWindowInteractor->Start();
return 0;
}

I got the following error.

 Could not create IO object for file brain.vtk
  Tried to create one of the following:
    BioRadImageIO
    GDCMImageIO
    MetaImageIO
    PNGImageIO
    VTKImageIO
    GiplImageIO
    LSMImageIO
    AnalyzeImageIO
    NiftiImageIO
    StimulateImageIO
    JPEGImageIO
    TIFFImageIO
    NrrdImageIO
    BMPImageIO
    DICOMImageIO2
  You probably failed to set a file suffix, or
    set the suffix to an unsupported type.




--
View this message in context: http://vtk.1045678.n5.nabble.com/vtk-PolyDATA-and-vtkUnstructuredGrid-tp5716654p5716671.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list