DeepMicroscopy / SlideRunner

SlideRunner is a tool for massive cell annotations in whole slide images
GNU General Public License v3.0
75 stars 10 forks source link

Can't sync SlideRunner with Exact #29

Closed bnapora closed 3 years ago

bnapora commented 3 years ago

Attempt to sync SlideRunner with local instance of Exact server.

Local Exact Server is functioning: http://localhost:1337/api/v1/images/images/

Set configuration in SlideRunner "settings Exact support: enabled EXACT server: http://localhost:1337/ EXACT username: exact EXACT password: exact

Click "Export Image to Exact" get following Uncaught exception. (Looks like an extra "/" is in code.)

Traceback (most recent call last):

File "C:\WSI\SlideRunner\SlideRunner\SlideRunner.py", line 2072, in exportToExact raise(e)

File "C:\WSI\SlideRunner\SlideRunner\SlideRunner.py", line 2049, in exportToExact imagesets = exm.APIs.image_sets_api.list_image_sets(pagination=False, expand='product_set').results

File "C:\ProgramData\Miniconda3\envs\sliderunner\lib\site-packages\exact_sync\v1\api\image_sets_api.py", line 306, in list_image_sets return self._get_all(self.list_image_sets_with_http_info, **kwargs)

File "C:\ProgramData\Miniconda3\envs\sliderunner\lib\site-packages\exact_sync\v1\api\pagination_base_api.py", line 8, in _get_all data = func(**kwargs)

File "C:\ProgramData\Miniconda3\envs\sliderunner\lib\site-packages\exact_sync\v1\api\image_sets_api.py", line 450, in list_image_sets_with_http_info collection_formats=collection_formats)

File "C:\ProgramData\Miniconda3\envs\sliderunner\lib\site-packages\exact_sync\v1\api_client.py", line 322, in call_api _preload_content, _request_timeout)

File "C:\ProgramData\Miniconda3\envs\sliderunner\lib\site-packages\exact_sync\v1\api_client.py", line 153, in __call_api _request_timeout=_request_timeout)

File "C:\ProgramData\Miniconda3\envs\sliderunner\lib\site-packages\exact_sync\v1\api_client.py", line 343, in request headers=headers)

File "C:\ProgramData\Miniconda3\envs\sliderunner\lib\site-packages\exact_sync\v1\rest.py", line 237, in GET query_params=query_params)

File "C:\ProgramData\Miniconda3\envs\sliderunner\lib\site-packages\exact_sync\v1\rest.py", line 227, in request raise ApiException(http_resp=r)

exact_sync.v1.rest.ApiException: (404) Reason: Not Found HTTP response headers: HTTPHeaderDict({'Server': 'nginx/1.17.4', 'Date': 'Thu, 08 Oct 2020 17:38:54 GMT', 'Content-Type': 'text/html', 'Content-Length': '13465', 'Connection': 'keep-alive', 'Vary': 'Accept-Language, Cookie', 'Content-Language': 'en', 'X-Frame-Options': 'DENY', 'X-Content-Type-Options': 'nosniff'}) HTTP response body: <!DOCTYPE html>

Page not found at //api/v1/images/image_sets/

Page not found (404)

Request Method: GET
Request URL: http://localhost//api/v1/images/image_sets/?expand=product_set

