ITK icon indicating copy to clipboard operation
ITK copied to clipboard

Implement `__array__` and `__array_ufunc__` on itk.Image

Open thewtex opened this issue 4 years ago • 8 comments

Support direct use with NumPy while preserving metadata.

See pandas.Series, xarray (?), and work from @danielballan on Dask for reference.

thewtex avatar Jul 14 '19 20:07 thewtex

That work is this documentation in numpy, which as of this writing is still a PR: https://github.com/numpy/numpy/pull/13979/files

danielballan avatar Jul 14 '19 21:07 danielballan

__array__ added in #1158

thewtex avatar Aug 14 '19 13:08 thewtex

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

stale[bot] avatar Apr 03 '20 22:04 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

stale[bot] avatar Aug 05 '20 02:08 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

stale[bot] avatar Jun 11 '21 01:06 stale[bot]

References:

  • https://numpy.org/doc/stable/reference/ufuncs.html
  • https://numpy.org/doc/stable/reference/generated/numpy.ufunc.html#numpy.ufunc
  • https://numpy.org/neps/nep-0013-ufunc-overrides.html
  • https://numpy.org/doc/stable/reference/arrays.classes.html#numpy.class.array_ufunc
  • https://github.com/dask/dask/blob/7c419580037f552befc2650cb13967dd6bdef86a/dask/array/core.py#L1120-L1146
  • https://github.com/cupy/cupy/pull/1247/files

thewtex avatar Jun 15 '21 20:06 thewtex

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

stale[bot] avatar Apr 16 '22 11:04 stale[bot]

xref #4123

thewtex avatar Jul 28 '23 02:07 thewtex