From 7b59945b63f55ad064414492c2b9631d5e905f20 Mon Sep 17 00:00:00 2001 From: Philipp Sommer Date: Thu, 6 Jan 2022 08:56:43 +0100 Subject: [PATCH] Hotfix for compatibility with the latest version of pandas and pillow --- straditize/binary.py | 4 +++- straditize/straditizer.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/straditize/binary.py b/straditize/binary.py index a4721c9..f6d9d8c 100755 --- a/straditize/binary.py +++ b/straditize/binary.py @@ -571,7 +571,9 @@ def iter_all_readers(self): def get_labeled_array(self): """Create a connectivity-based labeled array of the :attr:`binary` data """ - return skim.label(self.binary, 8, return_num=False) + return np.where( + self.binary, skim.label(self.binary, 8, return_num=False), 0 + ) def update_image(self, arr, amask): """Update the image after having removed binary data diff --git a/straditize/straditizer.py b/straditize/straditizer.py index e13a815..d40b58f 100644 --- a/straditize/straditizer.py +++ b/straditize/straditizer.py @@ -1290,8 +1290,8 @@ def update_samples(self, remove=True): data[is_occurence] = self.data_reader.occurences_value df = pd.DataFrame(data, index=index.astype(int)).sort_index() self.data_reader.sample_locs = df.loc[ - (~df.index.duplicated().values) & - (~df.index.duplicated().values)] + (~df.index.duplicated()) & + (~df.index.duplicated())] self.data_reader._update_rough_locs() if remove: self.remove_marks()