Skip to content
Snippets Groups Projects
Commit 852f6a98 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Bugfix - images within melodic/FEAT directories, specified on command

line, without file suffix, were not being recognised.
parent 4e9191be
No related branches found
No related tags found
No related merge requests found
......@@ -202,28 +202,22 @@ def guessDataSourceType(path):
if path.endswith('.vtk'):
return fslmodel.Model, path
# Analysis directory?
if op.isdir(path):
if melresults.isMelodicDir(path):
return fslmelimage.MelodicImage, path
if featresults.isFEATDir(path):
elif featresults.isFEATDir(path):
return fslfeatimage.FEATImage, path
elif melresults.isMelodicImage(path):
return fslmelimage.MelodicImage, path
elif featresults.isFEATImage(path):
return fslfeatimage.FEATImage, path
# A regular NIFTI image?
try:
path = fslimage.addExt(path, mustExist=True)
return fslimage.Image, path
except ValueError:
pass
# Assume it's a NIFTI image
try: path = fslimage.addExt(path, mustExist=True)
except ValueError: return None, path
if melresults.isMelodicImage(path): return fslmelimage.MelodicImage, path
elif featresults.isFEATImage( path): return fslfeatimage.FEATImage, path
else: return fslimage.Image, path
# Otherwise, I don't
# know what to do
return None, path
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment