This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import h5py | |
import glymur | |
def image_space_save_as_jpg2000(in_dir, out_dir): | |
""" | |
:param file_name: image_space file name for compression i.e. 58 x 640 x 129 x 240; 58 coils, oversampled x-axis by factor 2, | |
zero value removed y axis, z are number of slices | |
:param out_dir: output dir for storing imaginary and real parts of image space |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pylab | |
import imageio | |
import Image | |
filename = './train01.mp4' | |
vid = imageio.get_reader(filename, 'ffmpeg') | |
for i, image in enumerate(vid): | |
numstr = str(i) | |
im = Image.fromarray(image) | |
im.save("train01_"+numstr+".jpeg") | |