Comments (4)
Hi
I converted the converted the Path objects to strings and it worked.
Thanks!!
from pathml.
Can you please share the full error message?
Can you please also share the output of print(wsi_paths)
?
from pathml.
Hello
I am sharing full error message and exact path :
from pathlib import Path
from pathml.core import HESlide, SlideDataset
data_dir = Path("/home/Desktop/AI_pathology/test_AB/")
wsi_paths = list(data_dir.glob("*.svs"))
print(wsi_paths)
[PosixPath('/home/Desktop/AI_pathology/test_AB/test1.svs'), PosixPath('/home/Desktop/AI_pathology/test_AB/test2.svs')]
Error message :
wsi_list = [HESlide(p) for p in wsi_paths]
ArgumentError Traceback (most recent call last)
in
----> 1 wsi_list = [HESlide(p) for p in wsi_paths]
in (.0)
----> 1 wsi_list = [HESlide(p) for p in wsi_paths]
~/Desktop/AI_pathology/new_path/pathml/pathml/core/slide_data.py in init(self, *args, **kwargs)
501 def init(self, *args, **kwargs):
502 kwargs["slide_type"] = pathml.core.types.HE
--> 503 super().init(*args, **kwargs)
504
505
~/Desktop/AI_pathology/new_path/pathml/pathml/core/slide_data.py in init(self, filepath, name, masks, tiles, labels, backend, slide_type, stain, platform, tma, rgb, volumetric, time_series, counts, dtype)
161
162 if backend.lower() == "openslide":
--> 163 backend_obj = pathml.core.OpenSlideBackend(filepath)
164 elif backend.lower() == "bioformats":
165 backend_obj = pathml.core.BioFormatsBackend(filepath, dtype)
~/Desktop/AI_pathology/new_path/pathml/pathml/core/slide_backends.py in init(self, filename)
63 logger.info(f"OpenSlideBackend loading file at: {filename}")
64 self.filename = filename
---> 65 self.slide = openslide.open_slide(filename=filename)
66 self.level_count = self.slide.level_count
67
~/.local/lib/python3.8/site-packages/openslide/init.py in open_slide(filename)
386 object for other types of images."""
387 try:
--> 388 return OpenSlide(filename)
389 except OpenSlideUnsupportedFormatError:
390 return ImageSlide(filename)
~/.local/lib/python3.8/site-packages/openslide/init.py in init(self, filename)
158 AbstractSlide.init(self)
159 self._filename = filename
--> 160 self._osr = lowlevel.open(filename)
161
162 def repr(self):
ArgumentError: argument 1: <class 'TypeError'>: Incorrect type
Thanks in advance
from pathml.
Great, posting the entire error message is very useful!
Looks like the problem is being caused because the paths in wsi_paths
are Pathlib.Path objects, which openslide doesn't know how to open (openslide/openslide-python#112). They did update openslide to fix this in v1.2.0 (openslide/openslide-python#123, mentioned in release notes).
So, I think there are two ways you could fix this:
- convert the Path objects to strings first (
wsi_list = [HESlide(str(p)) for p in wsi_paths]
) - Update openslide to v1.2.0 or greater
We can also add a check in PathML to prevent this from happening in the future. Thanks!!
from pathml.
Related Issues (20)
- How to implement HoVer-Net Model in TIAToolBox?
- Support GPUs on Docker installation
- preprocessing on mrxs file get h5 file full of 0 HOT 6
- necrotic tissue detection for HE and multiplex imaging
- Need assistance with running Pathml package via Colab or Docker and resolving errors HOT 6
- Tests are failing HOT 2
- Error with spams package in vahadane stain normalisation with StainNormalizationHE() HOT 2
- Make a smaller docker image
- Reading WSI with .tif and ome.tiff format HOT 14
- Implement Tile Stitching Feature in Image Preprocessing
- Unable to read in all image layers in .vdi file, only index 0 is read in HOT 3
- Use updated openslide v4.0.0 HOT 1
- Add Installation and Setup Instructions for Mamba alongside Conda HOT 1
- http://pathml.org/ image broken HOT 1
- Algorithm for Improved Spectral Unmixing with Reference Image Integration
- add install instructions for windows HOT 1
- Compatibility Query: Using PathML for X-Ray Images with Missing 'TotalPixelMatrixRows' Attribute
- AttributeError pathml.core HOT 8
- pachage install bug
- Unable to Load IMC data (ome.tiff format) properly. Image data appears 0 only...
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pathml.