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
aca36375
Commit
aca36375
authored
7 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Cosmetics in image module.
parent
2a275018
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
+29
-30
29 additions, 30 deletions
fsl/data/image.py
with
29 additions
and
30 deletions
fsl/data/image.py
+
29
−
30
View file @
aca36375
...
...
@@ -36,7 +36,6 @@ import os
import
os.path
as
op
import
string
import
logging
import
collections
import
six
import
deprecation
...
...
@@ -58,6 +57,35 @@ import fsl.data.imagewrapper as imagewrapper
log
=
logging
.
getLogger
(
__name__
)
ALLOWED_EXTENSIONS
=
[
'
.nii.gz
'
,
'
.nii
'
,
'
.img
'
,
'
.hdr
'
,
'
.img.gz
'
,
'
.hdr.gz
'
]
"""
The file extensions which we understand. This list is used as the default
if the ``allowedExts`` parameter is not passed to any of the functions
below.
"""
EXTENSION_DESCRIPTIONS
=
[
'
Compressed NIFTI images
'
,
'
NIFTI images
'
,
'
ANALYZE75 images
'
,
'
NIFTI/ANALYZE75 headers
'
,
'
Compressed NIFTI/ANALYZE75 images
'
,
'
Compressed NIFTI/ANALYZE75 headers
'
]
"""
Descriptions for each of the extensions in :data:`ALLOWED_EXTENSIONS`.
"""
FILE_GROUPS
=
[(
'
.hdr
'
,
'
.img
'
),
(
'
.hdr.gz
'
,
'
.img.gz
'
)]
"""
File suffix groups used by :func:`addExt` to resolve file path
ambiguities - see :func:`fsl.utils.path.addExt`.
"""
PathError
=
fslpath
.
PathError
"""
Error raised by :mod:`fsl.utils.path` functions when an error occurs.
Made available in this module for convenience.
"""
class
Nifti
(
notifier
.
Notifier
,
meta
.
Meta
):
"""
The ``Nifti`` class is intended to be used as a base class for
things which either are, or are associated with, a NIFTI image.
...
...
@@ -1290,35 +1318,6 @@ class Image(Nifti):
self
.
notify
(
topic
=
'
dataRange
'
)
ALLOWED_EXTENSIONS
=
[
'
.nii.gz
'
,
'
.nii
'
,
'
.img
'
,
'
.hdr
'
,
'
.img.gz
'
,
'
.hdr.gz
'
]
"""
The file extensions which we understand. This list is used as the default
if the ``allowedExts`` parameter is not passed to any of the functions
below.
"""
EXTENSION_DESCRIPTIONS
=
[
'
Compressed NIFTI images
'
,
'
NIFTI images
'
,
'
ANALYZE75 images
'
,
'
NIFTI/ANALYZE75 headers
'
,
'
Compressed NIFTI/ANALYZE75 images
'
,
'
Compressed NIFTI/ANALYZE75 headers
'
]
"""
Descriptions for each of the extensions in :data:`ALLOWED_EXTENSIONS`.
"""
FILE_GROUPS
=
[(
'
.hdr
'
,
'
.img
'
),
(
'
.hdr.gz
'
,
'
.img.gz
'
)]
"""
File suffix groups used by :func:`addExt` to resolve file path
ambiguities - see :func:`fsl.utils.path.addExt`.
"""
PathError
=
fslpath
.
PathError
"""
Error raised by :mod:`fsl.utils.path` functions when an error occurs.
Made available in this module for convenience.
"""
def
looksLikeImage
(
filename
,
allowedExts
=
None
):
"""
Returns ``True`` if the given file looks like a NIFTI image, ``False``
otherwise.
...
...
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