Skip to content

Conversation

@AntoineTheb
Copy link
Contributor

@AntoineTheb AntoineTheb commented Nov 5, 2024

Quick description

This PR improves bundle endpoint maps computation. Before, the map was only computed on streamline points exactly, which may be problematic if the step size is too large (see fig. 1 for ref). Now, the map includes every voxel traversed by the endpoints (however many points are selected). Moreover, the user can now select n millimeters instead of points, which makes much more sense when dealing with compressed streamlines.

Breaking change: the arguments of scil_bundle_compute_endpoint_maps.py are now slightly different.

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)

image
Fig 1.: Before, 3 points

image
Fig. 2: After, 3 points

image
Fig. 3: After, 10mm.

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 Nov 5, 2024

Hello @AntoineTheb, Thank you for updating !

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-11-08 16:17:31 UTC

point_to_select: int
Instead of computing the density based on the first and last points,
select more than one at each end. To support compressed streamlines,
a resampling to 0.5mm per segment is performed.
Copy link
Contributor Author

@AntoineTheb AntoineTheb Nov 5, 2024

Choose a reason for hiding this comment

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

Narrator: this actually wasn't performed.

@codecov
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.89%. Comparing base (81765a2) to head (dd88f79).
Report is 97 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1047      +/-   ##
==========================================
+ Coverage   68.79%   68.89%   +0.10%     
==========================================
  Files         432      434       +2     
  Lines       22454    22646     +192     
  Branches     3041     3078      +37     
==========================================
+ Hits        15448    15603     +155     
- Misses       5706     5727      +21     
- Partials     1300     1316      +16     
Components Coverage Δ
Scripts 69.61% <100.00%> (-0.06%) ⬇️
Library 67.89% <100.00%> (+0.33%) ⬆️

" of the streamlines. [%(default)s]")
p.add_argument('--mm', action='store_true',
help='Compute the endpoints in mm instead of nb. of '
'points. Useful for compressed streamlines.')
Copy link
Contributor

@EmmaRenauld EmmaRenauld Nov 7, 2024

Choose a reason for hiding this comment

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

I think this could be a little clearer. Like, if user adds --mm, but not --nb_points, is it clear to them that it will take 1mm?

Maybe.... If set, the value --nb_points will instead be understood as the length, in mm. But I'm not sure that's perfect either.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about 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 merged commit 546f1a9 into scilus:master Nov 8, 2024
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