Using the URLconf defined in exact.urls, Django tried these URL patterns, in this order:

  1. ^user/
  2. ^accounts/register/$
  3. ^accounts/
  4. ^accounts/
  5. ^ ^$ [name='index']
  6. ^ ^timesync/$ [name='time sync']
  7. ^ ^problems/$ [name='problem']
  8. ^admin/
  9. ^administration/
  10. ^annotations/
  11. ^images/
  12. ^users/
  13. ^tagger_messages/
  14. ^tools/
  15. ^images/image_sets_explore/$ [name='ImageSetView-list']
  16. ^images/image_sets_explore\.(?P<format>[a-z0-9]+)/?$ [name='ImageSetView-list']
  17. ^images/image_sets_explore/(?P<pk>[^/.]+)/$ [name='ImageSetView-detail']
  18. ^images/image_sets_explore/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='ImageSetView-detail']
  19. ^images/images_explore/$ [name='ImageView-list']
  20. ^images/images_explore\.(?P<format>[a-z0-9]+)/?$ [name='ImageView-list']
  21. ^images/images_explore/(?P<pk>[^/.]+)/$ [name='ImageView-detail']
  22. ^images/images_explore/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='ImageView-detail']
  23. ^images/images_explore/(?P<pk>[^/.]+)/get_patch/$ [name='ImageView-get-patch']
  24. ^images/images_explore/(?P<pk>[^/.]+)/get_patch\.(?P<format>[a-z0-9]+)/?$ [name='ImageView-get-patch']
  25. ^images/images_explore/(?P<pk>[^/.]+)/slide_information/$ [name='ImageView-slide-information']
  26. ^images/images_explore/(?P<pk>[^/.]+)/slide_information\.(?P<format>[a-z0-9]+)/?$ [name='ImageView-slide-information']
  27. ^images/images_explore/(?P<pk>[^/.]+)/thumbnail/$ [name='ImageView-thumbnail']
  28. ^images/images_explore/(?P<pk>[^/.]+)/thumbnail\.(?P<format>[a-z0-9]+)/?$ [name='ImageView-thumbnail']
  29. ^images/versions_explore/$ [name='VersionView-list']
  30. ^images/versions_explore\.(?P<format>[a-z0-9]+)/?$ [name='VersionView-list']
  31. ^images/versions_explore/(?P<pk>[^/.]+)/$ [name='VersionView-detail']
  32. ^images/versions_explore/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='VersionView-detail']
  33. ^annotations/annotation_types_explore/$ [name='AnnotationTypeView-list']
  34. ^annotations/annotation_types_explore\.(?P<format>[a-z0-9]+)/?$ [name='AnnotationTypeView-list']
  35. ^annotations/annotation_types_explore/(?P<pk>[^/.]+)/$ [name='AnnotationTypeView-detail']
  36. ^annotations/annotation_types_explore/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='AnnotationTypeView-detail']
  37. ^annotations/annotations_explore/$ [name='AnnotationView-list']
  38. ^annotations/annotations_explore\.(?P<format>[a-z0-9]+)/?$ [name='AnnotationView-list']
  39. ^annotations/annotations_explore/(?P<pk>[^/.]+)/$ [name='AnnotationView-detail']
  40. ^annotations/annotations_explore/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='AnnotationView-detail']
  41. ^annotations/annotations_media_files_explore/$ [name='AnnotationMediaFileView-list']
  42. ^annotations/annotations_media_files_explore\.(?P<format>[a-z0-9]+)/?$ [name='AnnotationMediaFileView-list']
  43. ^annotations/annotations_media_files_explore/(?P<pk>[^/.]+)/$ [name='AnnotationMediaFileView-detail']
  44. ^annotations/annotations_media_files_explore/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='AnnotationMediaFileView-detail']
  45. ^annotations/annotation_versions_explore/$ [name='AnnotationVersionView-list']
  46. ^annotations/annotation_versions_explore\.(?P<format>[a-z0-9]+)/?$ [name='AnnotationVersionView-list']
  47. ^annotations/annotation_versions_explore/(?P<pk>[^/.]+)/$ [name='AnnotationVersionView-detail']
  48. ^annotations/annotation_versions_explore/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='AnnotationVersionView-detail']
  49. ^administration/products_explore/$ [name='ProductView-list']
  50. ^administration/products_explore\.(?P<format>[a-z0-9]+)/?$ [name='ProductView-list']
  51. ^administration/products_explore/(?P<pk>[^/.]+)/$ [name='ProductView-detail']
  52. ^administration/products_explore/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='ProductView-detail']
  53. ^$ [name='api-root']
  54. ^\.(?P<format>[a-z0-9]+)/?$ [name='api-root']
  55. api/v1/
  56. api/v1/openapi [name='openapi-schema']
  57. ^media\/(?P<path>.*)$

The current path, /api/v1/images/image_sets/, didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

      </li>

  </ol>
  <p>

    The current path, <code>/api/v1/images/image_sets/</code>, didn't match any of these.
  </p>

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

bnapora commented 3 years ago

I don't think I was clear in my initial post. I believe there is an additional "/" in the code that handles the Exact server URL in Settings. Below is an example of the URL it is trying to resolve to (I added SUFFIXONURL after the back slash), there is a second / appended to the URL that I put into the Settings.

Is there a specific format that we should use for entering the URL into the Exact Server URL setting?

Brian

ChristianMarzahl commented 3 years ago

Moin Brian,

Its looks like you use "http://127.0.0.1:1337/" in the SlideRunner settings. Could you please remove the last backslash? http://127.0.0.1:1337 that should fix your issue.

Thank you for reaching out to us with your issue.

With kind regards, Christian

bnapora commented 3 years ago

Christian,

Below is a screen shot of the SlideRunner settings: image

However, in the error log, it looks like the extra "/" is being appended somewhere in the code: image

My steps to generate this error are: 1.) Launch side runner 2.) Open local database 3.) Click "Import image from Exact"

maubreville commented 3 years ago

Thanks for the report, we will look into that!

maubreville commented 3 years ago

Dear Brian. Could you check if the fix resolved your issue?

bnapora commented 3 years ago

Marc,

Yes...that enabled connection to my local Exact server. Thanks addressing. I've attempted to export an image from SlideRunner to Exact but get and error. I will more study to confirm if my Exact server is configured correctly. If you have any tips or tricks on how to synchronize SlideRunner with Exact they would be greatly appreciated.

Brian

bnapora commented 3 years ago

This is the handled error message I get when attempting to Export image from SlideRunner: image

maubreville commented 3 years ago

I see. There was a flaw in the code that I don't know how it got into there.

bnapora commented 3 years ago

Cool. Tested and now able to export

bnapora commented 3 years ago

Thanks for fixing.