You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to install cellsparse tu run it within QuPath. I'm running a Windows PC and I use QuPath 0.4.3 (I also tested QuPath 0.4.4, got the same problem) and qupath-extension-cellsparse-0.2.0. I was able to install the SAM extension running on my GPU without any problem. I tried to install both the GPU version and the CPU version (I thought it might come from the python version, 3.10 for installing GPU version for Windows, 3.11 for CPU) but got the same problem, i.e. when I run cellsparse extension to train either with Cellpose, ELEPHANT or Stardist, I get the following error:
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\uvicorn\protocols\http\httptools_impl.py", line 426, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\fastapi\applications.py", line 276, in call
await super().call(scope, receive, send)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\middleware\errors.py", line 184, in call
raise exc
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\middleware\errors.py", line 162, in call
await self.app(scope, receive, _send)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\middleware\exceptions.py", line 79, in call
raise exc
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\middleware\exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in call
raise e
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\routing.py", line 718, in call
await route.handle(scope, receive, send)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\routing.py", line 276, in handle
await self.app(scope, receive, send)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\routing.py", line 66, in app
response = await func(request)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\fastapi\routing.py", line 237, in app
raw_response = await run_endpoint_function(
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\fastapi\routing.py", line 163, in run_endpoint_function
return await dependant.call(**values)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\cellsparse_api\main.py", line 144, in stardist
return run(
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\cellsparse_api\main.py", line 42, in run
img = normalize(decode_image(b64img), 0, 100, axis=(0, 1))
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\cellsparse_api\main.py", line 30, in decode_image
return np.array(Image.open(io.BytesIO(base64.b64decode(b64data))))
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\PIL\Image.py", line 3305, in open
raise UnidentifiedImageError(msg)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x000001B2AF9BEE30>
It seems that it comes from PIL or base64 or io, I tried to change Pillow package version, but got the same error. Any idea?
Thanks a lot!!!
The text was updated successfully, but these errors were encountered:
Just to clarify, it looks similar to a previous issue where the problem was that it was applied to multi-channel image. I have this problem when using cellsparse on a 8 bits grayscale image.
Hi @tpecot, thank you for reporting the issue. I will investigate it.
How about the size of the image? It would be helpful if you could share the image metadata found in QuPath.
Thanks for your reply @ksugar ! Actually, I tried several images and always got the same problem, here is one example of metadata:
After your message, I used an image from the Broad Bioimage Benchmark Collection with these metadata:
... and it works. I must say I don't understand why it doesn't work for the other images but it's reassuring, I'll make some new tests but I should be able to find out what's going on. Sorry to have bothered you because of that and thanks again!!!
Hi,
I've been trying to install cellsparse tu run it within QuPath. I'm running a Windows PC and I use QuPath 0.4.3 (I also tested QuPath 0.4.4, got the same problem) and qupath-extension-cellsparse-0.2.0. I was able to install the SAM extension running on my GPU without any problem. I tried to install both the GPU version and the CPU version (I thought it might come from the python version, 3.10 for installing GPU version for Windows, 3.11 for CPU) but got the same problem, i.e. when I run cellsparse extension to train either with Cellpose, ELEPHANT or Stardist, I get the following error:
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\uvicorn\protocols\http\httptools_impl.py", line 426, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\fastapi\applications.py", line 276, in call
await super().call(scope, receive, send)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\middleware\errors.py", line 184, in call
raise exc
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\middleware\errors.py", line 162, in call
await self.app(scope, receive, _send)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\middleware\exceptions.py", line 79, in call
raise exc
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\middleware\exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in call
raise e
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\routing.py", line 718, in call
await route.handle(scope, receive, send)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\routing.py", line 276, in handle
await self.app(scope, receive, send)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\starlette\routing.py", line 66, in app
response = await func(request)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\fastapi\routing.py", line 237, in app
raw_response = await run_endpoint_function(
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\fastapi\routing.py", line 163, in run_endpoint_function
return await dependant.call(**values)
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\cellsparse_api\main.py", line 144, in stardist
return run(
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\cellsparse_api\main.py", line 42, in run
img = normalize(decode_image(b64img), 0, 100, axis=(0, 1))
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\cellsparse_api\main.py", line 30, in decode_image
return np.array(Image.open(io.BytesIO(base64.b64decode(b64data))))
File "C:\Users\tpecot\Anaconda3\envs\cellsparse-api\lib\site-packages\PIL\Image.py", line 3305, in open
raise UnidentifiedImageError(msg)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x000001B2AF9BEE30>
It seems that it comes from PIL or base64 or io, I tried to change Pillow package version, but got the same error. Any idea?
Thanks a lot!!!
The text was updated successfully, but these errors were encountered: