Skip to content

Commit

Permalink
track order
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenThornquist committed Nov 20, 2024
1 parent 107c234 commit 4bd1385
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions siffroi/roi.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def safe_save_ds(f : h5File, attr : str, data : np.ndarray, dtype = None):
safe_save_ds(f, 'polygon', self._polygon, np.float32)

if hasattr(self, 'subROIs') and len(self.subROIs) > 0:
subrois_group = f.create_group('subROIs')
subrois_group = f.create_group('subROIs', track_order=True)

for i, subroi in enumerate(self.subROIs):
subroi.save_to_group(subrois_group)
Expand Down Expand Up @@ -427,7 +427,8 @@ class subROI(ROI):
def save_to_group(self, subROI_group : Group)->None:
""" SubROIs save to the same file as their parent ROI, and so demand the h5file group """
this_subroi = subROI_group.create_group(
self.hashname
self.hashname,
track_order=True,
)

this_subroi.attrs['name'] = self.name if self.name is not None else Empty("s")
Expand Down

0 comments on commit 4bd1385

Please sign in to comment.