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
097dff7d
Commit
097dff7d
authored
10 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Atlas functions return None if ATLAS_DIR is not
available. ImageSelectPanel works if image list is empty
parent
0f75a4e6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/data/atlases.py
+8
-0
8 additions, 0 deletions
fsl/data/atlases.py
fsl/fslview/controls/imageselectpanel.py
+5
-3
5 additions, 3 deletions
fsl/fslview/controls/imageselectpanel.py
with
13 additions
and
3 deletions
fsl/data/atlases.py
+
8
−
0
View file @
097dff7d
...
@@ -84,6 +84,8 @@ def listAtlases(refresh=False):
...
@@ -84,6 +84,8 @@ def listAtlases(refresh=False):
:attr:`ATLAS_DESCRIPTIONS`).
:attr:`ATLAS_DESCRIPTIONS`).
"""
"""
if
ATLAS_DIR
is
None
:
return
[]
if
len
(
ATLAS_DESCRIPTIONS
)
==
0
:
if
len
(
ATLAS_DESCRIPTIONS
)
==
0
:
refresh
=
True
refresh
=
True
...
@@ -109,6 +111,9 @@ def getAtlasDescription(atlasID):
...
@@ -109,6 +111,9 @@ def getAtlasDescription(atlasID):
"""
Returns an :class:`AtlasDescription` instance describing the
"""
Returns an :class:`AtlasDescription` instance describing the
atlas with the given ``atlasID``.
atlas with the given ``atlasID``.
"""
"""
if
ATLAS_DIR
is
None
:
return
None
if
len
(
ATLAS_DESCRIPTIONS
)
==
0
:
if
len
(
ATLAS_DESCRIPTIONS
)
==
0
:
listAtlases
()
listAtlases
()
...
@@ -124,6 +129,9 @@ def loadAtlas(atlasID, loadSummary=False):
...
@@ -124,6 +129,9 @@ def loadAtlas(atlasID, loadSummary=False):
loaded. Otherwise, if the atlas is probabilistic,
loaded. Otherwise, if the atlas is probabilistic,
a 4D :class:`ProbabilisticAtlas` image is loaded.
a 4D :class:`ProbabilisticAtlas` image is loaded.
"""
"""
if
ATLAS_DIR
is
None
:
return
None
if
len
(
ATLAS_DESCRIPTIONS
)
==
0
:
if
len
(
ATLAS_DESCRIPTIONS
)
==
0
:
listAtlases
()
listAtlases
()
...
...
This diff is collapsed.
Click to expand it.
fsl/fslview/controls/imageselectpanel.py
+
5
−
3
View file @
097dff7d
...
@@ -163,11 +163,13 @@ class ImageSelectPanel(fslpanel.FSLViewPanel):
...
@@ -163,11 +163,13 @@ class ImageSelectPanel(fslpanel.FSLViewPanel):
allImages
=
self
.
_displayCtx
.
getOrderedImages
()
allImages
=
self
.
_displayCtx
.
getOrderedImages
()
image
=
self
.
_displayCtx
.
getSelectedImage
()
image
=
self
.
_displayCtx
.
getSelectedImage
()
idx
=
allImages
.
index
(
image
)
nimgs
=
len
(
allImages
)
nimgs
=
len
(
allImages
)
if
nimgs
>
0
:
idx
=
allImages
.
index
(
image
)
else
:
idx
=
-
1
self
.
_prevButton
.
Enable
(
nimgs
>
0
and
idx
!=
0
)
self
.
_prevButton
.
Enable
(
nimgs
>
0
and
idx
>
0
)
self
.
_nextButton
.
Enable
(
nimgs
>
0
and
idx
!=
nimgs
-
1
)
self
.
_nextButton
.
Enable
(
nimgs
>
0
and
idx
<
nimgs
-
1
)
if
self
.
_imageLabel
is
None
:
if
self
.
_imageLabel
is
None
:
return
return
...
...
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