Skip to content

Commit

Permalink
added frame item to aggregated metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-mueller committed Sep 26, 2023
1 parent 1eed267 commit 871810e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/napari_stress/_utils/frame_by_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,10 @@ def _list_of_layerdatatuple_to_layerdatatuple(self,
if len(data) == 1:
if 'features' in properties[0].keys():
_properties['features'] = data[0][1]['features']
_properties['features']['frame'] = np.zeros(len(data[0][0]), dtype=int)
if 'metadata' in properties[0].keys():
_properties['metadata'] = data[0][1]['metadata']
_properties['metadata']['frame'] = [0]
else:
# Stack features
if 'features' in properties[0].keys():
Expand All @@ -302,6 +304,7 @@ def _list_of_layerdatatuple_to_layerdatatuple(self,
for key in metadata_list[0].keys():
new_metadata[key] = [frame[key] for frame in metadata_list]

new_metadata['frame'] = [t for t in range(len(metadata_list))]
_properties['metadata'] = new_metadata
[frame.pop('metadata') for frame in properties]

Expand Down

0 comments on commit 871810e

Please sign in to comment.