Skip to content
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

Move utils.streamlines methods #950

Merged
merged 10 commits into from
Mar 27, 2024

Conversation

EmmaRenauld
Copy link
Contributor

@EmmaRenauld EmmaRenauld commented Mar 21, 2024

Quick description

  • All methods in utils.streamlines moved elsewhere.
    - Changed: get_color_streamlines_from_angle is now only get_angle. The color is managed separately.
    - Changed: get_color_streamlines_along_length is now only get_values_along_length. The color is managed separately.

  • tractanalysis.feature is renamed tractanalysis.bundle_operation (it could also go in tractograms if you prefer). Some of its methods have been moved to tractogram.tractogram_operations or tractogram.streamline_operations if they didn't really concern bundles.

  • Script scil_tractogram_assign_custom_color strongly modified:
    - LUT was loaded but not used, and re-loaded later in sub-function.
    - Sometimes, data was loaded as data = ..., sometimes as values, lbound, ubound = ..., but actually, the same call to clip_and_normalize_data_for_cmap was always done, just very unclear. That's why they are removed from the two methods described above.
    - Tried to remove access to hidden ._data when possible.
    - Encapsulated main script to new dps_and_dpp_management method.

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

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 Mar 21, 2024

Hello @EmmaRenauld, Thank you for updating !

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

Comment last updated at 2024-03-27 12:42:11 UTC

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 64.50512% with 104 lines in your changes are missing coverage. Please review.

Project coverage is 67.02%. Comparing base (234b88c) to head (7e80020).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #950      +/-   ##
==========================================
+ Coverage   66.86%   67.02%   +0.16%     
==========================================
  Files         396      395       -1     
  Lines       21290    21289       -1     
  Branches     3225     3225              
==========================================
+ Hits        14235    14269      +34     
+ Misses       5756     5715      -41     
- Partials     1299     1305       +6     
Components Coverage Δ
Scripts 67.93% <60.71%> (+0.18%) ⬆️
Library 65.59% <65.40%> (+0.12%) ⬆️

Copy link
Contributor

@CHrlS98 CHrlS98 left a comment

Choose a reason for hiding this comment

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

I read the code. Some minor comments. Good to go once they are addressed.

scilpy/tractograms/dps_and_dpp_management.py Show resolved Hide resolved
scilpy/tractograms/streamline_operations.py Show resolved Hide resolved
scilpy/tractograms/tests/test_streamline_operations.py Outdated Show resolved Hide resolved
scilpy/tractograms/tractogram_operations.py Outdated Show resolved Hide resolved
scilpy/tractograms/tractogram_operations.py Outdated Show resolved Hide resolved
scilpy/tractograms/tractogram_operations.py Outdated Show resolved Hide resolved
scilpy/viz/utils.py Outdated Show resolved Hide resolved
@EmmaRenauld EmmaRenauld mentioned this pull request Mar 27, 2024
13 tasks
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.

GTG

@arnaudbore arnaudbore merged commit c039764 into scilus:master Mar 27, 2024
2 checks passed
@EmmaRenauld EmmaRenauld deleted the move_tractogram_methods branch March 27, 2024 15:53
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