import time import os import scipy.optimize import math import matplotlib.pyplot as plt import ImageTool as imtl import AWA_tool as awa Filename = "./data_samples/vc.dat" cal = 0.039 # mm per pixel X, dx, dy, Nframes = imtl.LoadAWA(Filename) print("Dx,Dy,NFrames= ", dx, dy, Nframes) # sum m all the frame X_all_frame = imtl.DesInterlace(np.sum(X, axis=2)) TT = imtl.MouseCrop(X_all_frame) centers = imtl.ImageCenter(TT) print('center=', centers) plt.figure() #imtl.DisplayImage(X_all_frame) #plt.subplot (2,2,1) #imtl.DisplayCalibratedProj(X_all_frame, cal, 0.3) # #plt.subplot (2,2,2) #imtl.DisplayCalibratedProj(imtl.Crop(X_all_frame,centers, [200,200]), cal, 0.3) #plt.subplot (2,2,3) imtl.DisplayCalibratedProj(TT, cal, 0.3)
# fig.canvas.draw() bbox = np.array([ int(eclick.xdata), int(eclick.ydata), int(erelease.xdata), int(erelease.ydata) ]) return (bbox) Filename = "./data_samples/vc.dat" X, dx, dy, Nframes = imtl.LoadAWA(Filename) print("Dx,Dy,NFrames= ", dx, dy, Nframes) # sum m all the frame arr = imtl.DesInterlace(np.sum(X, axis=2)) fig = plt.figure() ax = fig.add_subplot(111) print("select bounding box for signal and press Q") plt_image = plt.imshow(arr) toggle_selector.RS = widgets.RectangleSelector(ax, onselect_getroi, drawtype='box', rectprops=dict(facecolor='red', edgecolor='red', alpha=0.5, fill=True), interactive=True)