Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix for compatibility with the latest version of pandas and pillow #22

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion straditize/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions straditize/straditizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down