Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michiel Cottaar
fslpy
Commits
2065baa1
Commit
2065baa1
authored
10 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
A bit more fiddling with wildcards, but I'm pretty sure this is a WX issue
parent
343076e8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/data/image.py
+8
-6
8 additions, 6 deletions
fsl/data/image.py
with
8 additions
and
6 deletions
fsl/data/image.py
+
8
−
6
View file @
2065baa1
...
@@ -42,11 +42,10 @@ NIFTI_XFORM_TALAIRACH = 3
...
@@ -42,11 +42,10 @@ NIFTI_XFORM_TALAIRACH = 3
NIFTI_XFORM_MNI_152
=
4
NIFTI_XFORM_MNI_152
=
4
# TODO The wx.FileDialog does not
# TODO The wx.FileDialog does not
# seem to handle wildcards with
# seem to handle wildcards with
# multiple suffixes (e.g. '.nii.gz'),
# multiple suffixes (e.g. '.nii.gz'),
# so i'm just providing '*.gz'for now
# so i'm just providing '*.gz'for now
ALLOWED_EXTENSIONS
=
[
'
.nii
'
,
'
.img
'
,
'
.hdr
'
,
'
.gz
'
]
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
...
@@ -60,7 +59,7 @@ EXTENSION_DESCRIPTIONS = ['NIFTI1 images',
...
@@ -60,7 +59,7 @@ EXTENSION_DESCRIPTIONS = ['NIFTI1 images',
"""
Descriptions for each of the extensions in :data:`ALLOWED_EXTENSIONS`.
"""
"""
Descriptions for each of the extensions in :data:`ALLOWED_EXTENSIONS`.
"""
DEFAULT_EXTENSION
=
'
.gz
'
DEFAULT_EXTENSION
=
'
.
nii.
gz
'
"""
The default file extension (TODO read this from ``$FSLOUTPUTTYPE``).
"""
"""
The default file extension (TODO read this from ``$FSLOUTPUTTYPE``).
"""
...
@@ -80,7 +79,11 @@ def makeWildcard(allowedExts=None):
...
@@ -80,7 +79,11 @@ def makeWildcard(allowedExts=None):
exts
=
[
'
*{}
'
.
format
(
ext
)
for
ext
in
allowedExts
]
exts
=
[
'
*{}
'
.
format
(
ext
)
for
ext
in
allowedExts
]
allDesc
=
'
All supported files
'
allExts
=
'
;
'
.
join
(
exts
)
wcParts
=
[
'
|
'
.
join
((
desc
,
ext
))
for
(
desc
,
ext
)
in
zip
(
descs
,
exts
)]
wcParts
=
[
'
|
'
.
join
((
desc
,
ext
))
for
(
desc
,
ext
)
in
zip
(
descs
,
exts
)]
wcParts
=
[
'
|
'
.
join
((
allDesc
,
allExts
))]
+
wcParts
return
'
|
'
.
join
(
wcParts
)
return
'
|
'
.
join
(
wcParts
)
...
@@ -613,11 +616,10 @@ class ImageList(props.HasProperties):
...
@@ -613,11 +616,10 @@ class ImageList(props.HasProperties):
fromDir
=
self
.
_lastDir
fromDir
=
self
.
_lastDir
saveLastDir
=
True
saveLastDir
=
True
wildcard
=
makeWildcard
()
dlg
=
wx
.
FileDialog
(
app
.
GetTopWindow
(),
dlg
=
wx
.
FileDialog
(
app
.
GetTopWindow
(),
message
=
'
Open image file
'
,
message
=
'
Open image file
'
,
defaultDir
=
fromDir
,
defaultDir
=
fromDir
,
wildcard
=
w
ildcard
,
wildcard
=
makeW
ildcard
()
,
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment