[vtkusers] Please help me in viewing vtk
John Drescher
drescherjm at gmail.com
Wed Jul 29 14:21:40 EDT 2009
On Wed, Jul 29, 2009 at 1:40 PM, Gururajan<gururajan.r at raster.in> wrote:
> The following i used for reading dicom series and creating .vtk files. But am not able to view that created .vtk file. Please any one can help me. the following error am getting *ERROR: In /home/juju/VTK5.0/VTK/IO/vtkDataReader.cxx, line 432 vtkPolyDataReader (0x8cdda7e8): Unrecognized file type: for file: /home/gururaj/eclipse Project/SimpleVTK/SimpleVtk/CardiacCT/Gods.vtk Thanks Guru vtkDICOMImageReader dicomreader = new vtkDICOMImageReader(); dicomreader.SetDirectoryName("/home/gururaj/MANIX/MANIX/CER-CT/ANGIO CT"); dicomreader.Update(); System.out.println("File Dimension " + dicomreader.GetFileDimensionality()); vtkImageWriter writer = new vtkImageWriter();//vtkImageWriter::New() writer.SetInput(dicomreader.GetOutput()); writer.SetFileName("/home/gururaj/eclipse Project/SimpleVTK/SimpleVtk/CardiacCT/Gods.vtk"); writer.SetFileDimensionality(3); writer.Update(); writer.Write(); //3d Construction String strfilename = new String(); strfilename = "/home/gururaj/eclipse Project/SimpleVTK/SimpleVtk/CardiacCT/Gods.vtk"; vtkPolyDataReader polyReader = new vtkPolyDataReader(); //vtkStructuredGridReader polyReader = new vtkStructuredGridReader(); polyReader.SetFileName(strfilename); polyReader.Update(); vtkPolyData polyData = new vtkPolyData(); polyData.DeepCopy(polyReader.GetOutput()); vtkPolyDataMapper polyMapper = new vtkPolyDataMapper(); polyMapper.SetInput(polyData); polyMapper.Update(); vtkActor actor = new vtkActor(); actor.SetMapper(polyMapper); actor.VisibilityOn(); vtkRenderer render = new vtkRenderer(); vtkRenderWindow renwindow = new vtkRenderWindow(); renwindow.AddRenderer(render); vtkRenderWindowInteractor renintec = new vtkRenderWindowInteractor(); renintec.SetRenderWindow(renwindow); render.AddActor(actor); render.SetBackground(0.2,0.3,0); renwindow.BordersOff(); renwindow.SetSize(500, 500); renwindow.Render(); render.ResetCamera(); renintec.Start(); _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers
Please fix your posts. They are totally unreadable in this format.
--
John M. Drescher
More information about the vtkusers
mailing list