-
Notifications
You must be signed in to change notification settings - Fork 533
FIX: The GradientTable object should be immutable; the bvalues aren't #1484
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
being passed into the object correctly, so I changed the function used to create the GradientTable object
I was using this with a .bvecs and .bvals format input to the GradientTable object, and the units were off by quite a bit when I fit the tensor. It turns out, the bvalues weren't being used by the GradientTable object because they were being set as an attribute after the object was created. They should be input using one of the factory functions to ensure that they are handled correctly. |
One question @arokem: is that possible that older versions of dipy only implement the If I'm not wrong, I implemented it that way because Once confirmed, may I ask you @kesshijordan to go back to a try ... except structure, but using the recommended
|
This has been in place since version 0.6 (2012): On Wed, May 25, 2016 at 9:05 PM, Oscar Esteban notifications@github.com
|
The way that is written, the bvals you are setting will not be reflected by the GradientTable object, and everything will by off by a factor of the bvalue. We could put just the vectors in, and let the user combine their bvals&bvecs in the except case (@MrBago, perhaps you could comment?) |
Well, looking at the old code: dipy/dipy@1714e7c#diff-3d2aafe93b8f41be9cf3521aa9d5d194L5, maybe this would do:
Don't you think? |
@oesteban GradientTable and gradient_table were added in the same release, the older version you're looking at was a WIP that was never made public. I just checked and dipy 0.5.0 does not have a The issue may have been because GradientTable is being imported from Just for context, the helper functions do a bunch of checking for errors and corner cases then call |
@MrBago thanks for the details :). What do you think we should implement for nipype? Should we get rid of the try ... catch, and go use |
I'm not sure about the try catch, why is it catching a NameError? |
I included it because I was having that exception in earlier versions of dipy. It should be an EDIT: I mean, maybe the try catch is not necessary at all. |
In that case I don't think you need the try catch. On Thu, May 26, 2016, 12:08 PM Oscar Esteban notifications@github.com
|
I think that what @MrBago means is that since the code proposed here imports from the right place (from |
being passed into the object correctly, so I changed the function used
to create the GradientTable object