[vtkusers] [Newbie] How to open a .vtk file?

Arturo Caissut arturo_caissut at tiscali.it
Tue Feb 10 04:21:07 EST 2009


Hi Irene,

I suppose you're talking about writing a vtk based program.
In order to read a PolyData file you should begin whit a 
vtkPolyDataReader object

If you're working with C++ (i.e.) you should write something like


#include <vtkPolyDataReader.h>

int main (){

vtkPolyDataReader *p_reader = vtkPolyDataReader::New();
p_reader->SetFileName("PATH_TO_YOUR_FILE/yourfile.vtk");
p_reader->Update();

/*SOMETHING ELSE*/

p_reader->Delete();

}

Now you can set your filter to redirect its output to a vtkPolyData 
object or to any other appropriated "step".
If you read class references here 
http://www.vtk.org/doc/nightly/html/classvtkPolyDataReader-members.html 
you'll easily figure out how to do many interesting things, but of 
course for any request I'll (better say "we'll", I'm sure) be glad to 
help you.


Have a good day,
Arturo






Irene Kostopoulou ha scritto:
> Hello all,
>
> I have a polygon data .vtk file, as a result of model making (marching 
> cubes) of 3d slicer joint apllied to a segmentation of blood vessels 
> of mra images. As I'm not familiar with the vtk program nor the vtk 
> file format, I need some suggestions.
> How can I open this vtk file and take the polygon points? I'm not 
> interested only in visualization of the vtk file, but I also need to 
> process the data in it, but unfortunately I don't even know how to 
> open it. I have the binary 5.2 version of vtk installed in my pc.
>
>
> Thanks and sorry for my newbie questions.
>
> I appreciate any help,
> Irene
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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
>   

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


More information about the vtkusers mailing list