Skip to content

Conversation

@AntoineTheb
Copy link
Contributor

Quick description

Change the behavior of scil_volume_pairwise_comparison in the case of --single_compare.

If the option is not included, overreach is computed as the number/ratio of voxels in either volumes but not in both, a sort of logical xor. However, if comparing volumes against a reference one (ie using --single_compare), it would make more sense to compute the overreach as the number/ratio of voxels in the candidate volume that are not in the reference. This second behavior would be closer to a "tractometer-style" overreach.

This is a breaking change in the case of --single_compare.

Type of change

Check the relevant options.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Provide data, screenshots, command line to test (if relevant)

TODO

Checklist

  • My code follows the style guidelines of this project (run autopep8)
  • I added relevant citations to scripts, modules and functions docstrings and descriptions
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I moved all functions from the script file (except the argparser and main) to scilpy modules
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@codecov
Copy link

codecov bot commented Sep 25, 2025

Codecov Report

❌ Patch coverage is 61.53846% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.44%. Comparing base (c70bb19) to head (844a30a).
⚠️ Report is 119 commits behind head on master.

❌ Your patch status has failed because the patch coverage (61.53%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (72.44%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1242      +/-   ##
==========================================
- Coverage   72.45%   72.44%   -0.02%     
==========================================
  Files         293      293              
  Lines       25185    25194       +9     
  Branches     3527     3530       +3     
==========================================
+ Hits        18249    18253       +4     
- Misses       5445     5448       +3     
- Partials     1491     1493       +2     
Components Coverage Δ
Scripts 75.29% <100.00%> (+<0.01%) ⬆️
Library ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@EmmaRenauld
Copy link
Contributor

I think you should divide by the number of voxels in the reference volume, to follow explanations on tractometer.org:
image

Currently:
With my volume = 570 560 voxels and reference = 130 859

  1. With --single_compare, no --ratio: 💯 This looks good. You indeed fixed the overreach raw ratio.

    • On master: 97 443 overlap, 506 533 overreach.
    • On your branch: 97 443 overlap, 473 117 overreach.
    • With scil_volume_math: 97 443 intersection, 473 117 difference (input - reference)
  2. With --single_compare, with ratio: You seem to be dividing by the input volume's size.

    • Expecting overlap = 97,443/130,859 = 74.46% and overreach = 473 117/130 859 = 361.55%
    • On your branch, I get: 17% and 83%

@AntoineTheb
Copy link
Contributor Author

@EmmaRenauld you're right, should be fixed now

Copy link
Contributor

@arnaudbore arnaudbore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arnaudbore arnaudbore added this pull request to the merge queue Oct 31, 2025
Merged via the queue into scilus:master with commit bfe8225 Oct 31, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants