Repository navigation
Commit 121abd1
committed
Fix circle-shapes area in measure_obs: use pi*r**2, not shapely Point.area (=0)
Circles are stored as `Point` geometries with a `radius` column, for which
shapely `.area` is 0 — so `measure_obs` wrote area=0 and equivalent_diameter=0
for every circle (surfaced on the real Visium spots dataset, all circles).
Compute their area as `pi * r**2`; equivalent diameter then equals the true
diameter `2*r`. Polygons/multipolygons still use the geometric area. Adds a
regression test on `blobs_circles`.1 parent 8c87330 commit 121abd1
2 files changed
Lines changed: 20 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4527 | 4527 | | |
4528 | 4528 | | |
4529 | 4529 | | |
| 4530 | + | |
| 4531 | + | |
| 4532 | + | |
| 4533 | + | |
| 4534 | + | |
| 4535 | + | |
| 4536 | + | |
4530 | 4537 | | |
4531 | | - | |
4532 | | - | |
4533 | | - | |
4534 | | - | |
4535 | | - | |
| 4538 | + | |
4536 | 4539 | | |
4537 | 4540 | | |
4538 | 4541 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
557 | 569 | | |
558 | 570 | | |
559 | 571 | | |
| |||
0 commit comments