Hi everybody,<br><br>I am really new of vtk, and I am trying to write a code that reads an ASCII .vtk file containing a grid defined by structured points and a scalar field. I want to obtain an image of the scalar field plotted on the structured grid. At the moment I wrote the following code
<br><br> vtkStructuredPointsReader * reader = vtkStructuredPointsReader::New();<br> reader->SetFileName("plotSolution.vtk");<br><br> vtkImageViewer * viewer = vtkImageViewer::New();<br> //viewer->SetInput(imageData);
<br> viewer->SetInputConnection(reader->GetOutputPort());<br> viewer->SetZSlice(0);<br> viewer->SetColorWindow(20.0);<br> viewer->SetColorLevel(0.0);<br> viewer->Render();<br><br> usleep(5000000);
<br> <br> reader->Delete();<br> viewer->Delete();<br><br>but the image displayed is simply black. The file I am using is correct (it is displayed correctly if I read it from Paraview). <br>Does anybody know how to do (or where to find an example) to read from a .vtk file to an ImageViewer?
<br><br>Thanks in advance for your help.<br><br>Daniele<br><br><br>