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: add PARREC to top level load #265

Merged
merged 6 commits into from
Nov 4, 2014

Conversation

matthew-brett
Copy link
Member

Add ability to load PAR / REC file from top-level nibabel.load.

On the way, make load function allow upper case compressed extensions, and
refactor image class generic testing to allow case where it is difficult to
create image class in memory.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) when pulling 24bb052 on matthew-brett:parrec-top-level into 3ef40cb on nipy:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) when pulling 50ab6f8 on matthew-brett:parrec-top-level into 3ef40cb on nipy:master.

Make `Opener` class ignore case when looking for compressed extensions
such as '.gz' or '.bz2', by default.
Add docstring for filespec_to_file_map class method.
Allow image filenames to be mixed case including compressed extensions
like '.gz' and '.bz2'.
Some images (particularly, PARREC), cannot be easily constructed in
memory, because their headers are rather complicated to construct.

Allow skipping tests that need to construct in-memory images.
Allow PAR/REC files to be loaded from top-level `nibabel.load` function.
@@ -48,10 +48,12 @@ class Opener(object):
compress_ext_map = {
'.gz': gz_def,
'.bz2': bz2_def,
None: (open, ('mode', 'buffering'))
None: (open, ('mode', 'buffering')) # default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to move toward PEP8 (do you?), there should be two spaces before an inline comment

@larsoner
Copy link
Contributor

larsoner commented Nov 3, 2014

LGTM, being able to use nib.load will be nice.

From comment by Eric Larson
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) when pulling 606dc50 on matthew-brett:parrec-top-level into 3ef40cb on nipy:master.

@larsoner
Copy link
Contributor

larsoner commented Nov 4, 2014

Much nicer :)

matthew-brett added a commit that referenced this pull request Nov 4, 2014
MRG: add PARREC to top level load

Add ability to load PAR / REC file from top-level nibabel.load.

On the way, make load function allow upper case compressed extensions, and
refactor image class generic testing to allow case where it is difficult to
create image class in memory.
@matthew-brett matthew-brett merged commit 2c6b8bb into nipy:master Nov 4, 2014
@matthew-brett
Copy link
Member Author

:)

grlee77 pushed a commit to grlee77/nibabel that referenced this pull request Mar 15, 2016
MRG: add PARREC to top level load

Add ability to load PAR / REC file from top-level nibabel.load.

On the way, make load function allow upper case compressed extensions, and
refactor image class generic testing to allow case where it is difficult to
create image class in memory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants