[Insight-users] vtkStructuredGridReader (00000000025B4890): Cannot read dataset type: structured_points

yas --- yas2349 at gmail.com
Tue Feb 12 02:44:23 EST 2013


Hi ,When I run the following code, the following error occurs

The input file is attached to e-mail.
How to solve this error?thanks a lot!


#include <vtkSmartPointer.h>
#include <vtkPolyDataMapper.h>
#include <vtkStructuredGridReader.h>
#include <
vtkStructuredGridGeometryFilter.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>
#include <vtkImageData.h>
int main(int argc, char* argv[])
{
//  // Verify input arguments
//  /*if ( argc != 2 )
//    {
//    std::cout << "Usage: " << argv[0]
//              << " Filename(.vtk)" << std::endl;
//    return EXIT_FAILURE;
//    }*/

 std::string inputFilename = "C:\\VTK\\VTKData\\Data\\tooth.vtk";


  vtkSmartPointer<vtkStructuredGridReader> reader =
    vtkSmartPointer<vtkStructuredGridReader>::New();
  reader->SetFileName(inputFilename.c_str());
  reader->Update();
//
  vtkSmartPointer<vtkStructuredGridGeometryFilter> geometryFilter =
    vtkSmartPointer<vtkStructuredGridGeometryFilter>::New();
  geometryFilter->SetInputConnection(reader->GetOutputPort());
  geometryFilter->Update();

  // Visualize
  vtkSmartPointer<vtkPolyDataMapper> mapper =
    vtkSmartPointer<vtkPolyDataMapper>::New();
  mapper->SetInputConnection(geometryFilter->GetOutputPort());

  vtkSmartPointer<vtkActor> actor =
    vtkSmartPointer<vtkActor>::New();
  actor->SetMapper(mapper);

  vtkSmartPointer<vtkRenderer> renderer =
    vtkSmartPointer<vtkRenderer>::New();
  vtkSmartPointer<vtkRenderWindow> renderWindow =
    vtkSmartPointer<vtkRenderWindow>::New();
  renderWindow->AddRenderer(renderer);
  vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
    vtkSmartPointer<vtkRenderWindowInteractor>::New();
  renderWindowInteractor->SetRenderWindow(renderWindow);

  renderer->AddActor(actor);
  renderer->SetBackground(.3, .6, .3); // Background color green

  renderWindow->Render();
  renderWindowInteractor->Start();

  return EXIT_SUCCESS;
}


ERROR: In ..\..\VTK\IO\vtkStructuredGridReader.cxx, line 103
vtkStructuredGridReader (00000000025B4890): Cannot read dataset type:
structured_points

ERROR: In ..\..\VTK\IO\vtkStructuredGridReader.cxx, line 198
vtkStructuredGridReader (00000000025B4890): Cannot read dataset type:
structured_points
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130211/7456750c/attachment.htm>


More information about the Insight-users mailing list