Ejemplo n.º 1
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        # load objects
        self.camera = camera.Camera()
        self.microcontroller = microcontroller.Microcontroller_Simulation()

        self.configurationManager = core.ConfigurationManager()
        self.streamHandler = core_volumetric_imaging.StreamHandler(
            crop_width=500, crop_height=500)
        self.liveController = core.LiveController(self.camera,
                                                  self.microcontroller,
                                                  self.configurationManager)
        self.navigationController = core.NavigationController(
            self.microcontroller)
        self.autofocusController = core.AutoFocusController(
            self.camera, self.navigationController, self.liveController)
        self.multipointController = core.MultiPointController(
            self.camera, self.navigationController, self.liveController,
            self.autofocusController, self.configurationManager)
        self.trackingController = core.TrackingController(
            self.microcontroller, self.navigationController)
        self.imageSaver = core.ImageSaver()
        self.imageDisplay = core.ImageDisplay()

        # open the camera
        # camera start streaming
        self.camera.open()
        self.camera.set_software_triggered_acquisition(
        )  #self.camera.set_continuous_acquisition()
        self.camera.set_callback(self.streamHandler.on_new_frame)
        self.camera.enable_callback()

        # load widgets
        self.cameraSettingWidget = widgets.CameraSettingsWidget(
            self.camera, self.liveController)
        self.liveControlWidget = widgets.LiveControlWidget(
            self.streamHandler, self.liveController, self.configurationManager)
        self.navigationWidget = widgets.NavigationWidget(
            self.navigationController)
        self.autofocusWidget = widgets.AutoFocusWidget(
            self.autofocusController)
        self.recordingControlWidget = widgets.RecordingWidget(
            self.streamHandler, self.imageSaver)
        self.trackingControlWidget = widgets.TrackingControllerWidget(
            self.streamHandler, self.trackingController)
        self.multiPointWidget = widgets.MultiPointWidget(
            self.multipointController, self.configurationManager)

        self.recordTabWidget = QTabWidget()
        self.recordTabWidget.addTab(self.recordingControlWidget,
                                    "Simple Recording")
        # self.recordTabWidget.addTab(self.trackingControlWidget, "Tracking")
        # self.recordTabWidget.addTab(self.multiPointWidget, "Multipoint Acquisition")

        # layout widgets
        layout = QGridLayout()  #layout = QStackedLayout()
        layout.addWidget(self.cameraSettingWidget, 0, 0)
        layout.addWidget(self.liveControlWidget, 1, 0)
        # layout.addWidget(self.navigationWidget,2,0)
        # layout.addWidget(self.autofocusWidget,3,0)
        layout.addWidget(self.recordTabWidget, 4, 0)

        # transfer the layout to the central widget
        self.centralWidget = QWidget()
        self.centralWidget.setLayout(layout)
        self.setCentralWidget(self.centralWidget)

        # load window
        self.imageDisplayWindow = core.ImageDisplayWindow()
        self.imageArrayDisplayWindow = core_volumetric_imaging.ImageArrayDisplayWindow(
        )
        self.imageDisplayWindow.show()
        self.imageArrayDisplayWindow.show()

        # make connections
        self.streamHandler.signal_new_frame_received.connect(
            self.liveController.on_new_frame)
        self.streamHandler.image_to_display.connect(self.imageDisplay.enqueue)
        self.streamHandler.packet_image_to_write.connect(
            self.imageSaver.enqueue)
        self.streamHandler.packet_image_for_tracking.connect(
            self.trackingController.on_new_frame)
        self.streamHandler.packet_image_for_array_display.connect(
            self.imageArrayDisplayWindow.display_image)
        self.imageDisplay.image_to_display.connect(
            self.imageDisplayWindow.display_image
        )  # may connect streamHandler directly to imageDisplayWindow
        self.navigationController.xPos.connect(
            self.navigationWidget.label_Xpos.setNum)
        self.navigationController.yPos.connect(
            self.navigationWidget.label_Ypos.setNum)
        self.navigationController.zPos.connect(
            self.navigationWidget.label_Zpos.setNum)
        self.autofocusController.image_to_display.connect(
            self.imageDisplayWindow.display_image)
        # self.multipointController.image_to_display.connect(self.imageDisplayWindow.display_image)
        self.multipointController.signal_current_configuration.connect(
            self.liveControlWidget.set_microscope_mode)
        self.multipointController.image_to_display_multi.connect(
            self.imageArrayDisplayWindow.display_image)
        self.liveControlWidget.signal_newExposureTime.connect(
            self.cameraSettingWidget.set_exposure_time)
        self.liveControlWidget.signal_newAnalogGain.connect(
            self.cameraSettingWidget.set_analog_gain)
        self.liveControlWidget.update_camera_settings()
