Skip to content

Instantly share code, notes, and snippets.

View dedmari's full-sized avatar

Muneer Ahmad Dedmari dedmari

View GitHub Profile
@dedmari
dedmari / jpeg2000_compression.py
Created June 28, 2018 16:15
JPEG200_MRI_Compression
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
@dedmari
dedmari / gist:63ff495bff7472b4ded9e5b7da9de8c1
Created May 20, 2017 11:52
Extracting Frames from Videos
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")