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
Ghislain Antony Vaillant
nithumb
Commits
8c7cf9d3
Commit
8c7cf9d3
authored
Apr 25, 2017
by
Jonathan Passerat-Palmbach
Browse files
fix: handle 4D
parent
b2fe9465
Changes
1
Hide whitespace changes
Inline
Side-by-side
nithumb.py
View file @
8c7cf9d3
...
...
@@ -34,7 +34,8 @@ def main():
image
=
((
image
-
image
.
min
())
*
(
255
/
(
image
.
max
()
-
image
.
min
()))).
astype
(
'uint8'
)
# Select the centre slice if 3D.
# Select the centre slice if 3D. Centre frame if 4D
image
=
image
[:,
:,
:,
image
.
shape
[
3
]
//
2
]
if
image
.
ndim
==
4
else
image
image
=
image
[:,
:,
image
.
shape
[
2
]
//
2
]
if
image
.
ndim
==
3
else
image
# Generate and save the snapshot and its thumbnail.
...
...
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