InsightSoftwareConsortium / itk_cucim

ITK Python filters accelerated with cuCIM
Apache License 2.0
3 stars 3 forks source link

support NumPy array input as well #19

Closed grlee77 closed 1 year ago

grlee77 commented 1 year ago

In addition to supporting itk.Image input, I think the functions in cuCIM should also accept NumPy arrays (and potentially other tensors types such as from Xarray or PyTorch).

To achieve this, I reused an existing decorator called accept_array_like_xarray_torch from itk.support.helpers. ITK devs: is this considered stable API for ITK's Python package or do we need to vendor a copy of this function in itk-cuCIM?

Test cases using NumPy array input were added for the existing functions.