Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
87222a0
WIP: RP, draw new objects, etc
Teranis Apr 6, 2026
1cbb398
WIP: tracker opt
Teranis Apr 7, 2026
94c8bb4
feat: updated RP, updated tracking, updated lab modifications in many…
Teranis Apr 7, 2026
4ebeab5
WIP: fix regionprops local cutouts
Teranis Apr 7, 2026
5e9de08
WIP: Fix assignment update
Teranis Apr 8, 2026
5f3f62e
fix: set self.lab to avoid stale lab
Teranis Apr 9, 2026
a7de6e1
fix: merge and separate IDs
Teranis Apr 10, 2026
2b5fe62
feat: cython implementation for find_all_objects
Teranis Apr 23, 2026
881038d
feat: update rp factory to use own find obj function
Teranis Apr 23, 2026
3583929
feat: further opt, update gh workflow
Teranis Apr 23, 2026
e97eae1
fix: updated gh action
Teranis Apr 23, 2026
2f3a240
fix: updated gh action 2
Teranis Apr 23, 2026
908a084
fix: add setup.py
Teranis Apr 23, 2026
c3dcf5d
fix: updated gh action 3
Teranis Apr 23, 2026
8838861
fix: updated gh action 4
Teranis Apr 23, 2026
370c241
feat: contour caching, Io cython
Teranis Apr 24, 2026
e7af3a9
fix: cython workflow
Teranis Apr 25, 2026
c46b521
Update .gitignore
Teranis Apr 25, 2026
dc6d599
ci: update precompiled Cython extensions [skip ci]
github-actions[bot] Apr 25, 2026
0641f0a
Merge branch 'main' into optimizations
Teranis Apr 27, 2026
48632ab
ci: update precompiled Cython extensions [skip ci]
github-actions[bot] Apr 27, 2026
255bb43
feat: update unit tests
Teranis Apr 27, 2026
99f7e91
Merge branch 'optimizations' of https://github.com/SchmollerLab/Cell_…
Teranis Apr 27, 2026
d45140c
fix: remove unused zslices rp
ElpadoCan Apr 27, 2026
901565c
WIP/feat: contour 3D caching inside rp, 3D for hull and fill holes
Teranis Apr 27, 2026
dff33e1
feat: add most common projection
Teranis Apr 27, 2026
e9f8974
Merge branch 'main' into optimizations
Teranis Apr 27, 2026
be318af
fix: forgotten debug print
Teranis Apr 27, 2026
f9727d3
feat: change extension name to cellacdc.precompiled.precompiled_funct…
Teranis Apr 28, 2026
8628cf5
fix: cython compile, documentation, comment out redundant code
Teranis Apr 28, 2026
b4d1398
ci: update precompiled Cython extensions [skip ci]
github-actions[bot] Apr 28, 2026
91ac6d7
fix: copilot comments
Teranis Apr 28, 2026
2606508
feat: opt finding most common label on proj, tooltips
Teranis Apr 28, 2026
d7defed
fix: correct getBaseAcdcDf IDs init
Teranis Apr 28, 2026
25d4f17
feat: getBaseAcdcDf better decision when to include z_centroid
Teranis Apr 28, 2026
0d36b0f
ci: update precompiled Cython extensions [skip ci]
github-actions[bot] Apr 28, 2026
ea783d5
ci: update precompiled Cython extensions [skip ci]
github-actions[bot] Apr 28, 2026
3acd5f7
fix: gh workflow compile
Teranis Apr 28, 2026
f11f577
Merge branch 'optimizations' of https://github.com/SchmollerLab/Cell_…
Teranis Apr 28, 2026
329f265
ci: update precompiled Cython extensions [skip ci]
github-actions[bot] Apr 28, 2026
f06800e
test: delete binaries
Teranis Apr 28, 2026
4a25124
Merge branch 'optimizations' of https://github.com/SchmollerLab/Cell_…
Teranis Apr 28, 2026
1da1626
ci: update precompiled Cython extensions [skip ci]
github-actions[bot] Apr 28, 2026
b04f2b2
fix: always commit binaries
Teranis Apr 28, 2026
dadf0fe
ci: update precompiled Cython extensions [skip ci]
github-actions[bot] Apr 28, 2026
a9e741f
fix: check that getSingleTimepointSegmSize is not None
Teranis Apr 28, 2026
f05499e
fix: 2 step tracker
Teranis Apr 29, 2026
5d30f61
feat: add most_common_projection_3D to binary verification
Teranis Apr 29, 2026
d3800d2
review: fixes and changes after reviewing
ElpadoCan Apr 29, 2026
1a4f651
fix: 2 steps tracker, keep objects
Teranis Apr 29, 2026
f96894c
Merge branch 'optimizations' of https://github.com/SchmollerLab/Cell_…
Teranis Apr 29, 2026
b1ca41f
fix: stale myutils.exec_time import
Teranis Apr 29, 2026
cc65daa
Merge branch 'main' into optimizations
Teranis May 6, 2026
90d4c56
Merge branch 'optimizations' of https://github.com/SchmollerLab/Cell_…
Teranis May 6, 2026
e4062a4
fix: rp None for fresh segm
Teranis May 6, 2026
5384dc7
fix: lint error
Teranis May 6, 2026
07cd77b
fix: init rp for not timelapse data
Teranis May 6, 2026
7fffaf7
WIP: seg for lost IDs with different models
Teranis May 7, 2026
717d54b
feat: ignore 0 when computing most common
Teranis May 8, 2026
4f13044
ci: update precompiled Cython extensions [skip ci]
github-actions[bot] May 8, 2026
8d97c75
fix: gh workflow and fill holes brush
Teranis May 8, 2026
add6a03
ci: update precompiled Cython extensions [skip ci]
github-actions[bot] May 8, 2026
07b3b45
fix: gh workflow
Teranis May 8, 2026
2c7da44
ci: update precompiled Cython extensions [skip ci]
github-actions[bot] May 8, 2026
b02b726
fix: 2D ID edit on 3D
Teranis May 8, 2026
e6ee822
Merge branch 'optimizations' of https://github.com/SchmollerLab/Cell_…
Teranis May 8, 2026
b237eb0
fix: errors from working on too much stuff at the same time
Teranis May 8, 2026
f51cf4b
feat: contours and mask vew new approach
Teranis May 9, 2026
7ac4807
Merge branch 'optimizations' into seg_for_lost_IDs_2
Teranis May 9, 2026
77e3498
ci: update precompiled Cython extensions [skip ci]
github-actions[bot] May 9, 2026
0a9522c
ci: update precompiled Cython extensions [skip ci]
github-actions[bot] May 9, 2026
3cb1226
fix: copilot comments
Teranis May 9, 2026
a7d63af
Merge branch 'seg_for_lost_IDs_2' of https://github.com/SchmollerLab/…
Teranis May 9, 2026
39ab0b3
feat: add cumstom model bettere handled
Teranis May 9, 2026
767f0da
fix: copilot comments
Teranis May 9, 2026
4c1dbb3
fix: copilot comments, UI appearance, bugs
Teranis May 11, 2026
8ff1cf6
fix: automatic thresholding
Teranis May 11, 2026
4c1de3d
fix: github comments, thresholding
Teranis May 12, 2026
a34b775
feat: use any fluo channel for segmentation
Teranis May 12, 2026
a58d90e
feat: info label for select model
Teranis May 12, 2026
616f2ad
fix: dragging scrollbar
Teranis May 12, 2026
f93ba05
fix: dragging scrollbar
Teranis May 18, 2026
6d5a86e
improvement: warn when segmenting too many items for text annot, clos…
ElpadoCan Jun 5, 2026
c79938b
feat: better debug mode, refactoring old convoluted code
Teranis Jun 15, 2026
ce19b63
Potential fix for pull request finding
Teranis Jun 18, 2026
ae5cdb4
fix: copilot comments and merge conflicts
Teranis Jun 18, 2026
18ea01d
Merge branch 'seg_for_lost_IDs_2' of https://github.com/SchmollerLab/…
Teranis Jun 18, 2026
103e1fa
Merge branch 'optimizations' of https://github.com/SchmollerLab/Cell_…
Teranis Jun 18, 2026
dc50fe5
Merge pull request #1098 from SchmollerLab/seg_for_lost_IDs_2
Teranis Jun 18, 2026
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
111 changes: 111 additions & 0 deletions .github/workflows/build_cython_extensions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Build Cython extensions