Ejemplo n.º 2
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        # load objects
        self.camera = camera.Camera_Simulation()
        self.microcontroller = microcontroller.Microcontroller_Simulation()

        self.streamHandler = core.StreamHandler()
        self.liveController = core.LiveController(self.camera,
                                                  self.microcontroller)
        self.navigationController = core.NavigationController(
            self.microcontroller)
        self.autofocusController = core.AutoFocusController(
            self.camera, self.navigationController, self.liveController)
        self.multipointController = core.MultiPointController(
            self.camera, self.navigationController, self.liveController,
            self.autofocusController)
        self.trackingController = core.TrackingController(
            self.microcontroller, self.navigationController)
        self.imageSaver = core.ImageSaver()
        self.imageDisplay = core.ImageDisplay()
        '''
		# thread
		self.thread_multiPoint = QThread()
		self.thread_multiPoint.start()
		self.multipointController.moveToThread(self.thread_multiPoint)
		'''

        # open the camera
        # camera start streaming
        self.camera.open()
        self.camera.set_software_triggered_acquisition(
        )  #self.camera.set_continuous_acquisition()
        self.camera.set_callback(self.streamHandler.on_new_frame)
        self.camera.enable_callback()

        # load widgets
        self.cameraSettingWidget = widgets.CameraSettingsWidget(
            self.camera, self.liveController)
        self.liveControlWidget = widgets.LiveControlWidget(
            self.streamHandler, self.liveController)
        self.navigationWidget = widgets.NavigationWidget(
            self.navigationController)
        self.autofocusWidget = widgets.AutoFocusWidget(
            self.autofocusController)
        self.recordingControlWidget = widgets.RecordingWidget(
            self.streamHandler, self.imageSaver)
        self.trackingControlWidget = widgets.TrackingControllerWidget(
            self.streamHandler, self.trackingController)
        self.multiPointWidget = widgets.MultiPointWidget(
            self.multipointController)

        self.recordTabWidget = QTabWidget()
        self.recordTabWidget.addTab(self.recordingControlWidget,
                                    "Simple Recording")
        self.recordTabWidget.addTab(self.trackingControlWidget, "Tracking")
        self.recordTabWidget.addTab(self.multiPointWidget,
                                    "Multipoint Acquisition")

        # layout widgets
        layout = QGridLayout()  #layout = QStackedLayout()
        layout.addWidget(self.cameraSettingWidget, 0, 0)
        layout.addWidget(self.liveControlWidget, 1, 0)
        layout.addWidget(self.navigationWidget, 2, 0)
        layout.addWidget(self.autofocusWidget, 3, 0)
        layout.addWidget(self.recordTabWidget, 4, 0)

        # transfer the layout to the central widget
        self.centralWidget = QWidget()
        self.centralWidget.setLayout(layout)
        self.setCentralWidget(self.centralWidget)

        # load window
        self.imageDisplayWindow = core.ImageDisplayWindow()
        self.imageDisplayWindow.show()

        # make connections
        self.streamHandler.signal_new_frame_received.connect(
            self.liveController.on_new_frame)
        self.streamHandler.image_to_display.connect(self.imageDisplay.enqueue)
        self.streamHandler.packet_image_to_write.connect(
            self.imageSaver.enqueue)
        self.streamHandler.packet_image_for_tracking.connect(
            self.trackingController.on_new_frame)
        self.imageDisplay.image_to_display.connect(
            self.imageDisplayWindow.display_image
        )  # may connect streamHandler directly to imageDisplayWindow
        self.navigationController.xPos.connect(
            self.navigationWidget.label_Xpos.setNum)
        self.navigationController.yPos.connect(
            self.navigationWidget.label_Ypos.setNum)
        self.navigationController.zPos.connect(
            self.navigationWidget.label_Zpos.setNum)
        self.autofocusController.image_to_display.connect(
            self.imageDisplayWindow.display_image)
        self.multipointController.image_to_display.connect(
            self.imageDisplayWindow.display_image)

        self.camera.start_streaming()
