Skip to content

XVIV. Numpy support (DecodeNumpy)

carlosuc3m edited this page Sep 13, 2023 · 1 revision

JDLL has the capability to ingest Numpy arrays stored as .npy files and convert them into ImgLib2 images. This functionality empowers JDLL to carry out inference within Numpy arrays seamlessly.

Supported datatypes

JDLL supports almost all the numeric Numpy data types:

  • boolean
  • int8
  • uint8
  • int16
  • uint16
  • int32
  • uint32
  • int64
  • float16
  • float32
  • float64

io.bioimage.modelrunner.numpy.DecodeNumpy

General description

Class enables conversion of Numpy arrays saved as .npy files into ImgLib2 images.

Static methods

DecodeNumpy.retrieveImgLib2FromNpy(String path)

Convert a Numpy array stored in the .npy file defined by the path argument into an ImgLib2 RandomAccessibleInterval.

  • path: path to the .npy file of interest.
String npyFile = "/path/to/example.npy";
RandomAccessibleInterval img =  DecodeNumpy.retrieveImgLib2FromNpy(npyFile);