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

Increase affine consistency in dipy.tracking.streamlines #1940

Merged
merged 9 commits into from Aug 1, 2019

Conversation

@frheault
Copy link
Contributor

commented Jul 30, 2019

To increase consistency within Dipy and increase cautious behaviors when coding the affine is now required when it was previously optional.
Older/unused functions that had complex behavior related to spatial transform and trackvis file format were deleted to prevent confusion.
Docstring is now uniform when describing the affine.

Tests were executed and examples tested.

@skoudoro skoudoro added this to the 1.0 milestone Jul 30, 2019

@skoudoro
Copy link
Member

left a comment

Thank you for this @frheault! Just a couple of comment to fix and it will be ready to go for today!

@@ -688,7 +683,7 @@ def values_from_volume(data, streamlines, affine=None):
affine : ndarray, shape (4, 4)
Affine transformation from voxels (image coordinates) to streamlines.
Default: identity. For example, if no affine is provided and the first
For example, if no affine is provided and the first

This comment has been minimized.

Copy link
@skoudoro

skoudoro Jul 31, 2019

Member

if no affine is provided I think this docstring is irrelevant. affine parameter is mandatory so it is impossible to have no affine now

npt.assert_almost_equal(vv, ans1, decimal=decimal)

# The generator has already been consumed so needs to be
# regenerated:
x_sl1 = list(ut.move_streamlines(sl1, affine))
vv = values_from_volume(data, x_sl1, affine=affine)
x_sl1 = list(transform_streamlines(sl1, affine))

This comment has been minimized.

Copy link
@skoudoro

skoudoro Jul 31, 2019

Member

Can you remove the list? transform_streamlines returns already a list.

@skoudoro

This comment has been minimized.

Copy link
Member

commented Jul 31, 2019

Can you address my comment and rebase this one too @frheault? Thank you!

@codecov

This comment has been minimized.

Copy link

commented Jul 31, 2019

Codecov Report

❗️ No coverage uploaded for pull request base (master@64641b2). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1940   +/-   ##
=========================================
  Coverage          ?   84.54%           
=========================================
  Files             ?      119           
  Lines             ?    14705           
  Branches          ?     2329           
=========================================
  Hits              ?    12432           
  Misses            ?     1727           
  Partials          ?      546
Impacted Files Coverage Δ
dipy/segment/bundles.py 91.37% <ø> (ø)
dipy/tracking/streamline.py 92.3% <100%> (ø)
dipy/stats/analysis.py 75.34% <100%> (ø)
frheault and others added 2 commits Jul 31, 2019
@skoudoro

This comment has been minimized.

Copy link
Member

commented Aug 1, 2019

Thanks @frheault ! Merging

@skoudoro skoudoro merged commit 01c8d72 into nipy:master Aug 1, 2019

2 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
Codacy/PR Quality Review Up to standards. A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.