Maybe have a function return a pointer or copy memory to a given pointer.
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 ...