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
343076e8
Commit
343076e8
authored
10 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Re-enabled file dialog wildcard, just accepting '*.gz' now.
parent
a22fb99e
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
+11
-10
11 additions, 10 deletions
fsl/data/image.py
with
11 additions
and
10 deletions
fsl/data/image.py
+
11
−
10
View file @
343076e8
...
@@ -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
...
...
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