Fix bugs#33
Open
gwaybio wants to merge 8 commits into
Open
Conversation
Move numpy.empty array allocation outside the per-object loop in compute_texture. It was being reset on every iteration, discarding all previous objects' Haralick values and leaving only the last object intact. All prior objects received uninitialized memory from numpy.empty. Adds test_texture_values_correct_per_object: independently computes expected Haralick values per object with mahotas and asserts the pipeline output matches, catching any regression where the array is reset inside the loop. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-zero bug get_outline used find_boundaries with the default mode='thick', which returns both inner (object-side) and outer (background-side) boundary pixels. Because the image is zeroed outside the cell before get_outline is called, outer boundary pixels always have intensity 0, so numpy.min(edge pixels) always returned 0 regardless of actual edge intensity. Switching to mode='inner' restricts the edge mask to pixels inside the object boundary, so all edge pixels have real cell intensities. Adds test_min_intensity_edge_not_zero_for_bright_cell: a cell with uniform intensity 100 must have MinIntensityEdge=100, not 0. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Port all fixes from the NF1_3D audit to the equivalent ZedProfiler modules: - colocalization: initialize combined_thresh before try block (Bug 2), add numpy.any guard on overlap section, fix Accurate/Fast dispatch inversion (Bug 3), remove dead pre-loop pearsonr initialization (Bug 4), and fix compute_colocalization hard-coding fast_costes='Accurate' ignoring the caller's argument (Bug B) - granularity: guard per-axis scale factor against division-by-zero when a dimension has size 1, in both _upsample_3d and the background upsampling block (Bug 7) - neighbors: replace bbox-crop adjacency detection with 1-voxel morphological dilation so face-touching objects are detected correctly (Bug 5) - intensity: rename bbox variables to avoid collision with max_intensity_* names (Bug 9), add index=1 to scipy.ndimage.sum so it sums only the target object's voxels (Bug 10) Add regression tests in each test file covering all fixed bugs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds "Fast" as a distinct third mode (linear with adaptive skipping) matching CellProfiler's Accurate/Fast/Faster nomenclature. Previously "Fast" routed to bisection -- it now routes to linear_costes with fast_costes="Fast", and "Faster" routes to bisection. Fixes bisection_costes_threshold_calculation returning thresholds normalised to [0,1] (mid/scale_max) instead of raw pixel units. The outer dispatch's `image > thr` comparison requires raw values, so this was silently bypassing Costes thresholding in "Faster" mode. CellProfiler's library has the same bug; this is an intentional divergence, documented in a comment. Also updates both docstrings to describe all three modes, and adds value-based tests: convergence across all three modes, low threshold for correlated images, high threshold for anti-correlated images (linear only), and a documented test for bisection's degenerate anti-correlated edge case. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Switch README badge from a hardcoded shields.io percentage to a live Codecov badge that updates automatically on every push - Add coverage XML upload to the run_tests matrix job via codecov/codecov-action@v5 (no token needed for public repos) - Remove the coverage_and_badge job and the stale-badge check entirely One-time setup: activate the repo at codecov.io/gh/WayScience/ZedProfiler. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Running coverage on the full matrix (8 combinations) was redundant. Coverage is now measured once on ubuntu-24.04 + Python 3.13 in a separate job, and the matrix run_tests job is back to plain pytest. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
Both are obsolete now that the README uses a dynamic Codecov badge. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
MikeLippincott
approved these changes
Jun 25, 2026
MikeLippincott
left a comment
Member
There was a problem hiding this comment.
Most of the code was reviewed in the NF1_3D repo first, so not many comments here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixing bugs identified and fixed in WayScience/NF1_3D_organoid_profiling_pipeline#147
What kind of change(s) are included?
Checklist
Please ensure that all boxes are checked before indicating that this pull request is ready for review.