-
Notifications
You must be signed in to change notification settings - Fork 262
FIX: Copy affine_to_rasmm when slicing a Tractogram object #462
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
Conversation
@@ -373,6 +374,13 @@ def test_tractogram_getitem(self): | |||
DATA['tractogram'].data_per_streamline[::-1], | |||
DATA['tractogram'].data_per_point[::-1]) | |||
|
|||
# Make sure slicing conserve the affine_to_rasmm property. |
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.
Typo conserves
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.
Done
Other than tiny typo, looks good, thanks. |
Current coverage is 94.11%@@ master #462 diff @@
==========================================
Files 160 160
Lines 21164 21169 +5
Methods 0 0
Messages 0 0
Branches 2265 2265
==========================================
+ Hits 19919 19924 +5
Misses 823 823
Partials 422 422
|
@@ -18,6 +18,7 @@ | |||
|
|||
def setup(): | |||
global DATA | |||
DATA['rng'] = np.random.RandomState(1234) |
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.
Is there a reason you're seeding with a constant?
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.
Unless nosetest sets the seed of np.random I prefer having reproducible tests. In practice, it should work with any seed, so there is no reason really. We also use a seed in test_array_sequence.py
.
Anything else @effigies ? |
Oh, yeah. Sorry. LGTM. |
Thanks everyone for the input - merging. |
This PR simply makes sure to set the
affine_to_rasmm
when creating a newTractogram
object that is the result of advanced indexing or slicing. It also adds a test to check it is working properly.