question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide meaningful error message if all Segmentation frames are empty

See original GitHub issue

When using the static method of _omit_empty_frames, if there are no empty frames present (frames without positive pixels), then numpy thows an exception with regard to the empty non_empty_frames list passed into np.stack.

https://github.com/herrmannlab/highdicom/blob/95f39dd722ae6d357af3f942e2130d0ff4d68bfc/src/highdicom/seg/sop.py#L1037-L1078

May I suggest just a check on the array before proceeding?

        if len(non_empty_frames) == 0:
            return (pixel_array, plane_positions, []) 

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:24 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
CPBridgecommented, Jul 6, 2022

My personal leaning is to continue to allow segmentations with no “positive” pixels. The reason being that otherwise it becomes difficult to differentiate between a segmentation that was run and produced no positive output, and simply the lack of a segmentation. If we think in the context of an automated process (my bias of course), I would not want a segmentation process that crashed and therefore produced no output segmentation to be interpreted as the absence of a finding. This becomes especially important when segmentation processes are effectively serving as detectors too, most commonly for abnormalities such as lesions, tumors, strokes, stones, etc. The only way around this I think is to always accompany by an SR, and while I think that is probably a good idea, I imagine many people will not do this.

Anyway, we can leave this issue open to discuss with @dclunie but in the meantime I will create a PR later to improve the obviously bad error message users are currently getting “empty” segmentations.

1reaction
piepercommented, Jul 7, 2022

@fedorov it sounds like you are concerned about current OHIF not having features to make it clear that segmentations are empty, and that’s a fair issue. But I agree with the sentiment that @CPBridge summarized as the ability to “differentiate between a segmentation that was run and produced no positive output, and simply the lack of a segmentation”.

To me, for example, running a tumor segmentation and getting an empty result would be a very positive thing. Running a tumor segmentation and getting no result would be worrisome. The first would have metadata about the source data, the version of the segmentation algorithm, the date it was run, etc. and the result would be a clean bill of health. The second would just be a void of information. I agree we can have other metadata channels to further clarify the semantics, but even so having a blank segmentation result seems like a valid and useful construct.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Beginner's Guide to Semantic Segmentation [2022] - V7 Labs
Semantic Segmentation is the task of assigning a class label to every pixel in the image. Read this guide to explore the most...
Read more >
Semantic segmentation with OpenCV and deep learning
In this tutorial, you will learn how to perform semantic segmentation using OpenCV, deep learning, and the ENet architecture.
Read more >
Image Segmentation - Washington
The term image segmentation refers to the partition of an image into a set of regions that cover it. The goal in many...
Read more >
COMMON ERRORS IN KRONOS AND HOW TO FIX THEM
Non-exempt employees who have approval to work overtime should record their total hours worked each day without using any overtime pay codes such...
Read more >
Temporally Stable Video Segmentation Without Video ...
mentation masks generated by running DeepLabV3 on each frame independently. ... in each frame. If the error is consistent throughout the video, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found