Skip to content

BundleSeg: fix 'scaling' SLR and remove unused and broken single_recognize_parallel - #1377

Open
CSimon-A wants to merge 6 commits into
scilus:masterfrom
CSimon-A:bundleseg-cleanups
Open

CSimon-A wants to merge 6 commits into
scilus:masterfrom
CSimon-A:bundleseg-cleanups

Conversation

@CSimon-A

@CSimon-A CSimon-A commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

DO NOT MERGE UNTIL PR #1373 AND #1376 ARE MERGED!!

Quick description

Fixes #1374 and #1375.

Builds on #1376, which builds on #1373: until they are merged, this PR also shows their commits. Please review only the last two commits.

Type of change

  • bundleseg.py: in _register_model_to_neighb, 'scaling' skipped the similarity step, so slm.xopt[6] did not exist and it raised IndexError. The SLR steps now build on each other (translation → rigid → similarity → scaling), like the translation and rigid steps already did. 'similarity', the only type used by VotingScheme, runs exactly the same steps as before.
  • test_bundleseg.py: test_register_model_to_neighb now runs for the four SLR types.
  • voting_scheme.py: removed single_recognize_parallel, which was never called and could not work (it called single_recognize with separate arguments instead of a single tuple).

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

Validation

  • test_register_model_to_neighb passes for the four SLR types ('scaling' raised IndexError before).
  • Compared with Refactor BundleSeg: steps take arguments and return values #1376 on the same 56 cases used there: identical indices and scores, except the two 'scaling' cases (error before, results now).
  • single_recognize_parallel is not used anywhere else in scilpy.
  • pytest src/scilpy/segment and test_tractogram_segment_with_bundleseg.py pass.

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

codecov Bot commented Nov 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.91%. Comparing base (c787973) to head (d4d9ba9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1377      +/-   ##
==========================================
+ Coverage   72.57%   72.91%   +0.33%     
==========================================
  Files         301      301              
  Lines       26279    26272       -7     
  Branches     3702     3700       -2     
==========================================
+ Hits        19073    19157      +84     
+ Misses       5655     5558      -97     
- Partials     1551     1557       +6     
Flag Coverage Δ
smoketests 69.73% <13.46%> (-0.01%) ⬇️
unittests 14.74% <90.38%> (+0.51%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Scripts 75.28% <ø> (ø)
Library 70.07% <92.30%> (+0.74%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

BundleSeg: slr_transform_type='scaling' raises IndexError

1 participant