Skip to content

Commit

Permalink
refactor: PrecomputedSkeleton -> Skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Feb 2, 2024
1 parent 37cd4fc commit 55e6828
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions igneous/tasks/skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from cloudfiles import CloudFiles, CloudFile

import cloudvolume
from cloudvolume import CloudVolume, PrecomputedSkeleton, paths
from cloudvolume import CloudVolume, Skeleton, paths
from cloudvolume.lib import Vec, Bbox, sip
from cloudvolume.datasource.precomputed.sharding import synthesize_shard_files

Expand Down Expand Up @@ -335,7 +335,7 @@ def get_skeletons_by_segid(self, filenames):

def fuse_skeletons(self, skels):
if len(skels) == 0:
return PrecomputedSkeleton()
return Skeleton()

bbxs = [ item[0] for item in skels ]
skeletons = [ item[1] for item in skels ]
Expand All @@ -344,9 +344,9 @@ def fuse_skeletons(self, skels):
skeletons = [ s for s in skeletons if not s.empty() ]

if len(skeletons) == 0:
return PrecomputedSkeleton()
return Skeleton()

return PrecomputedSkeleton.simple_merge(skeletons).consolidate()
return Skeleton.simple_merge(skeletons).consolidate()

def crop_skels(self, bbxs, skeletons):
cropped = [ s.clone() for s in skeletons ]
Expand Down Expand Up @@ -433,7 +433,7 @@ def process_skeletons(self, unfused_skeletons, in_place=False):

for label in tqdm(unfused_skeletons.keys(), desc="Postprocessing", disable=(not self.progress)):
skels = unfused_skeletons[label]
skel = PrecomputedSkeleton.simple_merge(skels)
skel = Skeleton.simple_merge(skels)
skel.id = label
skel.extra_attributes = [
attr for attr in skel.extra_attributes \
Expand Down Expand Up @@ -484,7 +484,7 @@ def get_unfused(self, labels, filenames, cv, frag_path):

for filename, content in tqdm(all_files.items(), desc="Scanning Fragments", disable=(not self.progress)):
try:
fragment = MapBuffer(content, frombytesfn=PrecomputedSkeleton.from_precomputed)
fragment = MapBuffer(content, frombytesfn=Skeleton.from_precomputed)
fragment.validate()
except mapbuffer.ValidationError:
fragment = pickle.loads(content)
Expand Down

0 comments on commit 55e6828

Please sign in to comment.