Skip to content

BundleSeg exploration viewer for filtering #1035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
May 15, 2025

Conversation

frheault
Copy link
Member

@frheault frheault commented Oct 11, 2024

Quick description

Implemented a new BundleSeg slider feature for filtering
Improved code to limit RAM usage by processing FreeSurfer surfaces (FSS) in chunks, making it easier to handle larger datasets.

New Features:

  • Exploration Mode (--exploration_mode):
    This mode searches all bundles at a higher pruning threshold (12mm).
    A second script then visualizes the results and can save outputs in the specified folder.
  • Distance Threshold Modification (--modify_distance_thr):
    Allows customization of the pruning distance threshold for all bundles.
    Default value is 0.0, but this parameter can be adjusted based on the user's requirements.

Performance Improvements:
Slight speed optimization, especially for large datasets. For example, processing a 2GB tractogram with 6M streamlines and 51 atlas bundles takes approximately 5 minutes on 4 processes.
RAM usage is now optimized, allowing for smoother handling of large subjects on machines with limited resources (e.g., 5 large subjects processed on 4 CPUs with 32GB RAM).

Note: Using more than 4 processes (e.g., 8 or 16) doesn't significantly improve speed in this scenario.

image
Title:
...

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)

...

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

@pep8speaks
Copy link

pep8speaks commented Oct 11, 2024

Hello @frheault, Thank you for updating !

Line 152:80: E501 line too long (81 > 79 characters)
Line 163:80: E501 line too long (85 > 79 characters)
Line 177:80: E501 line too long (80 > 79 characters)
Line 261:80: E501 line too long (81 > 79 characters)
Line 319:80: E501 line too long (83 > 79 characters)

Line 176:1: W293 blank line contains whitespace
Line 214:80: E501 line too long (81 > 79 characters)
Line 281:80: E501 line too long (84 > 79 characters)
Line 290:80: E501 line too long (84 > 79 characters)
Line 391:80: E501 line too long (81 > 79 characters)

Line 192:80: E501 line too long (80 > 79 characters)
Line 217:80: E501 line too long (80 > 79 characters)
Line 292:80: E501 line too long (80 > 79 characters)
Line 406:80: E501 line too long (80 > 79 characters)
Line 458:80: E501 line too long (81 > 79 characters)
Line 465:80: E501 line too long (80 > 79 characters)

Line 25:80: E501 line too long (80 > 79 characters)

Comment last updated at 2024-12-12 18:58:07 UTC

Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 19.65443% with 372 lines in your changes missing coverage. Please review.

Project coverage is 72.02%. Comparing base (3ddae5d) to head (5492585).
Report is 37 commits behind head on master.

❌ Your patch status has failed because the patch coverage (19.65%) 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.02%) 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    #1035      +/-   ##
==========================================
- Coverage   73.18%   72.02%   -1.16%     
==========================================
  Files         451      452       +1     
  Lines       24872    25232     +360     
  Branches     3424     3452      +28     
==========================================
- Hits        18202    18174      -28     
- Misses       5207     5597     +390     
+ Partials     1463     1461       -2     
Components Coverage Δ
Scripts 74.02% <3.93%> (-1.54%) ⬇️
Library 69.39% <50.00%> (-0.71%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@frheault
Copy link
Member Author

@GuillaumeTh Testing BundleSeg on a random big tractogram with the new --exploration_mode option and then using the viewer would be great for a tumor case showcase.

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.

Some comments, works as expected. Can you move the viewer from scil_bundle_explore_bundleseg.py somewhere else ?

@mdesco mdesco added this pull request to the merge queue May 15, 2025
Merged via the queue into scilus:master with commit 19c87b7 May 15, 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.

4 participants