Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1036 +/- ##
==========================================
- Coverage 73.10% 72.62% -0.49%
==========================================
Files 38 42 +4
Lines 6473 6914 +441
Branches 1144 1198 +54
==========================================
+ Hits 4732 5021 +289
- Misses 1265 1386 +121
- Partials 476 507 +31
🚀 New features to boost your workflow:
|
|
|
||
|
|
||
| # --- Registry --- | ||
|
|
There was a problem hiding this comment.
like the idea with the metric registry puts structure into complicated input types. Should consider adopting something like this more generally. Also do you know how well this works with spatialdata images and if they use something similar?
There was a problem hiding this comment.
like the idea with the metric registry puts structure into complicated input types.
agree!
Also do you know how well this works with spatialdata images and if they use something similar?
Wdym?
There was a problem hiding this comment.
Wdym?
like in general I wonder if there is something already similar to this in spatialdata codebase. Not the registry itself but the InputKind.
There was a problem hiding this comment.
Ahh, not that I'm aware of 🤔 We're channel agnostic. In sdata-plot I try to infer this from the channel names but formally it doesn't exist
selmanozleyen
left a comment
There was a problem hiding this comment.
Things to do:
- Sync with main (some files are old)
- Vectorize for loops I mentioned
- Use scikit-image when we can
e4890cc to
5952a86
Compare
Replaces the earlier qc_sharpness prototype with a general-purpose qc_image function that computes tile-based QC metrics on spatial images. Compute (sq.experimental.im.qc_image): - Tile-based metrics: sharpness (tenengrad, var_of_laplacian), intensity (brightness, entropy), staining (hematoxylin/eosin via HED deconvolution), and artifact detection (fold fraction, tissue fraction) - QCMetric enum and registry mapping each metric to its input kind and callable - Percentile-rank unfocus scoring within tissue tiles for outlier detection - Preview overlay showing flagged tiles on the image - Shared utilities in _utils.py: vectorized TileGrid (numpy + shapely.box), mask helpers, and shapes persistence (also used by make_tiles) Plot (sq.experimental.pl.qc_image): - Multi-panel summary: spatial view, KDE distribution (tissue vs background), and descriptive statistics per metric Metrics use scikit-image filters (sobel_h/v, laplace) instead of hand-rolled convolutions, and thread-safe HED caching avoids redundant deconvolution. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5952a86 to
a5e4dfd
Compare
|
|
||
|
|
||
| # --- Intensity metrics (grayscale input) --- | ||
|
|
There was a problem hiding this comment.
Maybe you aren't done yet but while I have it in mind I want to say I'd put intensity metrics in another file like done in sharpness metrics and have the registry in shorter file.
Also functions called outside a module should not start with _. squidpy.experimental.im._sharpness_metrics
is already private so _tenengrad_mean can be tenengrad_mean. Thats why in your IDE it might show _tenengrad_mean as unused function because the assumption is _tenengrad_mean is only meant to be used in the function it is defined.
IMPORTANT: Please search among the Pull requests before creating one.
Description
How has this been tested?
Closes