Ejemplo n.º 3
0
	def __init__(self, is_simulation = False, *args, **kwargs):
		super().__init__(*args, **kwargs)

		# load objects
		if is_simulation:
			self.camera = camera.Camera_Simulation()
			self.microcontroller = microcontroller.Microcontroller_Simulation()
		else:
			self.camera = camera.Camera()
			self.microcontroller = microcontroller.Microcontroller()
		
		self.configurationManager = core.ConfigurationManager(filename=str(Path.home()) + "/configurations_platereader.xml")
		self.streamHandler = core.StreamHandler()
		self.liveController = core.LiveController(self.camera,self.microcontroller,self.configurationManager)
		self.navigationController = core.NavigationController(self.microcontroller)
		self.plateReaderNavigationController = core.PlateReaderNavigationController(self.microcontroller)
		self.autofocusController = core.AutoFocusController(self.camera,self.navigationController,self.liveController)
		self.plateReadingController = core_platereader.PlateReadingController(self.camera,self.plateReaderNavigationController,self.liveController,self.autofocusController,self.configurationManager)
		self.imageSaver = core.ImageSaver()

		# open the camera
		# camera start streaming
		self.camera.open()
		self.camera.set_software_triggered_acquisition() #self.camera.set_continuous_acquisition()
		self.camera.set_callback(self.streamHandler.on_new_frame)
		self.camera.enable_callback()

		# load widgets
		self.cameraSettingWidget = widgets.CameraSettingsWidget(self.camera,include_gain_exposure_time=False)
		self.liveControlWidget = widgets.LiveControlWidget(self.streamHandler,self.liveController,self.configurationManager,show_trigger_options=False,show_display_options=False)
		self.autofocusWidget = widgets.AutoFocusWidget(self.autofocusController)
		self.plateReaderAcquisitionWidget = widgets.PlateReaderAcquisitionWidget(self.plateReadingController,self.configurationManager,show_configurations=False)
		self.plateReaderNavigationWidget = widgets.PlateReaderNavigationWidget(self.plateReaderNavigationController)

		# layout widgets
		layout = QGridLayout() #layout = QStackedLayout()
		#layout.addWidget(self.cameraSettingWidget,0,0)
		layout.addWidget(self.liveControlWidget,1,0)
		layout.addWidget(self.plateReaderNavigationWidget,2,0)
		layout.addWidget(self.autofocusWidget,3,0)
		layout.addWidget(self.plateReaderAcquisitionWidget,4,0)
		
		# transfer the layout to the central widget
		self.centralWidget = QWidget()
		self.centralWidget.setLayout(layout)
		self.setCentralWidget(self.centralWidget)

		# load window
		self.imageDisplayWindow = core.ImageDisplayWindow()
		self.imageDisplayWindow.show()

		# make connections
		self.streamHandler.signal_new_frame_received.connect(self.liveController.on_new_frame)
		self.streamHandler.image_to_display.connect(self.imageDisplayWindow.display_image)
		self.streamHandler.packet_image_to_write.connect(self.imageSaver.enqueue)
		# self.plateReaderNavigationController.xPos.connect(self.navigationWidget.label_Xpos.setNum)
		# self.plateReaderNavigationController.yPos.connect(self.navigationWidget.label_Ypos.setNum)
		# self.plateReaderNavigationController.zPos.connect(self.navigationWidget.label_Zpos.setNum)
		self.autofocusController.image_to_display.connect(self.imageDisplayWindow.display_image)
		# self.plateReadingController.image_to_display.connect(self.imageDisplayWindow.display_image)
		self.plateReadingController.signal_current_configuration.connect(self.liveControlWidget.set_microscope_mode)
		self.plateReadingController.image_to_display.connect(self.imageDisplayWindow.display_image)
		self.liveControlWidget.signal_newExposureTime.connect(self.cameraSettingWidget.set_exposure_time)
		self.liveControlWidget.signal_newAnalogGain.connect(self.cameraSettingWidget.set_analog_gain)
		self.liveControlWidget.update_camera_settings()

		self.microcontroller.set_callback(self.plateReaderNavigationController.update_pos)
		self.plateReaderNavigationController.signal_homing_complete.connect(self.plateReaderNavigationWidget.slot_homing_complete)
		self.plateReaderNavigationController.signal_homing_complete.connect(self.plateReaderAcquisitionWidget.slot_homing_complete)
		self.plateReaderNavigationController.signal_current_well.connect(self.plateReaderNavigationWidget.update_current_location)
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        # load objects
        self.camera_1 = camera.Camera_Simulation(sn='FW0190110139')
        self.camera_2 = camera.Camera_Simulation(sn='FU0190090030')
        self.microcontroller = microcontroller.Microcontroller_Simulation()

        self.PDAFController = core_PDAF.PDAFController()

        self.streamHandler_1 = core.StreamHandler()
        self.streamHandler_2 = core.StreamHandler()
        self.liveController_1 = core.LiveController(self.camera_1,
                                                    self.microcontroller)
        self.liveController_2 = core.LiveController(self.camera_2,
                                                    self.microcontroller)
        self.navigationController = core.NavigationController(
            self.microcontroller)
        self.autofocusController = core.AutoFocusController(
            self.camera_1, self.navigationController, self.liveController_1)
        self.trackingController = core.TrackingController(
            self.microcontroller, self.navigationController)
        self.imageSaver_1 = core.ImageSaver()
        self.imageSaver_2 = core.ImageSaver()
        self.imageDisplay_1 = core.ImageDisplay()
        self.imageDisplay_2 = core.ImageDisplay()

        # open the cameras
        self.camera_1.open()
        self.camera_1.set_software_triggered_acquisition(
        )  #self.camera.set_continuous_acquisition()
        self.camera_1.set_callback(self.streamHandler_1.on_new_frame)
        self.camera_1.enable_callback()

        self.camera_2.open()
        self.camera_2.set_software_triggered_acquisition(
        )  #self.camera.set_continuous_acquisition()
        self.camera_2.set_callback(self.streamHandler_2.on_new_frame)
        self.camera_2.enable_callback()

        # load widgets
        self.cameraSettingWidget_1 = widgets.CameraSettingsWidget(
            self.camera_1, self.liveController_1)
        self.liveControlWidget_1 = widgets.LiveControlWidget(
            self.streamHandler_1, self.liveController_1)
        self.navigationWidget = widgets.NavigationWidget(
            self.navigationController)
        self.autofocusWidget = widgets.AutoFocusWidget(
            self.autofocusController)
        self.recordingControlWidget_1 = widgets.RecordingWidget(
            self.streamHandler_1, self.imageSaver_1)
        self.trackingControlWidget = widgets.TrackingControllerWidget(
            self.streamHandler_1, self.trackingController)

        self.cameraSettingWidget_2 = widgets.CameraSettingsWidget(
            self.camera_2, self.liveController_2)
        self.liveControlWidget_2 = widgets.LiveControlWidget(
            self.streamHandler_2, self.liveController_2)
        self.recordingControlWidget_2 = widgets.RecordingWidget(
            self.streamHandler_2, self.imageSaver_2)

        # layout widgets
        layout = QGridLayout()  #layout = QStackedLayout()
        # layout.addWidget(self.cameraSettingWidget_1,0,0)
        layout.addWidget(self.liveControlWidget_1, 1, 0)
        # layout.addWidget(self.navigationWidget,2,0)
        # layout.addWidget(self.autofocusWidget,3,0)
        # layout.addWidget(self.recordingControlWidget_1,4,0)

        # layout.addWidget(self.cameraSettingWidget_2,5,0)
        layout.addWidget(self.liveControlWidget_2, 6, 0)
        # layout.addWidget(self.recordingControlWidget_2,7,0)

        # transfer the layout to the central widget
        self.centralWidget = QWidget()
        self.centralWidget.setLayout(layout)
        self.setCentralWidget(self.centralWidget)

        # load window
        self.imageDisplayWindow_1 = core.ImageDisplayWindow()
        self.imageDisplayWindow_1.show()
        self.imageDisplayWindow_2 = core.ImageDisplayWindow()
        self.imageDisplayWindow_2.show()

        # make connections
        self.streamHandler_1.signal_new_frame_received.connect(
            self.liveController_1.on_new_frame)
        self.streamHandler_1.image_to_display.connect(
            self.imageDisplay_1.enqueue)
        self.streamHandler_1.packet_image_to_write.connect(
            self.imageSaver_1.enqueue)
        self.streamHandler_1.packet_image_for_tracking.connect(
            self.trackingController.on_new_frame)
        self.imageDisplay_1.image_to_display.connect(
            self.imageDisplayWindow_1.display_image
        )  # may connect streamHandler directly to imageDisplayWindow

        self.streamHandler_2.signal_new_frame_received.connect(
            self.liveController_2.on_new_frame)
        self.streamHandler_2.image_to_display.connect(
            self.imageDisplay_2.enqueue)
        self.streamHandler_2.packet_image_to_write.connect(
            self.imageSaver_2.enqueue)
        self.imageDisplay_2.image_to_display.connect(
            self.imageDisplayWindow_2.display_image
        )  # may connect streamHandler directly to imageDisplayWindow

        self.navigationController.xPos.connect(
            self.navigationWidget.label_Xpos.setNum)
        self.navigationController.yPos.connect(
            self.navigationWidget.label_Ypos.setNum)
        self.navigationController.zPos.connect(
            self.navigationWidget.label_Zpos.setNum)
        self.autofocusController.image_to_display.connect(
            self.imageDisplayWindow_1.display_image)

        self.streamHandler_1.image_to_display.connect(
            self.PDAFController.register_image_from_camera_1)
        self.streamHandler_2.image_to_display.connect(
            self.PDAFController.register_image_from_camera_2)
