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 #92

Merged
merged 6 commits into from
Jul 22, 2024
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
- name: Install Dependencies
run: |
pip install --upgrade pip
pip install .[dev]
pip install .[dev] --verbose
- name: Generate Docs
run: |
make gen-docs
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.9, '3.10']
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
pip install .[test] --verbose
- name: Test with pytest
run: |
pytest --cov-report xml --cov=aicssegmentation aicssegmentation/tests/
Expand All @@ -36,15 +36,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
pip install .[test] --verbose
- name: Lint with flake8
run: |
flake8 aicssegmentation --count --verbose --show-source --statistics
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test-and-lint-manual-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.9, '3.10']
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
pip install .[test] --verbose
- name: Test with pytest
run: |
pytest aicssegmentation/tests/
Expand All @@ -29,11 +29,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.9, '3.10']
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
pip install .[test] --verbose
- name: Test with pytest
run: |
pytest aicssegmentation/tests/
Expand All @@ -28,15 +28,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
pip install .[test] --verbose
- name: Lint with flake8
run: |
flake8 aicssegmentation --count --verbose --show-source --statistics
Expand Down
13 changes: 1 addition & 12 deletions aicssegmentation/structure_wrapper/seg_PCNA_lateS.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,11 @@ def Workflow_PCNA_lateS(
# smoothing with boundary preserving smoothing
structure_img_smooth = edge_preserving_smoothing_3d(struct_img)
structure_img_smooth_otsu = edge_preserving_smoothing_3d(struct_img_otsu)


out_img_list.append(structure_img_smooth.copy())
out_name_list.append("im_smooth")
out_img_list.append(structure_img_smooth_otsu.copy())
out_name_list.append("im_smooth_otsu")


###################
# core algorithm
Expand All @@ -100,18 +98,9 @@ def Workflow_PCNA_lateS(
response_f3 = response_f3 > vesselness_cutoff

response_s3_1 = dot_3d(structure_img_smooth, log_sigma=dot_3d_sigma)
response_s3_3 = dot_3d(structure_img_smooth, log_sigma=3)

#bw_small_inverse = remove_small_objects(response_s3_1 > 0.035, min_size=150)
#bw_small = np.logical_xor(bw_small_inverse, response_s3_1 > 0.025)
#bw_small = response_s3_1 > 0.12
bw_medium = response_s3_1 > 0.05
#bw_large = response_s3_3 > 0.45
#bw_large = np.logical_or(response_s3_3 > 0.45, response_f3 > 0.5)
#bw_dots = np.logical_or(bw_medium, bw_large)
#bw = np.logical_and(bw_dots, bw_otsu_mask_removesmallobjects)
bw = np.logical_and(bw_medium, bw_otsu_mask_removesmallobjects)

out_img_list.append(bw_otsu_mask.copy())
out_name_list.append("bw_otsu_mask")
out_img_list.append(bw_otsu_mask_removesmallobjects.copy())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from skimage.filters import threshold_otsu
from scipy import ndimage


def Workflow_PCNA_lateS_hole_fill(
struct_img: np.ndarray,
rescale_ratio: float = -1,
Expand Down Expand Up @@ -75,13 +76,11 @@ def Workflow_PCNA_lateS_hole_fill(
# smoothing with boundary preserving smoothing
structure_img_smooth = edge_preserving_smoothing_3d(struct_img)
structure_img_smooth_otsu = edge_preserving_smoothing_3d(struct_img_otsu)


out_img_list.append(structure_img_smooth.copy())
out_name_list.append("im_smooth")
out_img_list.append(structure_img_smooth_otsu.copy())
out_name_list.append("im_smooth_otsu")


###################
# core algorithm
Expand All @@ -93,15 +92,14 @@ def Workflow_PCNA_lateS_hole_fill(
bw_otsu_mask, min_size=otsumask_min_area, connectivity=1, in_place=False
)


response_s3_1 = dot_3d(structure_img_smooth, log_sigma=dot_3d_sigma)
response_s3_2 = dot_3d(structure_img_smooth, log_sigma=2)

bw_medium = response_s3_1 > 0.05
bw_large = response_s3_2 > 0.095
bw_large = response_s3_2 > 0.095
bw_dots = np.logical_or(bw_medium, bw_large)
bw = np.logical_and(bw_dots, bw_otsu_mask_removesmallobjects)

out_img_list.append(bw_otsu_mask.copy())
out_name_list.append("bw_otsu_mask")
out_img_list.append(bw_otsu_mask_removesmallobjects.copy())
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
"Intended Audience :: Developers",
"License :: Free for non-commercial use",
"Natural Language :: English",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
description="Part 1 of Allen Cell and Structure Segmenter",
entry_points={
Expand Down