Skip to content

Commit

Permalink
more pythonic implementation to get keys()
Browse files Browse the repository at this point in the history
Co-authored-by: Casper da Costa-Luis <casper.dcl@physics.org>
  • Loading branch information
KrisThielemans and casperdcl authored Jul 16, 2024
1 parent 67781a4 commit 9cc4a52
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions petric.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,7 @@ def evaluate(self, test_im: STIR.ImageData) -> dict[str, float]:
return {**whole, **local}

def keys(self):
l = ["RMSE_whole_object", "RMSE_background"]
for voi_name in sorted(self.voi_indices.keys()):
l.append(f"AEM_VOI_{voi_name}")
return l
return ["RMSE_whole_object", "RMSE_background"] + [f"AEM_VOI_{name}" for name in sorted(self.voi_indices)]


class MetricsWithTimeout(cil_callbacks.Callback):
Expand Down

0 comments on commit 9cc4a52

Please sign in to comment.