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.utils #1939
Merged
Merged
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a700df9
First pass of deleting/fixing affine usage
frheault c4e523d
Fixing all broken function for density, connectivity and seeding
frheault aec04cc
Fix second half of dependacy from utils
frheault 1046084
Added back move_streamlines under a new name for precision
frheault 7761d5c
First testing phase (test/examples)
frheault f8b6257
Merge branch 'update_file_format_example' of https://github.com/frhea…
frheault 4c807b3
Merge with updated examples
frheault 6fd641a
Flake8 on everything changed
frheault 2b8dc6d
Fixed invalid reference in tracking workflow
frheault b23f155
Merge branch 'master' of https://github.com/nipy/dipy into increase_a…
frheault 2706051
Updated the api_changes
frheault 1ebc15f
Correct typo in docstring, fix example in seeds_from_masks
frheault 639d922
Reduce line length
frheault 80c00ec
Added back unsused variable in test, apparently necessary
frheault 6f846fb
Fixed doctest error
frheault 7ca62f5
Remove cast for transform_streamlines
frheault bc38dd1
Rebased after PR #1925
frheault File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,10 @@ | |
|
||
from dipy.testing import assert_true | ||
from numpy.testing import (assert_array_equal, assert_array_almost_equal, | ||
assert_raises, run_module_suite, assert_allclose, | ||
assert_raises, assert_allclose, | ||
assert_almost_equal, assert_equal) | ||
|
||
from dipy.tracking.streamline import Streamlines | ||
import dipy.tracking.utils as ut | ||
from dipy.tracking.streamline import (set_number_of_points, | ||
length, | ||
relist_streamlines, | ||
|
@@ -1110,15 +1109,15 @@ def test_values_from_volume(): | |
|
||
affine = np.eye(4) | ||
affine[:, 3] = [-100, 10, 1, 1] | ||
x_sl1 = ut.move_streamlines(sl1, affine) | ||
x_sl2 = ut.move_streamlines(sl1, affine) | ||
x_sl1 = transform_streamlines(sl1, affine) | ||
x_sl2 = transform_streamlines(sl1, affine) | ||
|
||
vv = values_from_volume(data, x_sl1, affine=affine) | ||
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)) | ||
x_sl1 = list(transform_streamlines(sl1, affine)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is already returning a list |
||
vv = values_from_volume(data, x_sl1, affine=affine) | ||
npt.assert_almost_equal(vv, ans1, decimal=decimal) | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this function? Why not
transform_streamlines
fromdipy.tracking.streamlines
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My reasoning was that transform_streamlines should do one thing and one thing only, to stay as simple as possible.
This function takes a generator as a input that can be a tuple or not, and in 99% of the case where people want to transform_streamlines it is just that.
This function with the generator, the tuple and the saving_seeds option is used only once in all dipy and is specifically for the tracking.
I think merging the two function would add to the confusion. And complexify a function that should remain as simple as simple (transform_streamlines)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, make sense!