Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD 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
FSL
fslpy
Commits
ea2b88af
Commit
ea2b88af
authored
10 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix to Number widgets. WxPython is annoying.
parent
948cec17
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/props/widgets.py
+11
-6
11 additions, 6 deletions
fsl/props/widgets.py
fsl/tools/bet.py
+3
-3
3 additions, 3 deletions
fsl/tools/bet.py
with
14 additions
and
9 deletions
fsl/props/widgets.py
+
11
−
6
View file @
ea2b88af
...
@@ -290,12 +290,17 @@ def _Number(parent, hasProps, propObj, propVal):
...
@@ -290,12 +290,17 @@ def _Number(parent, hasProps, propObj, propVal):
maxval
=
propObj
.
maxval
maxval
=
propObj
.
maxval
makeSlider
=
(
minval
is
not
None
)
and
(
maxval
is
not
None
)
makeSlider
=
(
minval
is
not
None
)
and
(
maxval
is
not
None
)
params
=
{}
if
isinstance
(
propObj
,
props
.
Int
):
if
isinstance
(
propObj
,
props
.
Int
):
SpinCtr
=
wx
.
SpinCtrl
SpinCtr
=
wx
.
SpinCtrl
if
minval
is
None
:
minval
=
-
sys
.
maxint
if
maxval
is
None
:
maxval
=
sys
.
maxint
# wx.SpinCtrl complains heartily if
increment
=
1
# we pass values greater than signed 32 bit
if
minval
is
None
:
minval
=
-
2
**
31
+
1
if
maxval
is
None
:
maxval
=
2
**
31
-
1
value
=
int
(
value
)
elif
isinstance
(
propObj
,
props
.
Double
):
elif
isinstance
(
propObj
,
props
.
Double
):
...
@@ -304,14 +309,14 @@ def _Number(parent, hasProps, propObj, propVal):
...
@@ -304,14 +309,14 @@ def _Number(parent, hasProps, propObj, propVal):
if
maxval
is
None
:
maxval
=
sys
.
float_info
.
max
if
maxval
is
None
:
maxval
=
sys
.
float_info
.
max
if
makeSlider
:
increment
=
(
maxval
-
minval
)
/
20.0
if
makeSlider
:
increment
=
(
maxval
-
minval
)
/
20.0
else
:
increment
=
0.5
else
:
increment
=
0.5
params
[
'
inc
'
]
=
increment
else
:
else
:
raise
TypeError
(
'
Unrecognised property type: {}
'
.
format
(
raise
TypeError
(
'
Unrecognised property type: {}
'
.
format
(
propObj
.
__class__
.
__name__
))
propObj
.
__class__
.
__name__
))
params
=
{}
params
[
'
inc
'
]
=
increment
params
[
'
min
'
]
=
minval
params
[
'
min
'
]
=
minval
params
[
'
max
'
]
=
maxval
params
[
'
max
'
]
=
maxval
params
[
'
initial
'
]
=
value
params
[
'
initial
'
]
=
value
...
...
This diff is collapsed.
Click to expand it.
fsl/tools/bet.py
+
3
−
3
View file @
ea2b88af
...
@@ -57,9 +57,9 @@ class Options(props.HasProperties):
...
@@ -57,9 +57,9 @@ class Options(props.HasProperties):
fractionalIntensity
=
props
.
Double
(
default
=
0.5
,
minval
=
0.0
,
maxval
=
1.0
)
fractionalIntensity
=
props
.
Double
(
default
=
0.5
,
minval
=
0.0
,
maxval
=
1.0
)
thresholdGradient
=
props
.
Double
(
default
=
0.0
,
minval
=-
1.0
,
maxval
=
1.0
)
thresholdGradient
=
props
.
Double
(
default
=
0.0
,
minval
=-
1.0
,
maxval
=
1.0
)
headRadius
=
props
.
Double
(
default
=
0.0
,
minval
=
0.0
)
headRadius
=
props
.
Double
(
default
=
0.0
,
minval
=
0.0
)
xCoordinate
=
props
.
Double
(
default
=
0
.0
,
minval
=
0
.0
)
xCoordinate
=
props
.
Int
(
default
=
0
,
minval
=
0
)
yCoordinate
=
props
.
Double
(
default
=
0
.0
,
minval
=
0
.0
)
yCoordinate
=
props
.
Int
(
default
=
0
,
minval
=
0
)
zCoordinate
=
props
.
Double
(
default
=
0
.0
,
minval
=
0
.0
)
zCoordinate
=
props
.
Int
(
default
=
0
,
minval
=
0
)
def
setOutputImage
(
self
,
value
,
valid
,
*
a
):
def
setOutputImage
(
self
,
value
,
valid
,
*
a
):
...
...
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