Skip to content

Commit

Permalink
add log messages tracking how many cells were removed through filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamaedler committed Jun 3, 2024
1 parent 4edefad commit 218d936
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/sparcscore/pipeline/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,10 +951,17 @@ def cellpose_segmentation(self, input_image):

else:

self.log(
" Performing filtering to match Cytosol and Nucleus IDs."
)

# perform filtering to remove cytosols which do not have a corresponding nucleus
filter = MatchNucleusCytosolIds(filtering_threshold = self.config["filtering_threshold"])
masks_nucleus, masks_cytosol = filter.filter(masks_nucleus, masks_cytosol)

self.log(f"Removed {len(filter.nuclei_discard_list)} nuclei and {len(filter.cytosol_discard_list)} cytosols due to filtering.")
self.log(f"After filtering, {len(filter.nucleus_lookup_dict)} matching nuclei and cytosol masks remain.")

if self.debug:
# plot nucleus and cytosol masks before and after filtering
fig, axs = plt.subplots(2, 2, figsize=(8, 8))
Expand Down

0 comments on commit 218d936

Please sign in to comment.