Skip to content

Commit

Permalink
Fix TypeError
Browse files Browse the repository at this point in the history
Fixes metadata handling when a ruler is present but no scale
was determined.

Fixes #46
  • Loading branch information
johnbradley committed Feb 3, 2023
1 parent 8fb60ed commit 8fdb8bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Scripts/Morphology_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def get_scale(metadata_file):
unit = "None"

if 'ruler' in metadata_dict :
scale = round(metadata_dict['ruler']['scale'],3)
scale = metadata_dict['ruler']['scale']
if scale != "None":
scale = round(scale, 3)
unit = metadata_dict['ruler']['unit']

return scale , unit
Expand Down

0 comments on commit 8fdb8bb

Please sign in to comment.