SCIInstitute / ShapeWorks

ShapeWorks
http://sciinstitute.github.io/ShapeWorks/
Other
104 stars 32 forks source link

Numpy array to vtk or Image #2035

Closed akaiml closed 1 year ago

akaiml commented 1 year ago

Hi , I am beginner in this field and I am using it for medical image segmentation. I have a numpy array which I wanted to convert as an image or vtk. what is the command to convert an array to vtk points or Image?

akenmorris commented 1 year ago

Hi, this jupyter notebook demonstrates converting a numpy array to/from a ShapeWorks Image:

https://github.com/SCIInstitute/ShapeWorks/blob/master/Examples/Python/notebooks/array-passing-without-copying.ipynb

I don't know about the VTK interface for such conversions. Perhaps check the VTK docs.

Also, there is a Discourse forum that might be more appropriate for questions rather than creating GitHub issues:

https://shapeworks.discourse.group/