I'm trying to understand how to read an image as an array using cucim. My image is a float64 .tiff with shape=(657, 668) from a CT-scan.
The closest function I could find was read_region (I couldn't find an imread-style function). I didn't understand all the documentation of the arguments read_region but I've followed examples that I found online.
import numpy as np
from cucim import CuImage
im_path = r'/mnt/c/Users/.../filename.tiff'
im_obj = CuImage(im_path)
count = im_obj.resolutions['level_count']
dimensions = im_obj.resolutions['level_dimensions']
region = im_obj.read_region(location=(0, 0), level=count-1, size=dimensions[count-1])
im_arr = np.asarray(region)
I got these errors and warnings:
[Warning] Loading image('/mnt/c/Users/.../filename.tiff') with a slow-path. The pixel format of the loaded image would be RGBA (4 channels) instead of RGB!`
region = m_obj.read_region(location=(0, 0), level=count-1, size=dimensions[count-1])
RuntimeError: This format (compression: 1, sample_per_pixel: 1, planar_config: 1, photometric: 1) is not supported yet!: Sorry, can not handle images with 64-bit samples
Not sure what a slow-path is, and I couldn't find anything about dtype support in the cucim docs. Am I doing something wrong or is it simply not possible to do what I'm trying to do? Should I use e.g. imageio instead to read the image and then apply cucim's other functions on that?
Specs:
Ubuntu 22.04.3 LTS on WSL2
Build cuda_12.2.r12.2/compiler.33191640_0
cucim 24.04.00 cuda12_py310_240410_ga24abfd_0 rapidsai (installed using conda)