-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inference step fails #1
Comments
Thank you for sharing the issue with us. Would you please follow these steps and send me a screenshot:
It will show how our plugin actually sees your image. I guess the error happens because there is not much separation between the segment you want to identify and the background. Let me know if it fixed the problem please. Thanks! |
For what its worth I had this same issue and it resolved after preprocessing my data to 0 to 255 intensity range as described by rasakereh. |
On Linux and facing the same issue. Renormalizing to [0, 255] did not resolve this issue, see for example: File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/starlette/routing.py", line 782, in app
await route.handle(scope, receive, send)
File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/starlette/routing.py", line 297, in handle
await self.app(scope, receive, send)
File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/starlette/routing.py", line 77, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/starlette/routing.py", line 72, in app
response = await func(request)
File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/fastapi/routing.py", line 299, in app
raise e
File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/fastapi/routing.py", line 294, in app
raw_response = await run_endpoint_function(
File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/starlette/concurrency.py", line 40, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 2134, in run_sync_in_worker_thread
return await future
File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 851, in run
result = context.run(func, *args)
File "/home/neel/Desktop/MedSAMSlicer-0.01/dependencies/server_essentials/server.py", line 316, in infer
res[csidx], bbox_1024_prev = inf(bbox_1024_prev)
File "/home/neel/Desktop/MedSAMSlicer-0.01/dependencies/server_essentials/server.py", line 313, in inf
return mask.tolist(), [get_bbox1024(mask_t)]
File "/home/neel/Desktop/MedSAMSlicer-0.01/dependencies/server_essentials/server.py", line 263, in get_bbox1024
x_min, x_max = np.min(x_indices), np.max(x_indices)
File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 2953, in min
return _wrapreduction(a, np.minimum, 'min', axis, None, out,
File "/home/neel/Desktop/Slicer-5.6.1-linux-amd64/lib/Python/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 88, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation minimum which has no identity |
A new release is ready. We tried to address this issue. Please remove pre-existing version and install the new one and let me know if it fixed your issue. |
Thanks for the new release. There's now a different error when using the same image. Traceback (most recent call last):
File "/home/neel/Desktop/MedSAMSlicer-0.02/MedSAM/MedSAMLite/MedSAMLite.py", line 237, in <lambda>
self.ui.pbSegment.connect('clicked(bool)', lambda: self.logic.applySegmentation())
File "/home/neel/Desktop/MedSAMSlicer-0.02/MedSAM/MedSAMLite/MedSAMLite.py", line 634, in applySegmentation
segmentation_mask = self.inferSegmentation(serverUrl)
File "/home/neel/Desktop/MedSAMSlicer-0.02/MedSAM/MedSAMLite/MedSAMLite.py", line 608, in inferSegmentation
seg_result[frame, :, :] = seg_data[str(frame)]
ValueError: could not broadcast input array from shape (150,146) into shape (146,150) Looking at the trace, I'm guessing a transpose is missing somewhere? Thanks for the help! |
@neel-dey if there is no privacy concern, can you please share the image file with me? my email: [email protected] |
@rasakereh Oh sure, it's public data available from here FYI, I just tried with a different (160, 160, 192) brain volume and was able to get an output whereas the image I linked to is (150, 146, 249) volume. Perhaps there's a divisibility by powers of two or resizing error happening somewhere? |
The interface does produce outputs now, thanks! I didn't create this issue so I can't close it, but this particular issue seems resolved from my side. |
I am running into a different issue now:
|
Close this issue, if you think it is fixed. |
I followed the installation and usage instructions, only to get the below errors in the log when clicking "Segmentation" button. This happens with both Slicer's sample data "CBCT-MR Head, and with my private data.
The text was updated successfully, but these errors were encountered: