[vtkusers] VTK data structure to C-array

Elvis Stansvik elvis.stansvik at orexplore.com
Sat Jun 23 13:43:39 EDT 2018


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/20180623/b5e93592/attachment.html>


More information about the vtkusers mailing list