Skip to content

Commit

Permalink
Fix bug on change in labeling after cleanup once
Browse files Browse the repository at this point in the history
Increase version
  • Loading branch information
tomburke-rse committed May 6, 2022
1 parent 05e37b0 commit 4de9e95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions labeling/Labeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def __cleanup_labelsets(self) -> None:
t.insert(0, 0)
relabels = range(len(t) + 1)

temp = np.zeros(self.result_image.shape, np.int8)
temp = np.zeros(self.result_image.shape, self.result_image.dtype)
for a, b in zip(t, relabels):
temp[self.result_image == a] = b
self.result_image = temp
Expand All @@ -173,7 +173,7 @@ def __cleanup_labelsets(self) -> None:
segment_remapping = dict(zip(segments, range(1, len(segments) + 2)))
for setname, labelset in self.label_sets.items():
if setname in lookup_table.keys():
new_label_sets[str(lookup_table[setname])] = [segment_remapping[x] for x in list(labelset)]
new_label_sets[str(lookup_table[setname])] = set([segment_remapping[x] for x in list(labelset)])
for key, value in self.__segmentation_source.items():
self.__segmentation_source[key] = list(value)
self.label_sets = new_label_sets
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="labeling",
version="0.1.12",
version="0.1.13",
author="Tom Burke",
author_email="burke@mpi-cbg.de",
description="A package to create labeling/segmentation information based on pixel values.",
Expand Down

0 comments on commit 4de9e95

Please sign in to comment.