Skip to content

Commit b7dcd2b

Browse files
authored
Merge branch 'main' into refactor-data-challenge
2 parents 3d5a441 + 4ddf4a5 commit b7dcd2b

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

src/segmentation_skeleton_metrics/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Package to evaluate a predicted segmentation.
33
"""
44

5-
__version__ = "5.5.1"
5+
__version__ = "5.5.8"

src/segmentation_skeleton_metrics/skeleton_metric.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ def run(self):
314314
util.update_txt(path, " # Splits: " + str(n_splits))
315315

316316
if self.fragment_graphs is not None:
317+
self.metrics["# Merges"].fillna(0, inplace=True)
317318
n_merges = self.metrics["# Merges"].sum()
318319
util.update_txt(path, " # Merges: " + str(n_merges))
319320

@@ -403,7 +404,7 @@ def count_merges(self, key, kdtree):
403404
# Iterate over fragments that intersect with GT skeleton
404405
for label in self.get_node_labels(key):
405406
nodes = self.graphs[key].nodes_with_label(label)
406-
if len(nodes) > 100:
407+
if len(nodes) > 70:
407408
for label in self.label_handler.get_class(label):
408409
if label in self.fragment_ids:
409410
self.is_fragment_merge(key, label, kdtree)
@@ -722,3 +723,4 @@ def to_local_voxels(self, key, i, offset):
722723
voxel = np.array(self.graphs[key].voxels[i])
723724
offset = np.array(offset)
724725
return tuple(voxel - offset)
726+

src/segmentation_skeleton_metrics/utils/swc_util.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,16 @@ def read(self, swc_pointer):
6565
6666
Parameters
6767
----------
68-
swc_pointer : dict, list, str
68+
swc_pointer : str or List[str]
6969
Object that points to SWC files to be read, must be one of:
70-
- swc_dir (str): Path to directory containing SWC files.
7170
- swc_path (str): Path to single SWC file.
72-
- swc_path_list (List[str]): List of paths to SWC files.
73-
- swc_zip (str): Path to a ZIP archive containing SWC files.
74-
- swc_zip_dir (str): Path to directory of ZIPs with SWC files.
71+
- swc_dir_path (str): Path to local directory containing SWC files.
72+
- swc_zip_path (str): Path to a local ZIP archive containing SWC files.
73+
- swc_zip_dir_path (str): Path to a local directory of ZIPs with SWC files.
74+
- swc_s3_dir_path (str): Path to S3 directory containing SWC files.
75+
- swc_gcs_dir_path (str): Path to GCS directory containing SWC files.
76+
- swc_gcs_zip_dir_path (str): Path to GCS directory containing ZIP archives of SWC files.
77+
- swc_path_list (List[str]): List of paths to local SWC files.
7578
7679
Returns
7780
-------
@@ -287,7 +290,7 @@ def read_from_gcs(self, gcs_path):
287290
Returns
288291
-------
289292
Dequeue[dict]
290-
List of dictionaries whose keys and values are the attribute
293+
Dictionaries whose keys and values are the attribute
291294
names and values from an SWC file.
292295
"""
293296
# List filenames
@@ -317,7 +320,7 @@ def read_from_gcs_swcs(self, bucket_name, swc_paths):
317320
Returns
318321
-------
319322
Dequeue[dict]
320-
List of dictionaries whose keys and values are the attribute
323+
Dictionaries whose keys and values are the attribute
321324
names and values from an SWC file.
322325
"""
323326
pbar = tqdm(total=len(swc_paths), desc="Read SWCs")
@@ -376,7 +379,7 @@ def read_from_gcs_zips(self, bucket_name, zip_paths):
376379
Returns
377380
-------
378381
Dequeue[dict]
379-
List of dictionaries whose keys and values are the attribute
382+
Dictionaries whose keys and values are the attribute
380383
names and values from an SWC file.
381384
"""
382385
swc_dicts = deque()
@@ -397,7 +400,7 @@ def read_from_gcs_zip(self, bucket_name, path):
397400
Returns
398401
-------
399402
Dequeue[dict]
400-
List of dictionaries whose keys and values are the attribute
403+
Dictionaries whose keys and values are the attribute
401404
names and values from an SWC file.
402405
"""
403406
# Initialize cloud reader

0 commit comments

Comments
 (0)