fix: handle 4D

parent b2fe9465
......@@ -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.
......
Markdown is supported
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