itkwasm.image_from_array
ΒΆ
Module ContentsΒΆ
FunctionsΒΆ
Convert a numpy array-like to an itkwasm Image. |
APIΒΆ
- itkwasm.image_from_array.image_from_array(arr, is_vector: bool = False, image_type: Optional[itkwasm.image.ImageType] = None) itkwasm.image.Image ΒΆ
Convert a numpy array-like to an itkwasm Image.
- Parameters:
arr (NumPy ndarray or array-like, e.g. dask.Array or cupy.ndarray) β Input n-d array
is_vector (bool) β Whether the array is a vector image. If True, then a 3D array will be treated as a 2D vector image, otherwise it will be treated as a 3D image.
image_type (ImageType) β Explicitly specify the Image type
- Returns:
Output Image
- Rtype :
Image where pixel data is a view of the input array and default metadata