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

Hyperplane update #1034

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

Hyperplane update #1034

wants to merge 28 commits into from

Conversation

frheault
Copy link
Member

@frheault frheault commented Oct 2, 2024

Quick description

Attempt at having our improved RADTRACT Hyperplane subdivision !

image
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10246281/
...

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 2, 2024

Hello @frheault, Thank you for updating !

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

Line 57:1: W293 blank line contains whitespace
Line 81:80: E501 line too long (81 > 79 characters)
Line 184:80: E501 line too long (80 > 79 characters)
Line 200:80: E501 line too long (80 > 79 characters)
Line 265:35: E203 whitespace before ','
Line 292:1: W293 blank line contains whitespace
Line 300:1: W293 blank line contains whitespace
Line 339:37: E127 continuation line over-indented for visual indent
Line 340:37: E127 continuation line over-indented for visual indent
Line 342:21: E127 continuation line over-indented for visual indent
Line 352:22: E128 continuation line under-indented for visual indent
Line 354:80: E501 line too long (83 > 79 characters)
Line 371:22: E128 continuation line under-indented for visual indent
Line 383:22: E128 continuation line under-indented for visual indent
Line 395:22: E128 continuation line under-indented for visual indent
Line 398:22: E128 continuation line under-indented for visual indent
Line 416:41: E128 continuation line under-indented for visual indent
Line 418:21: E128 continuation line under-indented for visual indent
Line 419:1: W293 blank line contains whitespace
Line 421:5: E303 too many blank lines (2)
Line 428:5: E303 too many blank lines (2)

Line 205:80: E501 line too long (80 > 79 characters)
Line 246:80: E501 line too long (92 > 79 characters)
Line 266:80: E501 line too long (81 > 79 characters)
Line 300:80: E501 line too long (84 > 79 characters)
Line 314:80: E501 line too long (81 > 79 characters)

Comment last updated at 2024-12-12 18:45:11 UTC

Copy link

codecov bot commented Oct 2, 2024

Codecov Report

Attention: Patch coverage is 76.41791% with 79 lines in your changes missing coverage. Please review.

Project coverage is 56.73%. Comparing base (eb2e9ba) to head (23d65e5).

❗ There is a different number of reports uploaded between BASE (eb2e9ba) and HEAD (23d65e5). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (eb2e9ba) HEAD (23d65e5)
unittests 2 1
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1034       +/-   ##
===========================================
- Coverage   69.96%   56.73%   -13.24%     
===========================================
  Files         448      646      +198     
  Lines       24291    30209     +5918     
  Branches     3334     3413       +79     
===========================================
+ Hits        16996    17139      +143     
- Misses       5874    11633     +5759     
- Partials     1421     1437       +16     
Components Coverage Δ
Scripts 53.71% <57.27%> (-17.02%) ⬇️
Library 61.30% <85.77%> (-7.64%) ⬇️

@frheault frheault changed the title WIP: Hyperplane update Hyperplane update Dec 12, 2024
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.

Complicated code I don't fully understand, but apart from a few missing or incomplete docstring I didn't come across anything shocking. Also looks like there are a lot of remaining PEP8 issues.

@@ -117,8 +118,7 @@ def uniformize_bundle_sft(sft, axis=None, ref_bundle=None, swap=False):
else:
# Bitwise XOR
if (bool(labels[tuple(sft.streamlines[i][0].astype(int))] >
labels[tuple(sft.streamlines[i][-1].astype(int))])
^ bool(swap)):
labels[tuple(sft.streamlines[i][-1].astype(int))])):
Copy link
Contributor

Choose a reason for hiding this comment

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

I trust you with the bitwise operations, but just want to make sure you didn't remove the ^ bool(swap) part by accident?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's ok since the if at line 98 is swapping labels, this is checking orientation again based on that swap (so we don't want to cancel the previous swap)

scilpy/tractanalysis/distance_to_centroid.py Outdated Show resolved Hide resolved
scilpy/tractanalysis/distance_to_centroid.py Outdated Show resolved Hide resolved
scilpy/tractanalysis/distance_to_centroid.py Outdated Show resolved Hide resolved
scilpy/tractanalysis/distance_to_centroid.py Outdated Show resolved Hide resolved
scilpy/tractanalysis/distance_to_centroid.py Show resolved Hide resolved
scripts/scil_bundle_label_map.py Outdated Show resolved Hide resolved
scripts/scil_bundle_label_map.py Outdated Show resolved Hide resolved
scripts/scil_bundle_label_map.py Outdated Show resolved Hide resolved
scripts/scil_bundle_label_map.py Show resolved Hide resolved
@frheault
Copy link
Member Author

frheault commented Feb 3, 2025

@AntoineTheb Last time you tried that branch, everything was fine with the input/output?

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.

few comments but LGTM:

flake8 scilpy/tractograms/streamline_and_mask_operations.py 
scilpy/tractograms/streamline_and_mask_operations.py:634:5: F841 local variable 'orig_segment_len' is assigned to but never used

sft_centroid.to_vox()
sft.to_corner()
sft_centroid.to_corner()
# TODO DOCSTRING !
Copy link
Contributor

Choose a reason for hiding this comment

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

@frheault still missing docstring here

from scilpy.viz.color import get_lookup_table
from scilpy.version import version_string

Copy link
Contributor

Choose a reason for hiding this comment

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

add
from scilpy.version import version_string

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