permissions:
contents: write

on:
push:
paths:
- "cellacdc/**/*.pyx"
- "precompile_functions.py"
workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ${{ github.workspace }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Build extension
run: |
python -m pip install --upgrade "setuptools>=77" cython numpy
# Remove existing binaries so only the freshly built one remains for upload
python -c "
import os, glob
for f in glob.glob('cellacdc/precompiled/*.so') + glob.glob('cellacdc/precompiled/*.pyd'):
os.remove(f)
print(f'Removed existing: {f}')
"
python "${{ github.workspace }}/precompile_functions.py" build_ext --inplace --build-temp "${{ github.workspace }}/build/temp"
echo "Built binary:"
ls cellacdc/precompiled/

- uses: actions/upload-artifact@v6
with:
name: precompiled-${{ matrix.os }}-py${{ matrix.python-version }}
path: |
cellacdc/precompiled/*.so
cellacdc/precompiled/*.pyd

commit:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
working-directory: ${{ github.workspace }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.ref_name }}
fetch-depth: 0

- uses: actions/download-artifact@v6
with:
path: artifacts/

- name: Flatten artifacts into precompiled directory
run: |
mkdir -p cellacdc/precompiled
find artifacts -type f \( -name "*.pyd" -o -name "*.so" \) -exec cp {} cellacdc/precompiled/ \;
echo "Files copied:"
ls -la cellacdc/precompiled/
echo ""
echo "Total files:"
find cellacdc/precompiled/ -type f | grep -E '\.(pyd|so)$' | wc -l

- name: Validate artifact count
run: |
EXPECTED_COUNT=12
FILE_COUNT=$(find cellacdc/precompiled/ -type f \( -name "*.pyd" -o -name "*.so" \) | wc -l)
echo "Expected files: $EXPECTED_COUNT"
echo "Found files: $FILE_COUNT"
if [ "$FILE_COUNT" -lt "$EXPECTED_COUNT" ]; then
echo "Missing binaries: expected at least $EXPECTED_COUNT, found $FILE_COUNT"
exit 1
fi

- name: Commit precompiled binaries
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
find cellacdc/precompiled/ -type f \( -name "*.pyd" -o -name "*.so" \) -print0 | xargs -0 git add -f
git add cellacdc/precompiled/__init__.py
FILE_COUNT=$(find cellacdc/precompiled/ -type f \( -name "*.pyd" -o -name "*.so" \) | wc -l)
echo "Files to commit: $FILE_COUNT"
if [ "$FILE_COUNT" -eq 0 ]; then
echo "No precompiled files found, skipping commit"
exit 0
fi
if git diff --cached --quiet; then
echo "No changes to commit"
exit 0
fi
git commit -m "ci: update precompiled Cython extensions [skip ci]"
git pull --rebase origin ${{ github.ref_name }}
git push origin HEAD:${{ github.ref_name }}
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ requirements_new.txt
**/weights_location_path.txt
**/_test

# cython generated files
*.pyd
*.so
!cellacdc/precompiled/
!cellacdc/precompiled/*.pyd
!cellacdc/precompiled/*.so

# Test output plots
tests/_plots/

Expand All @@ -36,7 +43,6 @@ setup.cfg

# Starting from pip 21.3 setup.py is not needed anymore
# and we rely only on setup.cfg for env
setup.py
environment.yml
# requirements.txt
conda_env_list_commands.txt
Expand Down
15 changes: 14 additions & 1 deletion cellacdc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,4 +806,17 @@ def inner_function(self, *args, **kwargs):
single_pos_index_cols = (
'experiment_folderpath',
'Position_n'
)
)

precompiled_import_success = False
try:
from cellacdc.precompiled.precompiled_functions import (
find_all_objects_2D,
find_all_objects_3D,
calc_IoA_matrix_2D,
calc_IoA_matrix_3D,
most_common_projection_3D,
)
precompiled_import_success = True
except Exception:
pass
28 changes: 28 additions & 0 deletions cellacdc/_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,34 @@ def warnTooManyItems(mainWin, numItems, qparent):
)
return msg.cancel, msg.clickedButton==switchToLowResButton

def warnTooManyNewItems(mainWin, numItems, qparent):
from . import widgets
mainWin.logger.info(
'[WARNING]: asking user what to do with too many objects...'
)
msg = widgets.myMessageBox(wrapText=False)
txt = html_utils.paragraph(f"""
WARNING: The resulting segmentation mask has <b>{numItems} objects</b>.<br><br>
Creating <b>high resolution</b> text annotations
for these many objects could take a <b>long time</b>.<br><br>
We recommend <b>deactivating text annotations</b> or <b>switching to low resolution</b> annotations.<br><br>
You can still try to switch to activate them or switch to high resolution later.<br><br>
What do you want to do?
""")

_, switchToLowResButton, deactivateAnnotButton = msg.warning(
qparent, 'Too many objects', txt,
buttonsTexts=(
'Cancel',
widgets.reloadPushButton(' Switch to low resolution '),
widgets.noPushButton(' Deactivate text annotations ')
)
)
switchToLowRes = msg.clickedButton==switchToLowResButton
deactivateAnnot = msg.clickedButton==deactivateAnnotButton

return msg.cancel, switchToLowRes, deactivateAnnot

def warnRestartCellACDCcolorModeToggled(
scheme, app_name='Cell-ACDC', parent=None
):
Expand Down
Loading