Skip to content

Commit

Permalink
Better implementation for label selection
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliabaldini committed Aug 4, 2023
1 parent 64ab05d commit 1f5ae00
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions boa_contrast/features/feature_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ def compute_features(
if isinstance(self.label_map[region], int):
region_mask = body_region_all == self.label_map[region]
else:
region_mask = body_region_all == self.label_map[region][0]
for num in self.label_map[region][1:]:
region_mask += body_region_all == num
region_mask = np.isin(body_region_all, self.label_map[region])
if np.sum(region_mask) == 0:
continue

Expand Down

0 comments on commit 1f5ae00

Please sign in to comment.