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

Re-enabled file dialog wildcard, just accepting '*.gz' now.

parent a22fb99e
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,12 @@ NIFTI_XFORM_TALAIRACH = 3 ...@@ -42,7 +42,12 @@ NIFTI_XFORM_TALAIRACH = 3
NIFTI_XFORM_MNI_152 = 4 NIFTI_XFORM_MNI_152 = 4
ALLOWED_EXTENSIONS = ['.nii', '.img', '.hdr', '.nii.gz', '.img.gz'] # TODO The wx.FileDialog does not
# seem to handle wildcards with
# multiple suffixes (e.g. '.nii.gz'),
# so i'm just providing '*.gz'for now
ALLOWED_EXTENSIONS = ['.nii', '.img', '.hdr', '.gz']
"""The file extensions which we understand. This list is used as the default """The file extensions which we understand. This list is used as the default
if if the ``allowedExts`` parameter is not passed to any of the functions in if if the ``allowedExts`` parameter is not passed to any of the functions in
this module. this module.
...@@ -51,12 +56,11 @@ this module. ...@@ -51,12 +56,11 @@ this module.
EXTENSION_DESCRIPTIONS = ['NIFTI1 images', EXTENSION_DESCRIPTIONS = ['NIFTI1 images',
'ANALYZE75 images', 'ANALYZE75 images',
'NIFTI1/ANALYZE75 headers', 'NIFTI1/ANALYZE75 headers',
'Compressed NIFTI1 images', 'Compressed images']
'Compressed ANALYZE75/NIFTI1 images'] """Descriptions for each of the extensions in :data:`ALLOWED_EXTENSIONS`. """
"""Descriptions for each of the extensions in :data:`_allowedExts`. """
DEFAULT_EXTENSION = '.nii.gz' DEFAULT_EXTENSION = '.gz'
"""The default file extension (TODO read this from ``$FSLOUTPUTTYPE``).""" """The default file extension (TODO read this from ``$FSLOUTPUTTYPE``)."""
...@@ -78,7 +82,6 @@ def makeWildcard(allowedExts=None): ...@@ -78,7 +82,6 @@ def makeWildcard(allowedExts=None):
wcParts = ['|'.join((desc, ext)) for (desc, ext) in zip(descs, exts)] wcParts = ['|'.join((desc, ext)) for (desc, ext) in zip(descs, exts)]
print '|'.join(wcParts)
return '|'.join(wcParts) return '|'.join(wcParts)
...@@ -610,13 +613,11 @@ class ImageList(props.HasProperties): ...@@ -610,13 +613,11 @@ class ImageList(props.HasProperties):
fromDir = self._lastDir fromDir = self._lastDir
saveLastDir = True saveLastDir = True
# TODO wx wildcard handling is buggy, wildcard = makeWildcard()
# so i'm disabling it for now
# wildcard = wildcard()
dlg = wx.FileDialog(app.GetTopWindow(), dlg = wx.FileDialog(app.GetTopWindow(),
message='Open image file', message='Open image file',
defaultDir=fromDir, defaultDir=fromDir,
# wildcard=wildcard, wildcard=wildcard,
style=wx.FD_OPEN | wx.FD_MULTIPLE) style=wx.FD_OPEN | wx.FD_MULTIPLE)
if dlg.ShowModal() != wx.ID_OK: return False if dlg.ShowModal() != wx.ID_OK: return False
......
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