m=XMovie(filename, frameRate=frameRate); #%% example plot a frame plt.imshow(m.mov[100],cmap=plt.cm.Greys_r) #%% example play movie m.playMovie(frate=.03,gain=20.0,magnification=4) #%% example take first channel of two channelId=1; totalChannels=2; m.makeSubMov(range(channelId-1,m.mov.shape[0],totalChannels)) #%% prtition into two movies up and down m.crop(crop_top=150,crop_bottom=150,crop_left=150,crop_right=150,crop_begin=0,crop_end=0) #%% concatenate movies (it will add to the original movie) # you have to create another movie new_mov=XMovie(...) m.append(new_mov) #%% motion correct run 3 times # WHEN YOU RUN motion_correct YOUR ARE MODIFYING THE OBJECT!!!! templates=[]; shifts=[]; max_shift=5; num_iter=10; # numer of times motion correction is executed template=None # here you can use your own template (best representation of the FOV)
m.playMovie(frate=.001,gain=10.0,magnification=1) #%% example take first channel of two channelId=1; totalChannels=2; m.makeSubMov(range(channelId-1,m.mov.shape[0],totalChannels)) #%% np.savez(filename_py,mov=m.mov,frameRate=frameRate) #%% f = h5py.File(filename_hdf5, "w") dset = f.create_dataset("mov",data=m.mov) dset = f.create_dataset("frameRate",data=frameRate) a=np.asarray(f['mov']) # or directly use f['mov'] #%% m=XMovie(mat=np.load(filename_py)['mov'], frameRate=np.load(filename_py)['frameRate']); m.crop(crop_top=0,crop_bottom=1,crop_left=0,crop_right=0,crop_begin=0,crop_end=0) #%% prtition into two movies up and down m.makeSubMov(range(1000)) #m.crop(crop_top=150,crop_bottom=150,crop_left=150,crop_right=150,crop_begin=0,crop_end=0) #%% concatenate movies (it will add to the original movie) # you have to create another movie new_mov=XMovie(...) m.append(new_mov) #%% motion correct run 3 times # WHEN YOU RUN motion_correct YOUR ARE MODIFYING THE OBJECT!!!! templates=[];