c++itksimpleitk

How to get array from ITK image without using loop?


Maybe have a function return a pointer or copy memory to a given pointer.


Solution

  • SimpleITK::Image has a lot of methods that return the pointer as you need:

    https://simpleitk.org/doxygen/latest/html/classitk_1_1simple_1_1Image.html

    you might want: SimpleITK::Image::GetBufferAsVoid()

    or other ones ...