[vtkusers] Please help me in viewing vtk

Frederic Danesi frederic.danesi at dinccs.com
Thu Jul 30 01:17:15 EDT 2009


You wrote an Image : vtkImageWriter::New()
writer.SetInput(dicomreader.GetOutput());
writer.SetFileName("/home/gururaj/eclipse
Project/SimpleVTK/SimpleVtk/CardiacCT/Gods.vtk");

And the you try to read a polydata from the exact same file ? 

The only thing stored in this file is an Image and it is pretty obvious in
the error message :

Input for connection index 0 on input port index 0 for algorithm
vtkPolyDataWriter(0x8c1a3860) is of type vtkImageData, but a vtkPolyData is
required.

To display an Image as a surface, you have to add some filtering operation
(conversion or surface generation).

The VTK books enclose a lot of explanation and example about case like this



 

HTH

Fred

 

 

Cordialement,

F.Danesi

-- 

Responsable Développement Informatique et Travail Collaboratif

Département DINCCS (Département Ingénierie Numérique, Conception
Collaborative et Simulation)

MICADO / DINCCS

Pôle de Haute Technologie, BP 90005

08005 Charleville-Mézières Cedex

Tel. : +33 (0) 3.24.41.69.55 / +33 (0) 6.62.76.13.32

Email : frederic.danesi at dinccs.com

Web : www.afmicado.com / www.dinccs.com

 

De : vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] De la part
de Gururajan
Envoyé : mercredi 29 juillet 2009 20:33
À : John Drescher
Cc : VTK Users
Objet : Re: [vtkusers] Please help me in viewing vtk

 

Please see the attached my java file. that is the programme i used to read
dicom series and write .vtk file. To display in 3d format. but am not able
to view in 3d format. 
am getting following error 



vtkPolyDataReader (0x8cdda7e8): Unrecognized file type: 
 
vtkStreamingDemandDrivenPipeline (0x8c1a2018): Input for connection index 0
on input port index 0 for algorithm vtkPolyDataWriter(0x8c1a3860) is of type
vtkImageData, but a vtkPolyData is required.

Please have a look at my attached file

Thanks
Guru


John Drescher wrote: 

On Wed, Jul 29, 2009 at 1:40 PM, Gururajan <mailto:gururajan.r at raster.in>
<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.
 
 
  

 

Analyse effectuée par AVG - www.avg.fr
Version: 8.5.375 / Base de données virale: 270.13.35/2269 - Date: 07/28/09
17:58:00

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090730/63420126/attachment.htm>


More information about the vtkusers mailing list