Using LoadImaged on a 2D grayscale tiff file with WSIReader and backend=cucim returns an array with 3 "color" channels, which are all identical.
For example,
data_dict = {"image": "test.tif"}
x = np.random.randint(low=0,high=256,size=(128,128),dtype=np.uint8)
io.imsave(data_dict["image"],x)
print("cucim: shape = " + str(cucim.CuImage(data_dict["image"]).shape))
transform = LoadImaged(keys=["image"], reader=WSIReader, backend='cuCIM')
print("LoadImaged-cucim: shape = " + str(transform(data_dict)["image"].shape))
returns,
cucim: shape = [128, 128, 1]
LoadImaged-cucim: shape = (3, 128, 128)
When using backend=tifffile the files are misread entirely
print("tifffule: shape = " + str(tifffile.imread(data_dict["image"]).shape))
transform = LoadImaged(keys=["image"], reader=WSIReader, backend='tifffile')
print("LoadImaged-tifffile: shape = " + str(transform(data_dict)["image"].shape))
returns,
tifffule: shape = (128, 128)
LoadImaged-tifffile: shape = (3, 128)
Is this the expected behavior? Is there a better way to read 2D grayscale tiff files into monai? How about 3D grayscale tiffs?
Thanks,
David
Using
LoadImagedon a 2D grayscale tiff file withWSIReaderandbackend=cucimreturns an array with 3 "color" channels, which are all identical.For example,
returns,
When using
backend=tifffilethe files are misread entirelyreturns,
Is this the expected behavior? Is there a better way to read 2D grayscale tiff files into monai? How about 3D grayscale tiffs?
Thanks,
David