Skip to content

Commit

Permalink
v0.3.2 fixing erosion bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Corentin committed May 10, 2023
1 parent 7550a15 commit 38d991f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,6 @@ debug_data/
!binary_mask_sdh.tif
data/*
*intensity_plot.png
*.idea
*.idea
cellpose.sh
nohup.out
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10.9
3.10.11
27 changes: 27 additions & 0 deletions myoquant/__main__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
import typer
from rich.console import Console
import pkg_resources

__version__ = pkg_resources.get_distribution("myoquant").version
__version_cellpose__ = pkg_resources.get_distribution("cellpose").version
__version_stardist__ = pkg_resources.get_distribution("stardist").version
__version_torch__ = pkg_resources.get_distribution("torch").version
__version_tensorflow__ = pkg_resources.get_distribution("tensorflow").version

from .commands.docs import app as docs_app
from .commands import run_sdh, run_he, run_atp

console = Console()


def version_callback(value: bool):
if value:
print(
f"MyoQuant Version: {__version__} \nCellpose Version: {__version_cellpose__} \nStardist Version: {__version_stardist__} \nTorch Version: {__version_torch__} \nTensorflow Version: {__version_tensorflow__}"
)
raise typer.Exit()


app = typer.Typer(
name="MyoQuant",
add_completion=False,
Expand All @@ -15,6 +31,17 @@
app.add_typer(docs_app, name="docs", help="Generate documentation")


@app.callback()
def main(
version: bool = typer.Option(
None, "--version", callback=version_callback, is_eager=True
)
):
"""
MyoQuant Analysis Command Line Interface
"""


app.registered_commands += (
run_sdh.app.registered_commands
+ run_he.app.registered_commands
Expand Down
6 changes: 3 additions & 3 deletions myoquant/src/common_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ def extract_single_image(raw_image, df_props, index, erosion=None):
surface_area = df_props.iloc[index, 1]
cell_radius = math.sqrt(surface_area / math.pi)
single_entity_mask = df_props.iloc[index, 9].copy()
erosion_size = cell_radius * (
erosion / 100
) # Erosion in percentage of the cell radius
if erosion is not None:
erosion_size = cell_radius * (
erosion / 100
) # Erosion in percentage of the cell radius
for i in range(int(erosion_size)):
single_entity_mask = binary_erosion(
single_entity_mask, out=single_entity_mask
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "myoquant"
version = "0.3.1"
version = "0.3.2"
description = "MyoQuant🔬: a tool to automatically quantify pathological features in muscle fiber histology images."
authors = ["Corentin Meyer <[email protected]>"]
maintainers = ["Corentin Meyer <[email protected]>"]
Expand Down

0 comments on commit 38d991f

Please sign in to comment.