Skip to content

Commit

Permalink
Sorting surface and mask keys before opening project
Browse files Browse the repository at this point in the history
  • Loading branch information
tfmoraes committed Nov 30, 2021
1 parent 46e9180 commit 4447024
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions invesalius/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def load_from_folder(self, dirpath):

# Opening the masks
self.mask_dict = TwoWaysDictionary()
for index in project.get("masks", []):
for index in sorted(project.get("masks", []), key=lambda x: int(x)):
filename = project["masks"][index]
filepath = os.path.join(dirpath, filename)
m = msk.Mask()
Expand All @@ -343,7 +343,7 @@ def load_from_folder(self, dirpath):

# Opening the surfaces
self.surface_dict = {}
for index in project.get("surfaces", []):
for index in sorted(project.get("surfaces", []), key=lambda x: int(x)):
filename = project["surfaces"][index]
filepath = os.path.join(dirpath, filename)
s = srf.Surface(int(index))
Expand Down

0 comments on commit 4447024

Please sign in to comment.