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

Add ecat to the list of known imageclasses to ease loading with .load() #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions nibabel/imageclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from .minc import MincImage
from .freesurfer import MGHImage
from .volumeutils import Recoder
from .ecat import EcatImage

# If we don't have scipy, then we cannot write SPM format files
try:
Expand Down Expand Up @@ -52,11 +53,16 @@
'mgh':{'class': MGHImage,
'ext': '.mgh',
'has_affine': True,
'rw':True},
'rw': True},
'mgz':{'class': MGHImage,
'ext': '.mgz',
'has_affine': True,
'rw':True}}
'rw': True},
'ecat':{'class': EcatImage,
'ext': '.v',
'has_affine': True,
'rw': False},
}



Expand All @@ -66,4 +72,6 @@
('nifti_pair', '.img', '.hdr'),
('minc', '.mnc'),
('mgh', '.mgh'),
('mgz', '.mgz')))
('mgz', '.mgz'),
('ecat', '.v'),
))
2 changes: 1 addition & 1 deletion nibabel/loadsave.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def load(filename):
except KeyError:
raise ImageFileError('Cannot work out file type of "%s"' %
filename)
if ext in ('.nii', '.mnc', '.mgh', '.mgz'):
if ext in ('.nii', '.mnc', '.mgh', '.mgz', '.v'):
klass = class_map[img_type]['class']
else:
# might be nifti pair or analyze of some sort
Expand Down