hotfix: enable wsi factory to create cucim#135
Conversation
tunakasif
left a comment
There was a problem hiding this comment.
Hello, thank you for your prompt update. It is a progress, but it did not solve the issue entirely. Now, CuImage is handled, but since mpp is not passed, it generates a RuntimeError.
I provided necessary changes as comments, I believe if you update them, it will be solved.
| "CuImage object does not expose a usable source path; " | ||
| "please pass a file path (str/Path) to wsi_factory." | ||
| ) | ||
| loaded = trident_load_wsi(str(path_like), reader_type=reader_type or "cucim") |
There was a problem hiding this comment.
This line is raising the following RuntimeError, it is probably caused by not passing the mpp to trident_load_wsi(...) and trident cannot extract it from metadata.
RuntimeError: Failed to initialize WSI using CuCIM: Unable to extract MPP from CuCIM metadata for: '/mnt/lts4-dislearn/scratch/data/hest-1k/hest_data/wsis/TENX95.tif'.
Suggestions:
- Provide `custom_keys` with metadata key mappings for 'mpp_x' and 'mpp_y'.
- Set the MPP manually when constructing the CuCIMWSI object.
I believe Line 94 should be updated as:
loaded = trident_load_wsi(str(path_like), reader_type=reader_type or "cucim", mpp=mpp)|
|
||
| try: | ||
| from cucim import CuImage as _CuImage # type: ignore | ||
| except Exception: |
There was a problem hiding this comment.
Similar to rest of the code, it may be better to switch this to:
except Exception: -> except ImportError:
tunakasif
left a comment
There was a problem hiding this comment.
This change fixes the problem. Thank you for your updates!
No description provided.