Skip to content

Commit

Permalink
Merge pull request #62 from raidionics/download-fix
Browse files Browse the repository at this point in the history
Fix download; edge case handling
  • Loading branch information
andreped authored Jun 21, 2024
2 parents 1a46c84 + ee7e255 commit 79725b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion demo/src/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def __init__(
self.cwd = cwd
self.share = share

self.filename = None
self.extension = None

self.class_name = "airways" # default
self.class_names = {
"airways": "CT_Airways",
Expand Down Expand Up @@ -102,10 +105,11 @@ def process(self, mesh_file_name):
return "./prediction.obj"

def download_prediction(self):
if (not self.filename) or (not self.extension):
if (self.filename is None) or (self.extension is None):
LOGGER.error(
"The prediction is not available or ready to download. Wait until the result is available in the 3D viewer."
)
raise ValueError("Run inference before downloading!")
return self.filename + "." + self.extension

def get_img_pred_pair(self, k):
Expand Down

0 comments on commit 79725b7

Please sign in to comment.