Provide meaningful error message if all Segmentation frames are empty
See original GitHub issueWhen 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
.
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:
- Created a year ago
- Comments:24 (17 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
@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.