[vtkusers] Problem conversion vtkStructuredPoints to mesh/Polydata
agatte
agatakrason at gmail.com
Tue Mar 27 15:39:12 EDT 2012
But I have to write it in *.vtk file .
W dniu 27 marca 2012 21:36 użytkownik Agata Krasoń
<agatakrason at gmail.com>napisał:
> I received an error : ???
>
> Error 1 error C3867: 'vtkStructuredPointsReader::GetOutput': function
> call missing argument list; use '&vtkStructuredPointsReader::GetOutput' to
> create a pointer to member
> d:\SegmentacjaOtsu\VTKConverter\sources\ConverterVTK.cxx 109 ConverterVTK
>
>
> W dniu 27 marca 2012 21:34 użytkownik David Doria-2-3 [via VTK] <
> ml-node+s1045678n5598722h31 at n5.nabble.com> napisał:
>
>> On Tue, Mar 27, 2012 at 3:30 PM, agatte <[hidden email]<http://user/SendEmail.jtp?type=node&node=5598722&i=0>>
>> wrote:
>>
>> > Hi ;)
>> >
>> > I am just begining my adventure with vtk.
>> > I have a *.vtk file STRUCTURED_POINTS. I want to convert it to
>> POLYDATA and
>> > save as *.vtk file.
>> >
>> > Could anyone help me please ?
>> >
>> >
>> > I would appreciate for any help.
>> >
>> >
>> > I am trying with this code : but I received an error :
>> >
>> > int main()
>> > {
>> >
>> > try
>> > {
>> > vtkSmartPointer<vtkStructuredPointsReader> reader =
>> > vtkSmartPointer<vtkStructuredPointsReader>::New();
>> > reader->SetFileName("Points.vtk");
>> > reader->Update();
>> >
>> > vtkSmartPointer<vtkGeometryFilter> geometryFilter =
>> > vtkSmartPointer<vtkGeometryFilter>::New();
>> > geometryFilter->SetInput(reader->GetOutput);
>> > geometryFilter->Update();
>> >
>> >
>> > /*vtkContourFilter * contour = vtkContourFilter::New();
>> > contour->SetInput( reader->GetOutput() );
>> > contour->SetValue(0, 128); */
>> >
>> > // Save mesh as vtk Poly Data
>> > vtkPolyDataWriter * writerMesh = vtkPolyDataWriter::New();
>> > writerMesh->SetFileName("MeshVTK.vtk");
>> > writerMesh->SetInput(geometryFilter->GetOutput());
>> > writerMesh->Write();
>> >
>> > // contour->Delete();
>> > writerMesh->Delete();
>> >
>> > }
>> > catch (itk::ExceptionObject &ex)
>> > {
>> > std::cout << ex << std::endl;
>> > return EXIT_FAILURE;
>> > }
>> >
>> >
>> > }
>> >
>> >
>> >
>> >
>> >
>> > # vtk DataFile Version 2.0
>> > Comment goes here
>> > ASCII
>> >
>> > DATASET STRUCTURED_POINTS
>> > DIMENSIONS 3 201 1
>> >
>> > ORIGIN 0.000 0.000 0.000
>> > SPACING 1.000 1.000 1.000
>> >
>> > POINT_DATA 603
>> > SCALARS scalars double
>> > LOOKUP_TABLE default
>> >
>> > 108 186 26
>> > 1.081485e+002 1.858573e+002 26
>> > 1.083255e+002 1.855720e+002 26
>> > 1.085282e+002 1.851580e+002 26
>> > 1.087540e+002 1.846294e+002 26
>> > 109 184 26
>> > 1.092600e+002 1.832852e+002 26
>> > 1.095138e+002 1.825058e+002 26
>> > 1.097375e+002 1.816838e+002 26
>> > 1.099075e+002 1.808411e+002 26
>> > 110 180 26
>> > 1.100035e+002 1.791777e+002 26
>> > 1.099555e+002 1.783727e+002 26
>> > 1.099057e+002 1.775789e+002 26
>> > 1.099040e+002 1.767900e+002 26
>> > 110 176 26
>> > 1.102301e+002 1.752040e+002 26
>> > 1.105764e+002 1.744034e+002 26
>>
>> What is the error you receive? Also, you should use
>> vtkXMLPolyDataWriter to write a .vtp file instead of using
>> vtkPolyDataWriter to write a .vtk file.
>>
>> David
>> _______________________________________________
>> 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
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the
>> discussion below:
>>
>> http://vtk.1045678.n5.nabble.com/Problem-conversion-vtkStructuredPoints-to-mesh-Polydata-tp5598716p5598722.html
>> To unsubscribe from Problem conversion vtkStructuredPoints to
>> mesh/Polydata, click here<http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5598716&code=YWdhdGFrcmFzb25AZ21haWwuY29tfDU1OTg3MTZ8LTIxODgyMDQwNQ==>
>> .
>> NAML<http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
--
View this message in context: http://vtk.1045678.n5.nabble.com/Problem-conversion-vtkStructuredPoints-to-mesh-Polydata-tp5598716p5598738.html
Sent from the VTK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120327/4a2f7ce4/attachment.htm>
More information about the vtkusers
mailing list