c1=None, sn=None, g=None, **temporal_params) t_elTEMPORAL2 = time() - t1 print t_elTEMPORAL2 # took 98 sec #%% merge components corresponding to the same neuron t1 = time() A_m, C_m, nr_m, merged_ROIs, S_m, bl_m, c1_m, sn_m, g_m = cse.mergeROIS_parallel( Y_res, A, b, C, f, S, sn, temporal_params, spatial_params, bl=bl, c1=c1, sn=neurons_sn, g=g, thr=0.8, mx=50) t_elMERGE = time() - t1 print t_elMERGE except: print 'test failed' raise #%% STOP CLUSTER finally: print "Stopping Cluster...."
pl.show() #%% t1 = time() A,b,Cin = cse.update_spatial_components_parallel(Yr, Cin, f_in, Ain, sn=sn, **spatial_params) t_elSPATIAL = time() - t1 print t_elSPATIAL crd = cse.plot_contours(A,Cn,thr=0.9) #%% update_temporal_components t1 = time() C,f,Y_res,S,bl,c1,neurons_sn,g = cse.update_temporal_components_parallel(Yr,A,b,Cin,f_in,bl=None,c1=None,sn=None,g=None,**temporal_params) t_elTEMPORAL2 = time() - t1 print t_elTEMPORAL2 # took 98 sec #%% merge components corresponding to the same neuron t1 = time() A_m,C_m,nr_m,merged_ROIs,S_m,bl_m,c1_m,sn_m,g_m=cse.mergeROIS_parallel(Y_res,A,b,C,f,S,sn,temporal_params, spatial_params, bl=bl, c1=c1, sn=neurons_sn, g=g, thr=0.8, mx=50) t_elMERGE = time() - t1 print t_elMERGE #%% view results. Notice that in order to scroll components you need to click on the plot A_or, C_or, srt = cse.order_components(A_m,C_m) cse.view_patches(Yr,coo_matrix(A_or),C_or,b,f, d1,d2,secs=0) #%% crd = cse.plot_contours(A_m,Cn,thr=0.9) #%% refine spatial and temporal t1 = time() A2,b2,C2 = cse.update_spatial_components_parallel(Yr, C_m, f, A_m, sn=sn, **spatial_params) #C2,f2,Y_res2,S2,bl2,c12,neurons_sn2,g21 = cse.update_temporal_components_parallel(Yr,A2,b2,C2,f,bl=bl_m,c1=c1_m,sn=sn_m,g=g_m,**temporal_params) C2,f2,Y_res2,S2,bl2,c12,neurons_sn2,g21 = cse.update_temporal_components_parallel(Yr,A2,b2,C2,f,bl=None,c1=None,sn=None,g=None,**temporal_params) print time() - t1 # 100 seconds #%% A_or, C_or, srt = cse.order_components(A2,C2)