VTK data structure to C-array

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

VTK data structure to C-array

Romain LEGUAY

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.

 

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
Reply | Threaded
Open this post in threaded view
|

Re: VTK data structure to C-array

Elvis Stansvik
2018-06-23 19:28 GMT+02:00 Romain LEGUAY <[hidden email]>:

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


 

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



_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Resolved - VTK data structure to C-array

Romain LEGUAY

Thank you for your answer.

 

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

 

Romain

 

De : [hidden email]
Envoyé le :samedi 23 juin 2018 19:43
À : [hidden email]
Cc : [hidden email]
Objet :Re: [vtkusers] VTK data structure to C-array

 

2018-06-23 19:28 GMT+02:00 Romain LEGUAY <[hidden email]>:

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

 

 

 

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

 

 


_______________________________________________
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