Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there! I was wondering if anyone knows how to convert a nb::ndarray to a PyObject * so that it can be passed into the
PyObject_GetBuffer
function, for instance. I've tried calling.data()
and casting to a PyObject * but i'm getting lots of segfaults.In pybind11, you could simply call
array.ptr()
but that only seems possible in nanobind now for things likenb::tuple
that have anb::handle
?. I guess I would have to get the owner or somehow do the reverse ofnb::handle
...I think this might be related to #519 but unsure
To be more specific, I am trying to take in a numpy array and create an ITK image from it. Something like this:
Beta Was this translation helpful? Give feedback.
All reactions