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
de42b790
Commit
de42b790
authored
10 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Changes to props package listener function signatures; a useful little
trace utility for debugging
parent
2746aa43
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/tools/bet.py
+2
-2
2 additions, 2 deletions
fsl/tools/bet.py
fsl/utils/trace.py
+31
-0
31 additions, 0 deletions
fsl/utils/trace.py
with
33 additions
and
2 deletions
fsl/tools/bet.py
+
2
−
2
View file @
de42b790
...
@@ -59,7 +59,7 @@ class Options(props.HasProperties):
...
@@ -59,7 +59,7 @@ class Options(props.HasProperties):
zCoordinate
=
props
.
Int
(
default
=
0
,
minval
=
0
)
zCoordinate
=
props
.
Int
(
default
=
0
,
minval
=
0
)
def
setOutputImage
(
self
,
value
,
valid
,
ctx
):
def
setOutputImage
(
self
,
value
,
valid
,
*
a
):
"""
"""
When a (valid) input image file name is selected, the output
When a (valid) input image file name is selected, the output
image is set to the same name, with a suffix of
'
_brain
'
.
image is set to the same name, with a suffix of
'
_brain
'
.
...
@@ -70,7 +70,7 @@ class Options(props.HasProperties):
...
@@ -70,7 +70,7 @@ class Options(props.HasProperties):
self
.
outputImage
=
value
+
'
_brain
'
self
.
outputImage
=
value
+
'
_brain
'
def
clearT2Image
(
self
,
value
,
valid
,
ctx
):
def
clearT2Image
(
self
,
value
,
*
a
):
"""
"""
This is a bit of a hack. If the user provides an invalid value
This is a bit of a hack. If the user provides an invalid value
for the T2 image (when running bet with the -A2 flag), but then
for the T2 image (when running bet with the -A2 flag), but then
...
...
This diff is collapsed.
Click to expand it.
fsl/utils/trace.py
0 → 100644
+
31
−
0
View file @
de42b790
#!/usr/bin/env python
#
# trace.py -
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
import
logging
import
inspect
log
=
logging
.
getLogger
(
__name__
)
def
trace
(
desc
):
stack
=
inspect
.
stack
()[
1
:]
lines
=
'
{}
\n
'
.
format
(
desc
)
for
i
,
frame
in
enumerate
(
stack
):
srcMod
=
frame
[
1
]
srcLineNo
=
frame
[
2
]
if
frame
[
4
]
is
not
None
:
srcLine
=
frame
[
4
][
frame
[
5
]]
else
:
srcLine
=
'
<native>
'
lines
=
lines
+
'
{}{}:{}: {}
\n
'
.
format
(
'
'
*
(
i
+
1
),
srcMod
,
srcLineNo
,
srcLine
.
strip
())
log
.
debug
(
lines
)
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