imglyb does not support converting bool type images to numpy. This means that users are unable to convert masks/thresholded images into python numpy/xarray objects.
Here is a minimal example:
import imagej
import scyjava as sj
# initialize
ij = imagej.init()
# load blobs
img = ij.io().open('blobs.tif')
# threshold image w/ ops
CreateNamespace = sj.jimport('net.imagej.ops.create.CreateNamespace')
img_invert = ij.op().namespace(CreateNamespace).img(img)
ij.op().image().invert(img_invert, img)
threshold = ij.op().threshold().otsu(img_invert)
# get threshold from java
py_threshold = ij.py.from_java(threshold)
Returns the traceback:
File "/home/edward/Documents/repos/loci/imglyb/imglyb/util.py", line 149, in _to_imglib
raise NotImplementedError("Cannot convert dtype to ImgLib2 type yet: {}".format(source.dtype))
NotImplementedError: Cannot convert dtype to ImgLib2 type yet: bool
imglybdoes not support convertingbooltype images to numpy. This means that users are unable to convert masks/thresholded images into python numpy/xarray objects.Here is a minimal example:
Returns the traceback: