Skip to content
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

MONAI Label fails to Run Segmentation #1711

Open
vikashg opened this issue Jun 17, 2024 · 2 comments
Open

MONAI Label fails to Run Segmentation #1711

vikashg opened this issue Jun 17, 2024 · 2 comments

Comments

@vikashg
Copy link

vikashg commented Jun 17, 2024

Describe the bug
When I loaded a CT segmentation and run Auto Segmentation with the model segmentation_spleen , I get a notification on the lower right corner saying "Failed to run segmentation"

Server logs

App Init...
[2024-06-17 14:07:49,273] [1390926] [MainThread] [INFO] (monailabel.interfaces.utils.app:37) - Initializing App from: /data/Vikash/monailabel/apps/radiology; studies: http://127.0.0.1:8042/dicom-web; conf: {'models': 'segmentation_spleen'}
[2024-06-17 14:07:49,817] [1390926] [MainThread] [INFO] (monailabel.utils.others.class_utils:57) - Subclass for MONAILabelApp Found: <class 'main.MyApp'>
[2024-06-17 14:07:49,820] [1390926] [MainThread] [INFO] (monailabel.utils.others.class_utils:57) - Subclass for TaskConfig Found: <class 'lib.configs.deepedit.DeepEdit'>
[2024-06-17 14:07:49,821] [1390926] [MainThread] [INFO] (monailabel.utils.others.class_utils:57) - Subclass for TaskConfig Found: <class 'lib.configs.localization_vertebra.LocalizationVertebra'>
[2024-06-17 14:07:49,821] [1390926] [MainThread] [INFO] (monailabel.utils.others.class_utils:57) - Subclass for TaskConfig Found: <class 'lib.configs.deepgrow_2d.Deepgrow2D'>
[2024-06-17 14:07:49,821] [1390926] [MainThread] [INFO] (monailabel.utils.others.class_utils:57) - Subclass for TaskConfig Found: <class 'lib.configs.segmentation_spleen.SegmentationSpleen'>
[2024-06-17 14:07:49,821] [1390926] [MainThread] [INFO] (monailabel.utils.others.class_utils:57) - Subclass for TaskConfig Found: <class 'lib.configs.localization_spine.LocalizationSpine'>
[2024-06-17 14:07:49,821] [1390926] [MainThread] [INFO] (monailabel.utils.others.class_utils:57) - Subclass for TaskConfig Found: <class 'lib.configs.deepgrow_3d.Deepgrow3D'>
[2024-06-17 14:07:49,822] [1390926] [MainThread] [INFO] (monailabel.utils.others.class_utils:57) - Subclass for TaskConfig Found: <class 'lib.configs.segmentation.Segmentation'>
[2024-06-17 14:07:49,822] [1390926] [MainThread] [INFO] (monailabel.utils.others.class_utils:57) - Subclass for TaskConfig Found: <class 'lib.configs.segmentation_vertebra.SegmentationVertebra'>
[2024-06-17 14:07:49,822] [1390926] [MainThread] [INFO] (main:95) - +++ Adding Model: segmentation_spleen => lib.configs.segmentation_spleen.SegmentationSpleen
[2024-06-17 14:07:49,868] [1390926] [MainThread] [INFO] (lib.configs.segmentation_spleen:79) - EPISTEMIC Enabled: False; Samples: 5
[2024-06-17 14:07:49,868] [1390926] [MainThread] [INFO] (main:98) - +++ Using Models: ['segmentation_spleen']
[2024-06-17 14:07:49,868] [1390926] [MainThread] [INFO] (monailabel.interfaces.app:135) - Init Datastore for: http://127.0.0.1:8042/dicom-web
[2024-06-17 14:07:49,868] [1390926] [MainThread] [INFO] (monailabel.interfaces.app:156) - Using DICOM WEB: http://127.0.0.1:8042/dicom-web
[2024-06-17 14:07:49,869] [1390926] [MainThread] [INFO] (monailabel.datastore.dicom:62) - DICOMWeb Datastore (cache) Path: /home/gupta/.cache/monailabel/dicom/488fca1f7f3f98331f6f7756beca0d35; FetchByFrame: False
[2024-06-17 14:07:49,869] [1390926] [MainThread] [INFO] (monailabel.datastore.dicom:63) - DICOMWeb Convert To Nifti: True
[2024-06-17 14:07:49,869] [1390926] [MainThread] [INFO] (monailabel.datastore.local:130) - Auto Reload: True; Extensions: ('*.nii.gz', '*.nii')
[2024-06-17 14:07:49,870] [1390926] [MainThread] [INFO] (monailabel.datastore.local:577) - Invalidate count: 0
[2024-06-17 14:07:49,870] [1390926] [MainThread] [INFO] (monailabel.datastore.local:151) - Start observing external modifications on datastore (AUTO RELOAD)
[2024-06-17 14:07:49,872] [1390926] [MainThread] [INFO] (main:128) - +++ Adding Inferer:: segmentation_spleen => <lib.infers.segmentation_spleen.SegmentationSpleen object at 0x7f8f2c223f10>
[2024-06-17 14:07:49,872] [1390926] [MainThread] [INFO] (main:194) - {'segmentation_spleen': <lib.infers.segmentation_spleen.SegmentationSpleen object at 0x7f8f2c223f10>, 'Histogram+GraphCut': <monailabel.scribbles.infer.HistogramBasedGraphCut object at 0x7f8f2c1ef2e0>, 'GMM+GraphCut': <monailabel.scribbles.infer.GMMBasedGraphCut object at 0x7f8f2c1ef520>}
[2024-06-17 14:07:49,872] [1390926] [MainThread] [INFO] (main:209) - +++ Adding Trainer:: segmentation_spleen => <lib.trainers.segmentation_spleen.SegmentationSpleen object at 0x7f8f2c1ef430>
[2024-06-17 14:07:49,872] [1390926] [MainThread] [INFO] (monailabel.utils.sessions:51) - Session Path: /home/gupta/.cache/monailabel/sessions
[2024-06-17 14:07:49,872] [1390926] [MainThread] [INFO] (monailabel.utils.sessions:52) - Session Expiry (max): 3600
[2024-06-17 14:07:49,872] [1390926] [MainThread] [INFO] (monailabel.interfaces.app:469) - App Init - completed
[2024-06-17 14:07:49,872] [timeloop] [INFO] Starting Timeloop..
[2024-06-17 14:07:49,872] [1390926] [MainThread] [INFO] (timeloop:60) - Starting Timeloop..
[2024-06-17 14:07:49,872] [timeloop] [INFO] Registered job <function MONAILabelApp.on_init_complete.<locals>.run_scheduler at 0x7f8f2c1f6040>
[2024-06-17 14:07:49,872] [1390926] [MainThread] [INFO] (timeloop:42) - Registered job <function MONAILabelApp.on_init_complete.<locals>.run_scheduler at 0x7f8f2c1f6040>
[2024-06-17 14:07:49,873] [timeloop] [INFO] Timeloop now started. Jobs will run based on the interval set
[2024-06-17 14:07:49,873] [1390926] [MainThread] [INFO] (timeloop:63) - Timeloop now started. Jobs will run based on the interval set
[2024-06-17 14:07:49,873] [1390926] [MainThread] [INFO] (uvicorn.error:62) - Application startup complete.
[2024-06-17 14:07:49,873] [1390926] [MainThread] [INFO] (uvicorn.error:214) - Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
[2024-06-17 14:12:52,521] [1390926] [MainThread] [INFO] (dicomweb_client.web:2128) - search for series
[2024-06-17 14:12:52,539] [1390926] [MainThread] [INFO] (dicomweb_client.web:2128) - search for series
[2024-06-17 14:13:01,781] [1390926] [MainThread] [INFO] (monailabel.endpoints.infer:171) - Infer Request: {'model': 'segmentation_spleen', 'image': '1.2.840.113704.1.111.7672.1256052685.11', 'device': ['NVIDIA RTX A6000:0', 'NVIDIA RTX A6000:1', 'NVIDIA RTX A6000:2'], 'result_extension': '.nrrd', 'result_dtype': 'uint16', 'result_compress': False, 'restore_label_idx': False}
[2024-06-17 14:13:01,781] [1390926] [MainThread] [INFO] (monailabel.datastore.dicom:78) - Image ID: 1.2.840.113704.1.111.7672.1256052685.11
[2024-06-17 14:13:01,781] [1390926] [MainThread] [INFO] (monailabel.datastore.dicom:80) - Image Dir (cache): /home/gupta/.cache/monailabel/dicom/488fca1f7f3f98331f6f7756beca0d35/1.2.840.113704.1.111.7672.1256052685.11
[2024-06-17 14:13:01,781] [1390926] [MainThread] [INFO] (dicomweb_client.web:2128) - search for series
[2024-06-17 14:13:01,795] [1390926] [MainThread] [INFO] (dicomweb_client.web:2175) - retrieve series "1.2.840.113704.1.111.7672.1256052685.11" of study "1.2.840.113711.7041813.4.5000.277653174.26.2116281012.115090"
[2024-06-17 14:13:01,850] [1390926] [MainThread] [ERROR] (uvicorn.error:412) - Exception in ASGI application
Traceback (most recent call last):
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__
    return await self.app(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/cors.py", line 93, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/cors.py", line 148, in simple_response
    await self.app(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/routing.py", line 756, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/routing.py", line 72, in app
    response = await func(request)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    return await dependant.call(**values)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/endpoints/infer.py", line 206, in api_run_inference
    return run_inference(background_tasks, model, image, session_id, params, file, label, output)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/endpoints/infer.py", line 172, in run_inference
    result = instance.infer(request)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/interfaces/app.py", line 289, in infer
    request["image"] = datastore.get_image_uri(request["image"])
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/datastore/dicom.py", line 83, in get_image_uri
    dicom_web_download_series(None, image_id, image_dir, self._client, self._fetch_by_frame)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/datastore/utils/dicom.py", line 80, in dicom_web_download_series
    instances = client.retrieve_series(study_id, series_id)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/dicomweb_client/web.py", line 2248, in retrieve_series
    self._get_series(
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/dicomweb_client/web.py", line 2191, in _get_series
    return self._http_get_multipart_application_dicom(
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/dicomweb_client/web.py", line 997, in _http_get_multipart_application_dicom
    response = self._http_get(
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/dicomweb_client/web.py", line 536, in _http_get
    response.raise_for_status()
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://127.0.0.1:8042/dicom-web/studies/1.2.840.113711.7041813.4.5000.277653174.26.2116281012.115090/series/1.2.840.113704.1.111.7672.1256052685.11
[2024-06-17 14:26:06,303] [1390926] [MainThread] [INFO] (monailabel.endpoints.infer:171) - Infer Request: {'model': 'segmentation_spleen', 'image': '1.2.840.113704.1.111.7672.1256052685.11', 'device': ['NVIDIA RTX A6000:0', 'NVIDIA RTX A6000:1', 'NVIDIA RTX A6000:2'], 'result_extension': '.nrrd', 'result_dtype': 'uint16', 'result_compress': False, 'restore_label_idx': False}
[2024-06-17 14:26:06,303] [1390926] [MainThread] [INFO] (monailabel.datastore.dicom:78) - Image ID: 1.2.840.113704.1.111.7672.1256052685.11
[2024-06-17 14:26:06,303] [1390926] [MainThread] [INFO] (monailabel.datastore.dicom:80) - Image Dir (cache): /home/gupta/.cache/monailabel/dicom/488fca1f7f3f98331f6f7756beca0d35/1.2.840.113704.1.111.7672.1256052685.11
[2024-06-17 14:26:06,303] [1390926] [MainThread] [INFO] (dicomweb_client.web:2128) - search for series
[2024-06-17 14:26:06,319] [1390926] [MainThread] [INFO] (dicomweb_client.web:2175) - retrieve series "1.2.840.113704.1.111.7672.1256052685.11" of study "1.2.840.113711.7041813.4.5000.277653174.26.2116281012.115090"
[2024-06-17 14:26:06,374] [1390926] [MainThread] [ERROR] (uvicorn.error:412) - Exception in ASGI application
Traceback (most recent call last):
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__
    return await self.app(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/cors.py", line 93, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/cors.py", line 148, in simple_response
    await self.app(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/routing.py", line 756, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/routing.py", line 72, in app
    response = await func(request)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    return await dependant.call(**values)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/endpoints/infer.py", line 206, in api_run_inference
    return run_inference(background_tasks, model, image, session_id, params, file, label, output)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/endpoints/infer.py", line 172, in run_inference
    result = instance.infer(request)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/interfaces/app.py", line 289, in infer
    request["image"] = datastore.get_image_uri(request["image"])
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/datastore/dicom.py", line 83, in get_image_uri
    dicom_web_download_series(None, image_id, image_dir, self._client, self._fetch_by_frame)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/datastore/utils/dicom.py", line 80, in dicom_web_download_series
    instances = client.retrieve_series(study_id, series_id)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/dicomweb_client/web.py", line 2248, in retrieve_series
    self._get_series(
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/dicomweb_client/web.py", line 2191, in _get_series
    return self._http_get_multipart_application_dicom(
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/dicomweb_client/web.py", line 997, in _http_get_multipart_application_dicom
    response = self._http_get(
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/dicomweb_client/web.py", line 536, in _http_get
    response.raise_for_status()
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://127.0.0.1:8042/dicom-web/studies/1.2.840.113711.7041813.4.5000.277653174.26.2116281012.115090/series/1.2.840.113704.1.111.7672.1256052685.11
[2024-06-17 14:33:07,029] [1390926] [MainThread] [INFO] (monailabel.endpoints.infer:171) - Infer Request: {'model': 'segmentation_spleen', 'image': '1.2.840.113704.1.111.7672.1256052685.11', 'device': ['NVIDIA RTX A6000:0', 'NVIDIA RTX A6000:1', 'NVIDIA RTX A6000:2'], 'result_extension': '.nrrd', 'result_dtype': 'uint16', 'result_compress': False, 'restore_label_idx': False}
[2024-06-17 14:33:07,029] [1390926] [MainThread] [INFO] (monailabel.datastore.dicom:78) - Image ID: 1.2.840.113704.1.111.7672.1256052685.11
[2024-06-17 14:33:07,029] [1390926] [MainThread] [INFO] (monailabel.datastore.dicom:80) - Image Dir (cache): /home/gupta/.cache/monailabel/dicom/488fca1f7f3f98331f6f7756beca0d35/1.2.840.113704.1.111.7672.1256052685.11
[2024-06-17 14:33:07,029] [1390926] [MainThread] [INFO] (dicomweb_client.web:2128) - search for series
[2024-06-17 14:33:07,046] [1390926] [MainThread] [INFO] (dicomweb_client.web:2175) - retrieve series "1.2.840.113704.1.111.7672.1256052685.11" of study "1.2.840.113711.7041813.4.5000.277653174.26.2116281012.115090"
[2024-06-17 14:33:07,094] [1390926] [MainThread] [ERROR] (uvicorn.error:412) - Exception in ASGI application
Traceback (most recent call last):
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__
    return await self.app(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/cors.py", line 93, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/cors.py", line 148, in simple_response
    await self.app(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/routing.py", line 756, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/data/miniconda3/envs/monailabel/lib/py1thon3.8/site-packages/starlette/routing.py", line 72, in app
    response = await func(request)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    return await dependant.call(**values)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/endpoints/infer.py", line 206, in api_run_inference
    return run_inference(background_tasks, model, image, session_id, params, file, label, output)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/endpoints/infer.py", line 172, in run_inference
    result = instance.infer(request)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/interfaces/app.py", line 289, in infer
    request["image"] = datastore.get_image_uri(request["image"])
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/datastore/dicom.py", line 83, in get_image_uri
    dicom_web_download_series(None, image_id, image_dir, self._client, self._fetch_by_frame)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/monailabel/datastore/utils/dicom.py", line 80, in dicom_web_download_series
    instances = client.retrieve_series(study_id, series_id)
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/dicomweb_client/web.py", line 2248, in retrieve_series
    self._get_series(
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/dicomweb_client/web.py", line 2191, in _get_series
    return self._http_get_multipart_application_dicom(
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/dicomweb_client/web.py", line 997, in _http_get_multipart_application_dicom
    response = self._http_get(
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/dicomweb_client/web.py", line 536, in _http_get
    response.raise_for_status()
  File "/data/miniconda3/envs/monailabel/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://127.0.0.1:8042/dicom-web/studies/1.2.840.113711.7041813.4.5000.277653174.26.2116281012.115090/series/1.2.840.113704.1.111.7672.1256052685.11

To Reproduce

  1. Install monailabel using pip install monailabel
  2. Upload a CT scan dicom image on orthanc
  3. Open the image using monai-label on localhost:8000/ohif
  4. Run Segmentation_spleen

Expected behavior
Should produce spleen segmentation

Screenshots

{
   "Details" : "This WADO-RS plugin cannot generate the following content type: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
   "HttpError" : "Bad Request",
   "HttpStatus" : 400,
   "Message" : "Bad request",
   "Method" : "GET",
   "OrthancError" : "Bad request",
   "OrthancStatus" : 8,
   "Uri" : "/dicom-web/studies/1.2.840.113711.7041813.4.5000.277653174.26.2116281012.115090/series/1.2.840.113704.1.111.7672.1256052685.11"
}
Annotation 2024-06-17 144906

Environment
pip list produces

Package                            Version
---------------------------------- -----------
absl-py                            2.1.0
alembic                            1.13.1
aniso8601                          9.0.1
annotated-types                    0.7.0
anyio                              4.3.0
attrs                              23.2.0
bcrypt                             4.1.2
beautifulsoup4                     4.12.3
blinker                            1.8.2
cachetools                         5.3.3
certifi                            2024.2.2
cffi                               1.16.0
charset-normalizer                 3.3.2
click                              8.1.7
cloudpickle                        3.0.0
contourpy                          1.1.1
cryptography                       42.0.7
cycler                             0.12.1
Deprecated                         1.2.14
dicomweb-client                    0.59.1
diskcache                          5.6.3
docker                             7.0.0
ecdsa                              0.19.0
einops                             0.7.0
entrypoints                        0.4
exceptiongroup                     1.2.1
expiring-dict                      1.1.0
expiringdict                       1.2.2
fastapi                            0.110.2
filelock                           3.11.0
fire                               0.6.0
Flask                              3.0.3
fonttools                          4.51.0
fsspec                             2024.3.1
gdown                              5.1.0
girder-client                      3.2.3
gitdb                              4.0.11
GitPython                          3.1.43
google-auth                        2.29.0
google-auth-oauthlib               1.0.0
google-oauth                       1.0.1
graphene                           3.3
graphql-core                       3.2.3
graphql-relay                      3.2.0
greenlet                           3.0.3
grpcio                             1.63.0
gunicorn                           21.2.0
h11                                0.14.0
httpcore                           1.0.5
httpx                              0.27.0
idna                               3.7
imageio                            2.34.1
importlib_metadata                 7.1.0
importlib_resources                6.4.0
itk                                5.3.0
itk-core                           5.3.0
itk-filtering                      5.3.0
itk-io                             5.3.0
itk-numerics                       5.3.0
itk-registration                   5.3.0
itk-segmentation                   5.3.0
itsdangerous                       2.2.0
Jinja2                             3.1.4
joblib                             1.4.2
jsonschema                         3.2.0
kiwisolver                         1.4.5
lazy_loader                        0.4
lmdb                               1.4.1
Mako                               1.3.3
Markdown                           3.6
MarkupSafe                         2.1.5
matplotlib                         3.7.5
mlflow                             2.13.2
monai                              1.3.1
monailabel                         0.8.3
mpmath                             1.3.0
networkx                           3.1
nibabel                            5.2.1
ninja                              1.11.1.1
nptyping                           2.5.0
numpy                              1.24.4
numpymaxflow                       0.0.6
nvidia-cublas-cu12                 12.1.3.1
nvidia-cuda-cupti-cu12             12.1.105
nvidia-cuda-nvrtc-cu12             12.1.105
nvidia-cuda-runtime-cu12           12.1.105
nvidia-cudnn-cu12                  8.9.2.26
nvidia-cufft-cu12                  11.0.2.54
nvidia-curand-cu12                 10.3.2.106
nvidia-cusolver-cu12               11.4.5.107
nvidia-cusparse-cu12               12.1.0.106
nvidia-nccl-cu12                   2.20.5
nvidia-nvjitlink-cu12              12.4.127
nvidia-nvtx-cu12                   12.1.105
oauthlib                           3.2.2
opencv-python-headless             4.7.0.72
openslide-python                   1.1.2
opentelemetry-api                  1.25.0
opentelemetry-sdk                  1.25.0
opentelemetry-semantic-conventions 0.46b0
packaging                          24.0
pandas                             2.0.3
passlib                            1.7.4
pillow                             10.3.0
pip                                23.3.1
protobuf                           4.25.3
psutil                             5.9.8
pyarrow                            15.0.2
pyasn1                             0.6.0
pyasn1_modules                     0.4.0
pycparser                          2.22
pydantic                           2.7.0
pydantic_core                      2.18.1
pydantic-settings                  2.2.1
pydicom                            2.4.4
pydicom-seg                        0.4.1
PyJWT                              2.8.0
pynetdicom                         2.0.2
pynrrd                             1.0.0
pyOpenSSL                          24.1.0
pyparsing                          3.1.2
pyplastimatch                      0.4.5
pyrsistent                         0.20.0
PySocks                            1.7.1
python-dateutil                    2.9.0.post0
python-dotenv                      1.0.1
python-jose                        3.3.0
python-multipart                   0.0.9
pytorch-ignite                     0.4.11
pytz                               2024.1
PyWavelets                         1.4.1
PyYAML                             6.0.1
querystring-parser                 1.2.4
requests                           2.31.0
requests-oauthlib                  2.0.0
requests-toolbelt                  1.0.0
retrying                           1.3.4
rfc3986                            1.5.0
rsa                                4.9
schedule                           1.2.1
scikit-image                       0.21.0
scikit-learn                       1.3.2
scipy                              1.10.1
setuptools                         68.2.2
shapely                            2.0.4
SimpleITK                          2.3.1
six                                1.16.0
smmap                              5.0.1
sniffio                            1.3.1
sortedcontainers                   2.4.0
soupsieve                          2.5
SQLAlchemy                         2.0.30
sqlparse                           0.5.0
starlette                          0.37.2
sympy                              1.12
tensorboard                        2.14.0
tensorboard-data-server            0.7.2
termcolor                          2.4.0
threadpoolctl                      3.5.0
tifffile                           2023.7.10
timeloop                           1.0.2
torch                              2.3.0
torchvision                        0.18.0
tqdm                               4.66.4
triton                             2.3.0
typing_extensions                  4.11.0
tzdata                             2024.1
urllib3                            2.2.1
uvicorn                            0.29.0
watchdog                           4.0.0
Werkzeug                           3.0.3
wheel                              0.43.0
wrapt                              1.16.0
zipp                               3.18.1

Additional context
I am running this on Ubuntu 20.04
Command used
monailabel start_server --app apps/radiology --studies http://127.0.0.1:8042/dicom-web --conf models segmentation_spleen

I have downloaded the radiology app the contents are as follows

radiology/
├── bin
│   └── itkimage2segimage
├── __init__.py
├── lib
│   ├── activelearning
│   │   ├── __init__.py
│   │   ├── last.py
│   │   └── __pycache__
│   │       ├── __init__.cpython-38.pyc
│   │       └── last.cpython-38.pyc
│   ├── configs
│   │   ├── deepedit.py
│   │   ├── deepgrow_2d.py
│   │   ├── deepgrow_3d.py
│   │   ├── __init__.py
│   │   ├── localization_spine.py
│   │   ├── localization_vertebra.py
│   │   ├── __pycache__
│   │   │   ├── deepedit.cpython-38.pyc
│   │   │   ├── deepgrow_2d.cpython-38.pyc
│   │   │   ├── deepgrow_3d.cpython-38.pyc
│   │   │   ├── __init__.cpython-38.pyc
│   │   │   ├── localization_spine.cpython-38.pyc
│   │   │   ├── localization_vertebra.cpython-38.pyc
│   │   │   ├── segmentation.cpython-38.pyc
│   │   │   ├── segmentation_spleen.cpython-38.pyc
│   │   │   └── segmentation_vertebra.cpython-38.pyc
│   │   ├── segmentation.py
│   │   ├── segmentation_spleen.py
│   │   └── segmentation_vertebra.py
│   ├── infers
│   │   ├── deepedit.py
│   │   ├── deepgrow_pipeline.py
│   │   ├── deepgrow.py
│   │   ├── __init__.py
│   │   ├── localization_spine.py
│   │   ├── localization_vertebra.py
│   │   ├── __pycache__
│   │   │   ├── deepedit.cpython-38.pyc
│   │   │   ├── deepgrow.cpython-38.pyc
│   │   │   ├── deepgrow_pipeline.cpython-38.pyc
│   │   │   ├── __init__.cpython-38.pyc
│   │   │   ├── localization_spine.cpython-38.pyc
│   │   │   ├── localization_vertebra.cpython-38.pyc
│   │   │   ├── segmentation.cpython-38.pyc
│   │   │   ├── segmentation_spleen.cpython-38.pyc
│   │   │   ├── segmentation_vertebra.cpython-38.pyc
│   │   │   └── vertebra_pipeline.cpython-38.pyc
│   │   ├── segmentation.py
│   │   ├── segmentation_spleen.py
│   │   ├── segmentation_vertebra.py
│   │   └── vertebra_pipeline.py
│   ├── __init__.py
│   ├── __pycache__
│   │   └── __init__.cpython-38.pyc
│   ├── trainers
│   │   ├── deepedit.py
│   │   ├── deepgrow.py
│   │   ├── __init__.py
│   │   ├── localization_spine.py
│   │   ├── localization_vertebra.py
│   │   ├── __pycache__
│   │   │   ├── deepedit.cpython-38.pyc
│   │   │   ├── deepgrow.cpython-38.pyc
│   │   │   ├── __init__.cpython-38.pyc
│   │   │   ├── localization_spine.cpython-38.pyc
│   │   │   ├── localization_vertebra.cpython-38.pyc
│   │   │   ├── segmentation.cpython-38.pyc
│   │   │   ├── segmentation_spleen.cpython-38.pyc
│   │   │   └── segmentation_vertebra.cpython-38.pyc
│   │   ├── segmentation.py
│   │   ├── segmentation_spleen.py
│   │   └── segmentation_vertebra.py
│   └── transforms
│       ├── __init__.py
│       ├── __pycache__
│       │   ├── __init__.cpython-38.pyc
│       │   └── transforms.cpython-38.pyc
│       └── transforms.py
├── logs
│   └── app.log
├── main.py
├── model
│   ├── pretrained_segmentation.pt
│   └── pretrained_segmentation_spleen.pt
├── __pycache__
│   └── main.cpython-38.pyc
├── README.md
└── requirements.txt

@diazandr3s
Copy link
Collaborator

diazandr3s commented Jul 5, 2024

Hi @vikashg,

Sorry I'm just catching up on comments/issues.

There are several things we can do here to find the source:

  • Make sure the filename is sanitized. Don't include specail characters in the filename
  • Can you please clean the cache folder and try again? It should be in you home dir. Something like

/home/USERNAME/.cache/monailabel/dicom/

  • Otherwise, for checking purposes, can you please downgrade MONAI Label to version 0.7.0 and try again. The 0.7.0 version uses OHIFv2.

I just want to check what could be the issue here. Please let us know.

@vikashg
Copy link
Author

vikashg commented Jul 29, 2024

Thanks @diazandr3s I will let you know. It kind of dropped from my radar. I will look back on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants