Commit 836ea750 authored by Ghislain Antony Vaillant's avatar Ghislain Antony Vaillant
Browse files

Use centre slice in the 3D case

parent cf76522f
# Author: Ghislain Antony Vaillant <>
from __future__ import division
from argparse import ArgumentParser
from nibabel import load
from PIL import Image
......@@ -11,6 +13,7 @@ parser.add_argument('thumbnail', help='Output thumbnail')
parsed = parser.parse_args()
image = load(parsed.inputfile).get_data()
image = Image.fromarray(image[:, :, 0] if image.ndim == 3 else image)
image = Image.fromarray(image[:, :, image.shape[2]//2] if image.ndim == 3
else image)
image = image.resize([128, 128])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment