Skip to content

Commit

Permalink
allow to pass custom name for generation of xml files during selectio…
Browse files Browse the repository at this point in the history
…n process
  • Loading branch information
sophiamaedler committed Apr 22, 2024
1 parent b716a47 commit 47b1da4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/sparcscore/pipeline/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)


def process(self, hdf_location, cell_sets, calibration_marker):
def process(self, hdf_location, cell_sets, calibration_marker, name = None):
"""
Process function for selecting cells and generating their XML.
Under the hood this method relies on the pylmd library and utilizies its `SegmentationLoader` Class.
Expand Down Expand Up @@ -135,10 +135,11 @@ class will automaticly provide the most recent segmentation forward together wit
shape_collection.plot(calibration =True)
shape_collection.stats()

try:
name = "_".join([cell_set['name'] for cell_set in cell_sets])
except:
name = 'selected_cells'
if name is None:
try:
name = "_".join([cell_set['name'] for cell_set in cell_sets])
except:
name = 'selected_cells'

savename = name.replace(" ","_") + ".xml"
savepath = os.path.join(self.directory, savename)
Expand Down

0 comments on commit 47b1da4

Please sign in to comment.