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
MRG: refactor for current and future nibabel #307
MRG: refactor for current and future nibabel #307
Conversation
Deal with change in nibabel API for getting data object, header and affine.
This allow us to get the unscaled data from an image avoiding the rather awful read_img_data function that I want to deprecate.
The test generator makes it more difficult to debug; remove.
I was using the header slope to calculate expected error. The current version of nibabel doesn't return the read slope from `get_slope_inter` as I was assuming here. Directly read the written header to get the slope.
mask computation preferred unscaled data, but the routine in nibabel was broken from recent commits I had done on nibabel, and in any case was not well designed. Use a compatibility routine to use the new method in nibabel if available.
Use nibabel compatibility routines for getting affines and headers from nibabel images. This avoids running into future warnings when we deprecate the get_affine, get_header methods.
Hi matthew, Thanks for taking care of this. When using nibabel master, this triggers a couple of failures on my box, related to mask computation. this works fine with nibabel 1.3.0. |
assert_equal(get_dataobj(img), 3) | ||
|
||
|
||
def test_unscaled_data(): |
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.
Michael - did you see this test?
Michael - OK to merge this one? |
Any comments here? I propose to merge in the next few days otherwise. |
Last call for comments |
MRG: refactor for current and future nibabel Nipy was breaking against the current nibabel master because of some changes in the way that nibabel keeps headers in memory. New nibabel has attributes for affine, header, dataobj that old nibabel didn't. At least for affine and header, the old methods get_affine, get_header will stay without warning for a while, but get ready for the time when those warnings will start by using a compatibility wrapper around nibabel to fetch this stuff.
Nipy was breaking against the current nibabel master because of some
changes in the way that nibabel keeps headers in memory.
New nibabel has attributes for
affine
,header
,dataobj
that oldnibabel didn't. At least for
affine
andheader
, the old methodsget_affine
,get_header
will stay without warning for a while, butget ready for the time when those warnings will start by using a
compatibility wrapper around nibabel to fetch this stuff.