Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Evan Edmond
fslpy
Commits
1c4fc778
Commit
1c4fc778
authored
Nov 11, 2016
by
Paul McCarthy
Browse files
Suppress numpy warnings about float shape
parent
6df6aac7
Changes
1
Hide whitespace changes
Inline
Side-by-side
fsl/utils/layout.py
View file @
1c4fc778
...
...
@@ -197,8 +197,8 @@ def padBitmap(bitmap, width, height, vert, bgColour):
if
vert
:
if
iwidth
<
width
:
lpad
=
np
.
floor
((
width
-
iwidth
)
/
2.0
)
rpad
=
np
.
ceil
(
(
width
-
iwidth
)
/
2.0
)
lpad
=
int
(
np
.
floor
((
width
-
iwidth
)
/
2.0
)
)
rpad
=
int
(
np
.
ceil
(
(
width
-
iwidth
)
/
2.0
)
)
lpad
=
np
.
zeros
((
iheight
,
lpad
,
4
),
dtype
=
np
.
uint8
)
rpad
=
np
.
zeros
((
iheight
,
rpad
,
4
),
dtype
=
np
.
uint8
)
lpad
[:]
=
bgColour
...
...
@@ -206,8 +206,8 @@ def padBitmap(bitmap, width, height, vert, bgColour):
bitmap
=
np
.
hstack
((
lpad
,
bitmap
,
rpad
))
else
:
if
iheight
<
height
:
tpad
=
np
.
floor
((
height
-
iheight
)
/
2.0
)
bpad
=
np
.
ceil
((
height
-
iheight
)
/
2.0
)
tpad
=
int
(
np
.
floor
((
height
-
iheight
)
/
2.0
)
)
bpad
=
int
(
np
.
ceil
((
height
-
iheight
)
/
2.0
)
)
tpad
=
np
.
zeros
((
tpad
,
iwidth
,
4
),
dtype
=
np
.
uint8
)
bpad
=
np
.
zeros
((
bpad
,
iwidth
,
4
),
dtype
=
np
.
uint8
)
tpad
[:]
=
bgColour
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment