Skip to content

Commit

Permalink
Merge pull request #286 from pyplati/fix-wh-fail
Browse files Browse the repository at this point in the history
Add check for whole heart segmentation result
  • Loading branch information
pchlap authored Aug 20, 2024
2 parents e83359f + 8ec94da commit af71bf2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions platipy/imaging/projects/cardiac/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,10 @@ def run_hybrid_segmentation(img, settings=HYBRID_SETTINGS_DEFAULTS):
# Run the whole heart nnUNet segmentation
mask_wh = run_segmentation(img, settings["nnunet_settings"])

if "Struct_0" not in mask_wh.keys():
logger.warning("Whole Heart segmentation failed. Unable to proceed.")
return {}

# Run the 2nd part of the hybrid approach
return run_cardiac_segmentation(
img, guide_structure=mask_wh["Struct_0"], settings=settings["cardiac_settings"]
Expand Down

0 comments on commit af71bf2

Please sign in to comment.