Skip to content

Commit

Permalink
Some inappropriate code at UnshardedSkeletonMergeTask (#130)
Browse files Browse the repository at this point in the history
* Update skeleton.py

* Update skeleton.py
  • Loading branch information
JackieZhai authored Mar 31, 2022
1 parent 2734768 commit 8af7aaa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions igneous/tasks/skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def execute(self):
skeletons = []
for segid, frags in skels.items():
skeleton = self.fuse_skeletons(frags)
if self.max_cable_length is None or skel.cable_length() <= self.max_cable_length:
if self.max_cable_length is None or skeleton.cable_length() <= self.max_cable_length:
skeleton = kimimaro.postprocess(
skeleton, self.dust_threshold, self.tick_threshold
)
Expand All @@ -255,21 +255,21 @@ def get_filenames(self):
return [ _ for _ in cf.list(prefix=prefix) ]

def get_skeletons_by_segid(self, filenames):
cf = CloudFiles(self.cloudpath, progress=True)
cf = CloudFiles(self.cloudpath, progress=False)
skels = cf.get(filenames)

skeletons = defaultdict(list)
for skel in skels:
try:
segid = filename_to_segid(skel['filename'])
segid = filename_to_segid(skel['path'])
except ValueError:
# Typically this is due to preexisting fully
# formed skeletons e.g. skeletons_mip_3/1588494
continue

skeletons[segid].append(
(
Bbox.from_filename(skel['filename']),
Bbox.from_filename(skel['path']),
pickle.loads(skel['content'])
)
)
Expand Down Expand Up @@ -526,4 +526,4 @@ def TransferSkeletonFilesTask(
cf_src = CloudFiles(cv_src.mesh.meta.layerpath)
cf_dest = CloudFiles(cv_dest.mesh.meta.layerpath)

cf_src.transfer_to(cf_dest, paths=cf_src.list(prefix=prefix))
cf_src.transfer_to(cf_dest, paths=cf_src.list(prefix=prefix))

0 comments on commit 8af7aaa

Please sign in to comment.