def create_trajectory_and_inputs(show_=False): app = QApplication(sys.argv) window = Window() window.show() app.exec() window.getMatrix() frame_img = window.img window.default_save() # Green Sresult = ConvertingFunctions.reduce_matrix(frame_img[:, :, 0], 10) plt.imshow(frame_img[:, :, 0]) plt.title("Trajectory in the pyramidal cells") plt.xlabel("meters") plt.ylabel("meters") plt.show() if show_: plt.imshow(Sresult) plt.title("S legend") np.save('S_inputs.npy', Sresult) result_S = MainFunctions.create_trajectory_matrix('S_inputs.npy') if np.count_nonzero(frame_img[:, :, 1] != 255) == 0: raise Warning("With this method, must add external inputs!") else: # Red Gresult = ConvertingFunctions.reduce_matrix(frame_img[:, :, 1], 10) np.save('G_inputs.npy', Gresult) result_G = MainFunctions.create_trajectory_matrix('G_inputs.npy') plt.imshow(frame_img[:, :, 1]) plt.title("Special input in the pyramidal cells") plt.xlabel("meters") plt.ylabel("meters") plt.show() if show_: plt.imshow(Gresult) plt.title("G legend") result_S = result_S + result_G return result_S, result_G