Skip to content

Commit

Permalink
Fixed skeleton size and image padding
Browse files Browse the repository at this point in the history
  • Loading branch information
c-h-benedetti committed Jan 14, 2025
1 parent b68e2e1 commit 7a49a70
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ dependencies = [
"torch",
"tensorflow==2.16.1",
"skan"
"ultralytics"
"yolov5"
]

# Required for documentation: tabs, sphinx_sphinx, myst_parser, sphinx_rtd_theme
Expand Down
2 changes: 1 addition & 1 deletion src/microglia_analyzer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.0.1"
__version__ = "1.0.2"

import re

Expand Down
4 changes: 2 additions & 2 deletions src/microglia_analyzer/_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def run_batch(self):
self.n_images = len(self.get_all_tiff_files(self.sources_folder))
self.pbr = progress()
self.pbr.set_description("Running on folder...")
self.run_batch_button.setText(f"▶ Run batch ({str(1).zfill(2)}/{self.n_images})")
self.run_batch_button.setText(f"▶ Run batch ({str(1).zfill(2)}/{str(self.n_images).zfill(2)})")
self.set_active_ui(False)
self.thread = QThread()

Expand Down Expand Up @@ -460,7 +460,7 @@ def update_pbr(self, text, current, total):
# self.pbr.reset(total=total)
# self.total = total
if (self.n_images > 0):
self.run_batch_button.setText(f"▶ Run batch ({str(current+1).zfill(2)}/{self.n_images})")
self.run_batch_button.setText(f"▶ Run batch ({str(current+1).zfill(2)}/{str(self.n_images).zfill(2)})")
# self.pbr.update(current)

def clear_attributes(self):
Expand Down
6 changes: 4 additions & 2 deletions src/microglia_analyzer/ma_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,11 @@ def analyze_as_graph(self):
if label == 0:
continue
mask = (self.mask == label).astype(np.uint8)
if np.sum(mask) < 3:
try:
r, s = self.analyze_skeleton(mask)
except:
continue
results[label], skeleton = self.analyze_skeleton(mask)
results[label], skeleton = r, s
skeletons = np.maximum(skeletons, skeleton)
self.graph_metrics = results
self.skeleton = skeletons
Expand Down

0 comments on commit 7a49a70

Please sign in to comment.