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

MRG: refactor for current and future nibabel #307

Merged
merged 6 commits into from Apr 29, 2014

Conversation

matthew-brett
Copy link
Member

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.

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.
@bthirion
Copy link
Contributor

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():
Copy link
Member Author

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?

@matthew-brett
Copy link
Member Author

Michael - OK to merge this one?

@matthew-brett
Copy link
Member Author

Any comments here? I propose to merge in the next few days otherwise.

@matthew-brett
Copy link
Member Author

Last call for comments

matthew-brett added a commit that referenced this pull request Apr 29, 2014
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.
@matthew-brett matthew-brett merged commit 741b5d2 into nipy:master Apr 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants