Skip to content

Commit

Permalink
Add cells-dict conversion function
Browse files Browse the repository at this point in the history
  • Loading branch information
rthiermann committed Jan 16, 2024
1 parent 64c8b22 commit 03b4ce9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/napari_mm3/utils_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ def cells2df(Cells_dict, columns = None):

return Cells_df

def cells2dict(Cells):
'''
Take a dictionary of Cells and returns a dictionary of dictionaries
'''

Cells_dict = {cell_id : vars(cell) for cell_id, cell in six.iteritems(Cells)}

return Cells_dict

### Filtering functions ############################################################################
def find_cells_of_birth_label(Cells, label_num=1):
'''Return only cells whose starting region label is given.
Expand Down

0 comments on commit 03b4ce9

Please sign in to comment.