[GH-ISSUE #3] python example: showcase background processing best practices #3

Closed
opened 2026-03-23 20:22:36 +00:00 by mirror · 4 comments
Owner

Originally created by @sectra-masve on GitHub (Jan 15, 2024).
Original GitHub issue: https://github.com/sectra-medical/dpat_imageanalysisapi_sdk/issues/3

  • receive request/notification
  • save a preliminary result to give user feedback that something is happening
  • schedule worker to do background work
  • update result for user when background job finishes
Originally created by @sectra-masve on GitHub (Jan 15, 2024). Original GitHub issue: https://github.com/sectra-medical/dpat_imageanalysisapi_sdk/issues/3 - receive request/notification - save a preliminary result to give user feedback that something is happening - schedule worker to do background work - update result for user when background job finishes
mirror 2026-03-23 20:22:36 +00:00
Author
Owner

@daangeijs commented on GitHub (Jul 15, 2024):

Hi, I'm currently implementing this API and I would like to know if you could already have an answer/example to this point:

save a preliminary result to give user feedback that something is happening

Is it possible to update some sort of status field. Currently I have a hard time understanding how I let the user know what the progress of the request process is.

I'm using it for WholeSlide analysis combined with the 'imagenotification' endpoint and would like to know from which flavours to pick to show the status of my algorithm. Currently from the API documentation it is only clear to me how to post results as 'annotation' e.g. polygons.

<!-- gh-comment-id:2228553540 --> @daangeijs commented on GitHub (Jul 15, 2024): Hi, I'm currently implementing this API and I would like to know if you could already have an answer/example to this point: `save a preliminary result to give user feedback that something is happening` Is it possible to update some sort of status field. Currently I have a hard time understanding how I let the user know what the progress of the request process is. I'm using it for WholeSlide analysis combined with the 'imagenotification' endpoint and would like to know from which flavours to pick to show the status of my algorithm. Currently from the API documentation it is only clear to me how to post results as 'annotation' e.g. polygons.
Author
Owner

@sectra-masve commented on GitHub (Oct 2, 2024):

Sorry @daangeijs for the late reply. My intent is to recommend creating a polygon. Currently working on the details of appropriate placement/size etc. The label text of polygons can be updated, and thus the text is where I suggest progress reports are sent.

<!-- gh-comment-id:2388369605 --> @sectra-masve commented on GitHub (Oct 2, 2024): Sorry @daangeijs for the late reply. My intent is to recommend creating a polygon. Currently working on the details of appropriate placement/size etc. The label text of polygons can be updated, and thus the text is where I suggest progress reports are sent.
Author
Owner

@sectra-masve commented on GitHub (Oct 2, 2024):

Here's an excerpt of the relevant code, creating a rectangle polygon surrounding the entire slide with the label top-right:

    text = "wsi processing. 0%"
    max_y = metadata["imageSize"]["height"] / metadata["imageSize"]["width"]

    response_result = {
        "type": "primitive",
        "content": {
            "style": {"fillStyle": None, "size": None, "strokeStyle": "#FFA500"},
            "polygons": [{"points": [{"x": 0.0, "y": 0.0}, {"x": 1.0, "y": 0.0}, {"x": 1.0, "y": max_y}, {"x": 0.0, "y": max_y}]}],
            "labels": [
                {"location": {"x": 1.0, "y": 0.0}, "label": text}
            ],
        },
    }
<!-- gh-comment-id:2388543239 --> @sectra-masve commented on GitHub (Oct 2, 2024): Here's an excerpt of the relevant code, creating a rectangle polygon surrounding the entire slide with the label top-right: ``` text = "wsi processing. 0%" max_y = metadata["imageSize"]["height"] / metadata["imageSize"]["width"] response_result = { "type": "primitive", "content": { "style": {"fillStyle": None, "size": None, "strokeStyle": "#FFA500"}, "polygons": [{"points": [{"x": 0.0, "y": 0.0}, {"x": 1.0, "y": 0.0}, {"x": 1.0, "y": max_y}, {"x": 0.0, "y": max_y}]}], "labels": [ {"location": {"x": 1.0, "y": 0.0}, "label": text} ], }, } ```
Author
Owner

@sectra-masve commented on GitHub (Nov 20, 2024):

Since there is now a full example in #7 which will be merged soon, I'll close this issue.

<!-- gh-comment-id:2489006243 --> @sectra-masve commented on GitHub (Nov 20, 2024): Since there is now a full example in #7 which will be merged soon, I'll close this issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sectra-medical/archived-dpat-imageanalysisapi-sdk#3
No description provided.