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

Update of the tutorial apply image-based registration to streamlines #2930

Merged
merged 3 commits into from
Oct 12, 2023

Conversation

skoudoro
Copy link
Member

The goal of this PR is to fix a tutorial that give wrong result.

Also, we got many times this question so it was tie to fix the tutorial.

This is a follow up of #2369

it should resolves #2703, resolves #2400 and resolves #2786

it should answer #2646 discussion.

Sorry for the delay @WilliamFCB, it would be great if you could test it.

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Merging #2930 (e494c64) into master (8ea916d) will decrease coverage by 0.05%.
Report is 37 commits behind head on master.
The diff coverage is 13.63%.

❗ Current head e494c64 differs from pull request most recent head da8045c. Consider uploading reports for the commit da8045c to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2930      +/-   ##
==========================================
- Coverage   81.73%   81.68%   -0.05%     
==========================================
  Files         146      146              
  Lines       20361    20375      +14     
  Branches     3232     3232              
==========================================
+ Hits        16642    16644       +2     
- Misses       2901     2913      +12     
  Partials      818      818              
Files Coverage Δ
dipy/tracking/local_tracking.py 94.44% <ø> (ø)
dipy/align/imwarp.py 93.23% <13.63%> (-2.34%) ⬇️

Copy link
Contributor

@arokem arokem left a comment

Choose a reason for hiding this comment

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

Good stuff! I have one suggestion for refactoring some duplication in the code and another small comment about usage in the example, but overall - I believe this can go in.

streamlines._offsets = points._offsets.astype(old_offsets_dtype)
streamlines._data = out.astype(old_data_dtype)
return streamlines

Copy link
Contributor

Choose a reason for hiding this comment

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

While we're here, could we maybe reduce some of the duplication in this code? Unless I am missing something, these two functions are identical except for a couple of lines, so maybe we could move all of the code into one private function to be called from two different wrapper functions?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good point, I will do it tomorrow.

doc/examples/streamline_registration.py Outdated Show resolved Hide resolved
@skoudoro
Copy link
Member Author

code refactored! this is ready to go @arokem. Thank you again for the suggestion, I do not know why I did not do that in the first place.

@arokem
Copy link
Contributor

arokem commented Oct 12, 2023

I believe the CI failure is not a real thing, so merging.

@arokem arokem merged commit 1eefa2a into dipy:master Oct 12, 2023
24 of 25 checks passed
@skoudoro skoudoro deleted the fix-transform-pts-tutorial branch October 12, 2023 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants