[vtkusers] Resolved - VTK data structure to C-array

Romain LEGUAY romain.leguay at gmail.com
Sun Jun 24 02:50:12 EDT 2018


Thank you for your answer.

I didn’t understand the term Scalar like the pixel value. 

Romain

De : Elvis Stansvik
Envoyé le :samedi 23 juin 2018 19:43
À : Romain LEGUAY
Cc : vtkusers at vtk.org
Objet :Re: [vtkusers] VTK data structure to C-array

2018-06-23 19:28 GMT+02:00 Romain LEGUAY <romain.leguay at gmail.com>:
Hi everyone,
 
I try to convert all points of a vtkImageData to a C-array. 
My purpose is to use this array Inside OpenCL for example.
 
My method actually is to read all points of the vtkImageData using  vtkImageData::ComputePointId and vtkImageData ::GetPoint but this method is too slow.
 
I don’t find any documentation on this.

You can get a direct pointer to the data using GetScalarPointer() [1].

HTH,
Elvis

[1] https://www.vtk.org/doc/nightly/html/classvtkImageData.html#a567566b094dcc3187061dc5ff02a6abb

 
Thanks,
 
Romain
 

_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180624/9a2320b7/attachment.html>


More information about the vtkusers mailing list