Ejemplo n.º 5
0
    def __init__(self, is_simulation=False, *args, **kwargs):
        super().__init__(*args, **kwargs)

        # load window
        if ENABLE_TRACKING:
            self.imageDisplayWindow = core.ImageDisplayWindow(
                draw_crosshairs=True)
            self.imageDisplayWindow.show_ROI_selector()
        else:
            self.imageDisplayWindow = core.ImageDisplayWindow(
                draw_crosshairs=True)
        self.imageArrayDisplayWindow = core.ImageArrayDisplayWindow()
        # self.imageDisplayWindow.show()
        # self.imageArrayDisplayWindow.show()

        # image display windows
        self.imageDisplayTabs = QTabWidget()
        self.imageDisplayTabs.addTab(self.imageDisplayWindow.widget,
                                     "Live View")
        self.imageDisplayTabs.addTab(self.imageArrayDisplayWindow.widget,
                                     "Multichannel Acquisition")

        # load objects
        if is_simulation:
            self.camera = camera.Camera_Simulation(
                rotate_image_angle=ROTATE_IMAGE_ANGLE, flip_image=FLIP_IMAGE)
            self.microcontroller = microcontroller.Microcontroller_Simulation()
        else:
            self.camera = camera.Camera(rotate_image_angle=ROTATE_IMAGE_ANGLE,
                                        flip_image=FLIP_IMAGE)
            self.microcontroller = microcontroller.Microcontroller()

        # configure the actuators
        self.microcontroller.configure_actuators()

        self.configurationManager = core.ConfigurationManager()
        self.streamHandler = core.StreamHandler(
            display_resolution_scaling=DEFAULT_DISPLAY_CROP / 100)
        self.liveController = core.LiveController(self.camera,
                                                  self.microcontroller,
                                                  self.configurationManager)
        self.navigationController = core.NavigationController(
            self.microcontroller)
        self.autofocusController = core.AutoFocusController(
            self.camera, self.navigationController, self.liveController)
        self.multipointController = core.MultiPointController(
            self.camera, self.navigationController, self.liveController,
            self.autofocusController, self.configurationManager)
        if ENABLE_TRACKING:
            self.trackingController = core.TrackingController(
                self.camera, self.microcontroller, self.navigationController,
                self.configurationManager, self.liveController,
                self.autofocusController, self.imageDisplayWindow)
        self.imageSaver = core.ImageSaver(
            image_format=Acquisition.IMAGE_FORMAT)
        self.imageDisplay = core.ImageDisplay()

        # open the camera
        # camera start streaming
        self.camera.open()
        # self.camera.set_reverse_x(CAMERA_REVERSE_X) # these are not implemented for the cameras in use
        # self.camera.set_reverse_y(CAMERA_REVERSE_Y) # these are not implemented for the cameras in use
        self.camera.set_software_triggered_acquisition(
        )  #self.camera.set_continuous_acquisition()
        self.camera.set_callback(self.streamHandler.on_new_frame)
        self.camera.enable_callback()

        # load widgets
        self.cameraSettingWidget = widgets.CameraSettingsWidget(
            self.camera, include_gain_exposure_time=False)
        self.liveControlWidget = widgets.LiveControlWidget(
            self.streamHandler, self.liveController, self.configurationManager)
        self.navigationWidget = widgets.NavigationWidget(
            self.navigationController)
        self.dacControlWidget = widgets.DACControWidget(self.microcontroller)
        self.autofocusWidget = widgets.AutoFocusWidget(
            self.autofocusController)
        self.recordingControlWidget = widgets.RecordingWidget(
            self.streamHandler, self.imageSaver)
        if ENABLE_TRACKING:
            self.trackingControlWidget = widgets.TrackingControllerWidget(
                self.trackingController,
                self.configurationManager,
                show_configurations=TRACKING_SHOW_MICROSCOPE_CONFIGURATIONS)
        self.multiPointWidget = widgets.MultiPointWidget(
            self.multipointController, self.configurationManager)

        self.recordTabWidget = QTabWidget()
        if ENABLE_TRACKING:
            self.recordTabWidget.addTab(self.trackingControlWidget, "Tracking")
        self.recordTabWidget.addTab(self.recordingControlWidget,
                                    "Simple Recording")
        self.recordTabWidget.addTab(self.multiPointWidget,
                                    "Multipoint Acquisition")

        # layout widgets
        layout = QVBoxLayout()  #layout = QStackedLayout()
        layout.addWidget(self.cameraSettingWidget)
        layout.addWidget(self.liveControlWidget)
        layout.addWidget(self.navigationWidget)
        if SHOW_DAC_CONTROL:
            layout.addWidget(self.dacControlWidget)
        layout.addWidget(self.autofocusWidget)
        layout.addWidget(self.recordTabWidget)
        layout.addStretch()

        # transfer the layout to the central widget
        self.centralWidget = QWidget()
        self.centralWidget.setLayout(layout)
        # self.centralWidget.setFixedSize(self.centralWidget.minimumSize())
        # self.centralWidget.setFixedWidth(self.centralWidget.minimumWidth())
        # self.centralWidget.setMaximumWidth(self.centralWidget.minimumWidth())
        self.centralWidget.setFixedWidth(
            self.centralWidget.minimumSizeHint().width())

        if SINGLE_WINDOW:
            dock_display = dock.Dock('Image Display', autoOrientation=False)
            dock_display.showTitleBar()
            dock_display.addWidget(self.imageDisplayTabs)
            dock_display.setStretch(x=100, y=None)
            dock_controlPanel = dock.Dock('Controls', autoOrientation=False)
            # dock_controlPanel.showTitleBar()
            dock_controlPanel.addWidget(self.centralWidget)
            dock_controlPanel.setStretch(x=1, y=None)
            dock_controlPanel.setFixedWidth(
                dock_controlPanel.minimumSizeHint().width())
            main_dockArea = dock.DockArea()
            main_dockArea.addDock(dock_display)
            main_dockArea.addDock(dock_controlPanel, 'right')
            self.setCentralWidget(main_dockArea)
            desktopWidget = QDesktopWidget()
            height_min = 0.9 * desktopWidget.height()
            width_min = 0.96 * desktopWidget.width()
            self.setMinimumSize(width_min, height_min)
        else:
            self.setCentralWidget(self.centralWidget)
            self.tabbedImageDisplayWindow = QMainWindow()
            self.tabbedImageDisplayWindow.setCentralWidget(
                self.imageDisplayTabs)
            self.tabbedImageDisplayWindow.setWindowFlags(
                self.windowFlags() | Qt.CustomizeWindowHint)
            self.tabbedImageDisplayWindow.setWindowFlags(
                self.windowFlags() & ~Qt.WindowCloseButtonHint)
            desktopWidget = QDesktopWidget()
            width = 0.96 * desktopWidget.height()
            height = width
            self.tabbedImageDisplayWindow.setFixedSize(width, height)
            self.tabbedImageDisplayWindow.show()

        # make connections
        self.streamHandler.signal_new_frame_received.connect(
            self.liveController.on_new_frame)
        self.streamHandler.image_to_display.connect(self.imageDisplay.enqueue)
        self.streamHandler.packet_image_to_write.connect(
            self.imageSaver.enqueue)
        # self.streamHandler.packet_image_for_tracking.connect(self.trackingController.on_new_frame)
        self.imageDisplay.image_to_display.connect(
            self.imageDisplayWindow.display_image
        )  # may connect streamHandler directly to imageDisplayWindow
        self.navigationController.xPos.connect(
            self.navigationWidget.label_Xpos.setNum)
        self.navigationController.yPos.connect(
            self.navigationWidget.label_Ypos.setNum)
        self.navigationController.zPos.connect(
            self.navigationWidget.label_Zpos.setNum)
        if ENABLE_TRACKING:
            self.navigationController.signal_joystick_button_pressed.connect(
                self.trackingControlWidget.slot_joystick_button_pressed)
        else:
            self.navigationController.signal_joystick_button_pressed.connect(
                self.autofocusController.autofocus)
        self.autofocusController.image_to_display.connect(
            self.imageDisplayWindow.display_image)
        self.multipointController.image_to_display.connect(
            self.imageDisplayWindow.display_image)
        self.multipointController.signal_current_configuration.connect(
            self.liveControlWidget.set_microscope_mode)
        self.multipointController.image_to_display_multi.connect(
            self.imageArrayDisplayWindow.display_image)
        self.liveControlWidget.signal_newExposureTime.connect(
            self.cameraSettingWidget.set_exposure_time)
        self.liveControlWidget.signal_newAnalogGain.connect(
            self.cameraSettingWidget.set_analog_gain)
        self.liveControlWidget.update_camera_settings()
	def __init__(self, *args, **kwargs):
		super().__init__(*args, **kwargs)

		# load objects
		self.camera = camera.Camera()
		self.microcontroller = microcontroller.Microcontroller(serialport="COM12", is_homing=False)

		self.configurationManager = core.ConfigurationManager()
		self.streamHandler = core.StreamHandler()
		self.liveController = core.LiveController(self.camera,self.microcontroller,self.configurationManager)
		self.imageSaver = core.ImageSaver()
		self.imageDisplay = core.ImageDisplay()

		#self.PDAFController = core_PDAF.PDAFController()
		self.navigationController = core.NavigationController(self.microcontroller)
		self.autofocusController = core.AutoFocusController(self.camera,self.navigationController,self.liveController)
		self.trackingController = core.TrackingController(self.microcontroller,self.navigationController)



		# open the camera
		# camera start streaming
		self.camera.open()
		self.camera.set_software_triggered_acquisition()
		self.camera.set_callback(self.streamHandler.on_new_frame)
		self.camera.enable_callback()

		# load widgets
		self.cameraSettingWidget = widgets.CameraSettingsWidget(self.camera,self.liveController)
		self.liveControlWidget = widgets.LiveControlWidget(self.streamHandler,self.liveController,self.configurationManager)
		self.recordingControlWidget = widgets.RecordingWidget(self.streamHandler,self.imageSaver)
		self.navigationWidget = widgets.NavigationWidget(self.navigationController)
		self.autofocusWidget = widgets.AutoFocusWidget(self.autofocusController)
		self.trackingControlWidget = widgets.TrackingControllerWidget(self.streamHandler,self.trackingController)

		# layout widgets
		layout = QGridLayout() #layout = QStackedLayout()
		layout.addWidget(self.cameraSettingWidget,0,0)
		layout.addWidget(self.liveControlWidget,1,0)
		layout.addWidget(self.navigationWidget,2,0)
		layout.addWidget(self.autofocusWidget,3,0)
		layout.addWidget(self.recordingControlWidget,4,0)

		# transfer the layout to the central widget
		self.centralWidget = QWidget()
		self.centralWidget.setLayout(layout)
		self.setCentralWidget(self.centralWidget)

		# load window
		self.imageDisplayWindow = core.ImageDisplayWindow()
		self.imageDisplayWindow.show()

		# make connections
		self.streamHandler.signal_new_frame_received.connect(self.liveController.on_new_frame)
		self.streamHandler.image_to_display.connect(self.imageDisplay.enqueue)
		self.streamHandler.packet_image_to_write.connect(self.imageSaver.enqueue)
		self.streamHandler.packet_image_for_tracking.connect(self.trackingController.on_new_frame)

		self.imageDisplay.image_to_display.connect(self.imageDisplayWindow.display_image) # may connect streamHandler directly to imageDisplayWindow
		self.liveControlWidget.signal_newExposureTime.connect(self.cameraSettingWidget.set_exposure_time)
		self.liveControlWidget.signal_newAnalogGain.connect(self.cameraSettingWidget.set_analog_gain)
		self.liveControlWidget.update_camera_settings()

		self.navigationController.xPos.connect(self.navigationWidget.label_Xpos.setNum)
		self.navigationController.yPos.connect(self.navigationWidget.label_Ypos.setNum)
		self.navigationController.zPos.connect(self.navigationWidget.label_Zpos.setNum)
		self.autofocusController.image_to_display.connect(self.imageDisplayWindow.display_image)