Пример #1
0
    def FPlay(self, eventQt):
        ## problem
        self.play = not self.play
        if self.play:
            self.FPlayBTN.setIcon(pyqtGUI.QIcon(uiIcons.FGetIcon('pause')))
            self.FShowNextImage()
        else:  # pause
            self.FPlayBTN.setIcon(pyqtGUI.QIcon(uiIcons.FGetIcon('play')))

        return
Пример #2
0
    def __init__(self, cls, inputDict, fishNumber):
        self.fishNumber = fishNumber
        self.inputDict = inputDict
        self.listItem = pyqtWidget.QListWidgetItem()
        self.FWdiget = pyqtWidget.QWidget()

        self.FWdigetText = pyqtWidget.QLabel("Fish #{}".format(
            self.fishNumber))

        self.avgFishLength = pyqtWidget.QLabel()
        self.avgFishLength.setText("Length: {}".format(uif.getAvgLength()))

        self.FIfFish = pyqtWidget.QCheckBox("is Fish")
        self.FIfFish.setChecked(False)

        self.FWdigetBTN = pyqtWidget.QPushButton("Show")

        self.linkFish = pyqtWidget.QPushButton()
        self.linkFish.setIcon(pyqtGUI.QIcon(uiIcons.FGetIcon("link")))

        self.nameLengthLayout = pyqtWidget.QHBoxLayout()
        self.nameLengthLayout.addWidget(self.FWdigetText)
        self.nameLengthLayout.addWidget(self.avgFishLength)

        self.infoLayout = pyqtWidget.QHBoxLayout()
        self.infoLayout.addWidget(self.FIfFish)
        self.infoLayout.addWidget(self.linkFish)

        self.FWdigetBTN.clicked.connect(
            lambda: cls.showFish(self.fishNumber, self.inputDict))
        self.FWdigetLayout = pyqtWidget.QVBoxLayout()
        self.FWdigetLayout.addLayout(self.nameLengthLayout)
        self.FWdigetLayout.addLayout(self.infoLayout)
        self.FWdigetLayout.addWidget(self.FWdigetBTN)
        self.FWdigetLayout.addStretch()
        # self.FWdigetLayout.setSizeConstraint(pyqtWidget.QLayout.SetFixedSize)
        self.FWdiget.setLayout(self.FWdigetLayout)
        self.listItem.setSizeHint(self.FWdiget.sizeHint())
Пример #3
0
    def __init__(self, main_window, playback_manager, detector, tracker, fish_manager): #, resultsView = False, results=False):
        """Initializes the window and loads the first frame and
        places the UI elements, each in its own place.
        """
        self.measure_event = Event()

        self.main_window = main_window
        self.playback_manager = playback_manager
        self.detector = detector
        self.tracker = tracker
        self.fish_manager = fish_manager
        self.image_processor = ImageProcessor()
        self.polar_transform = None

        self.show_first_frame = False

        self.playback_manager.frame_available.connect(self.displayImage)
        self.playback_manager.playback_ended.connect(self.choosePlayIcon)
        self.playback_manager.file_opened.connect(self.onFileOpen)
        self.playback_manager.mapping_done.connect(self.onMappingDone)
        self.playback_manager.file_closed.connect(self.onFileClose)

        if isinstance(self.main_window, MainWindow):
            self.main_window.FStatusBarFrameNumber.setText(self.playback_manager.getFrameNumberText())

        QtWidgets.QDialog.__init__(self)
        self.FLayout = QtWidgets.QGridLayout()

        FNextBTN = QtWidgets.QPushButton(self)
        FNextBTN.clicked.connect(self.playback_manager.showNextImage)
        FNextBTN.setShortcut(QtCore.Qt.Key_Right)
        FNextBTN.setIcon(QtGui.QIcon(uiIcons.FGetIcon('next')))
        
        FPreviousBTN = QtWidgets.QPushButton(self)
        FPreviousBTN.clicked.connect(self.playback_manager.showPreviousImage)
        FPreviousBTN.setShortcut(QtCore.Qt.Key_Left)
        FPreviousBTN.setIcon(QtGui.QIcon(uiIcons.FGetIcon('previous')))
        
        self.FPlayBTN = QtWidgets.QPushButton(self)
        self.FPlayBTN.clicked.connect(self.togglePlayPause)
        self.FPlayBTN.setShortcut(QtCore.Qt.Key_Space)
        self.FPlayBTN.setIcon(QtGui.QIcon(uiIcons.FGetIcon('play')))


        self.F_BGS_BTN = QtWidgets.QPushButton(self)
        self.F_BGS_BTN.setObjectName("Subtract Background")
        self.F_BGS_BTN.setFlat(True)
        self.F_BGS_BTN.setCheckable(True)
        self.F_BGS_BTN.setIcon(QtGui.QIcon(uiIcons.FGetIcon("background_subtraction")))
        self.F_BGS_BTN.clicked.connect(self.FBackgroundSubtract)

        self.F_BGS_Slider = QtWidgets.QSlider(QtCore.Qt.Vertical)
        self.F_BGS_Slider.setMinimum(0)
        self.F_BGS_Slider.setMaximum(100)
        self.F_BGS_Slider.setTickPosition(QtWidgets.QSlider.TicksRight)
        self.F_BGS_Slider.setTickInterval(10)
        self.F_BGS_Slider.setValue(self._BGS_Threshold)
        self.F_BGS_Slider.valueChanged.connect(self.F_BGS_SliderValueChanged)
        self.F_BGS_Slider.setDisabled(True)

        self.F_BGS_ValueLabel = QtWidgets.QLabel()
        
        self.MyFigureWidget = SonarFigure(self)
        self.MyFigureWidget.setSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored)
        self.MyFigureWidget.setMouseTracking(True)        

        self.FSlider = QtWidgets.QSlider(QtCore.Qt.Horizontal)
        self.updateSliderLimits(0,0,0)
        self.FSlider.setTickPosition(QtWidgets.QSlider.TicksBelow)
        self.FSlider.valueChanged.connect(self.playback_manager.setFrameInd)

        self.FLayout.addWidget(self.MyFigureWidget,0,1,1,3)
        self.FLayout.addWidget(self.FSlider,1,1,1,3)
        self.FLayout.addWidget(FPreviousBTN, 2,1)
        self.FLayout.addWidget(self.FPlayBTN, 2,2)
        self.FLayout.addWidget(FNextBTN, 2,3)
        
        self.FLayout.setContentsMargins(0,0,0,0)
        self.FLayout.setColumnStretch(0,0)
        self.FLayout.setColumnStretch(1,1)
        self.FLayout.setColumnStretch(2,1)
        self.FLayout.setColumnStretch(3,1)
        self.FLayout.setRowStretch(0,1)
        self.FLayout.setRowStretch(1,0)
        self.FLayout.setRowStretch(2,0)
        self.FLayout.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize)

        if self._postAnalysisViewer:
            self.FListDetected()

        self.setLayout(self.FLayout)
Пример #4
0
 def choosePlayIcon(self):
     if self.playback_manager.isPlaying():
         self.FPlayBTN.setIcon(QtGui.QIcon(uiIcons.FGetIcon('pause')))
     else:
         self.FPlayBTN.setIcon(QtGui.QIcon(uiIcons.FGetIcon('play')))
Пример #5
0
    def __init__(self, playback_manager, sonar_processor, sonar_viewer,
                 fish_manager, detector, tracker):
        super().__init__()
        self.playback_manager = playback_manager
        self.sonar_viewer = sonar_viewer
        self.sonar_processor = sonar_processor
        self.fish_manager = fish_manager
        self.detector = detector
        self.tracker = tracker

        self.setOrientation(QtCore.Qt.Vertical)

        btn_size = QtCore.QSize(30, 30)

        #self.image_controls_label = QtWidgets.QLabel(self)
        #self.image_controls_label.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        #self.image_controls_label.setText("Image options")

        #self.verticalLayout = QtWidgets.QVBoxLayout()
        #self.verticalLayout.setObjectName("verticalLayout")
        #self.verticalLayout.setSpacing(5)
        #self.verticalLayout.setContentsMargins(7,7,7,7)

        #self.distance_tick = QtWidgets.QCheckBox("Distance compensation")
        #self.distance_tick.setChecked(False)
        #self.distance_tick.stateChanged.connect(self.playback_manager.setDistanceCompensation)
        #self.distance_tick.stateChanged.connect(self.playback_manager.refreshFrame)

        #self.contrast_tick = QtWidgets.QCheckBox("Automatic contrast")
        #self.contrast_tick.setChecked(False)
        #self.contrast_tick.stateChanged.connect(self.sonar_processor.setAutomaticContrast)
        #self.contrast_tick.stateChanged.connect(self.playback_manager.refreshFrame)

        #self.gamma_layout = QtWidgets.QVBoxLayout()
        #self.gamma_layout.setObjectName("gammaLayout")
        #self.gamma_layout.setSpacing(5)
        #self.gamma_layout.setContentsMargins(0,0,0,0)

        #self.gamma_label = QtWidgets.QLabel("Gamma", self)
        #self.gamma_label.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
        #self.gamma_label.setMinimumWidth(50)

        self.show_echogram_detections_btn = QtWidgets.QPushButton()
        self.show_echogram_detections_btn.setObjectName(
            "showEchogramDetections")
        self.show_echogram_detections_btn.setFlat(True)
        self.show_echogram_detections_btn.setCheckable(True)
        self.show_echogram_detections_btn.setChecked(False)
        self.show_echogram_detections_btn.clicked.connect(
            self.showEchogramDetectionsChanged)
        self.show_echogram_detections_btn.setToolTip(
            "Show detections\nOverlay the results from detector to Echogram")
        self.show_echogram_detections_btn.setIcon(
            QtGui.QIcon(uiIcons.FGetIcon("detections")))
        self.show_echogram_detections_btn.setIconSize(btn_size)

        self.show_echogram_tracks_btn = QtWidgets.QPushButton()
        self.show_echogram_tracks_btn.setObjectName("showTracks")
        self.show_echogram_tracks_btn.setFlat(True)
        self.show_echogram_tracks_btn.setCheckable(True)
        self.show_echogram_tracks_btn.setChecked(True)
        self.show_echogram_tracks_btn.clicked.connect(
            self.showEchogramTracksChanged)
        self.show_echogram_tracks_btn.setToolTip(
            "Show tracks\nOverlay the results from tracker to Echogram")
        self.show_echogram_tracks_btn.setIcon(
            QtGui.QIcon(uiIcons.FGetIcon("tracks")))
        self.show_echogram_tracks_btn.setIconSize(btn_size)

        self.gamma_value = QtWidgets.QLabel("1.0", self)
        self.gamma_value.setAlignment(QtCore.Qt.AlignCenter
                                      | QtCore.Qt.AlignTop)
        self.gamma_value.setMinimumWidth(30)
        self.gamma_value.setToolTip("Gamma")

        self.gamma_slider = QtWidgets.QSlider(QtCore.Qt.Vertical)
        self.gamma_slider.setMinimum(10)
        self.gamma_slider.setMaximum(40)
        self.gamma_slider.setTickPosition(QtWidgets.QSlider.TicksBelow)
        self.gamma_slider.setTickInterval(1)
        self.gamma_slider.setValue(20)
        self.gamma_slider.valueChanged.connect(self.gammaSliderChanged)
        self.gamma_slider.valueChanged.connect(
            self.playback_manager.refreshFrame)
        self.gamma_slider.setMinimumHeight(100)
        self.gamma_slider.setToolTip("Gamma\nGamma value for Sonar View")

        #self.gamma_layout.addWidget(self.gamma_value)
        #self.gamma_layout.addWidget(self.gamma_slider)

        #self.bgsub_tick = QtWidgets.QCheckBox("BG Subtraction")
        #self.bgsub_tick.setChecked(False)
        #self.bgsub_tick.stateChanged.connect(self.detector.setShowBGSubtraction)
        #self.bgsub_tick.stateChanged.connect(self.playback_manager.refreshFrame)

        self.bgsub_btn = QtWidgets.QPushButton(self)
        self.bgsub_btn.setObjectName("subtractBackground")
        self.bgsub_btn.setFlat(True)
        self.bgsub_btn.setCheckable(True)
        self.bgsub_btn.setIcon(
            QtGui.QIcon(uiIcons.FGetIcon("background_subtraction")))
        self.bgsub_btn.setIconSize(btn_size)
        self.bgsub_btn.clicked.connect(self.detector.setShowBGSubtraction)
        self.bgsub_btn.clicked.connect(self.playback_manager.refreshFrame)
        self.bgsub_btn.setToolTip(
            "Background subtraction\nShow background subtraction used in detector"
        )

        self.measure_btn = QtWidgets.QPushButton(self)
        self.measure_btn.setObjectName("measureDistance")
        self.measure_btn.setFlat(True)
        self.measure_btn.setCheckable(True)
        self.measure_btn.setIcon(QtGui.QIcon(uiIcons.FGetIcon("measure")))
        self.measure_btn.setIconSize(btn_size)
        if self.sonar_viewer is not None:
            self.measure_btn.clicked.connect(self.sonar_viewer.measureDistance)
            self.sonar_viewer.MyFigureWidget.measure_toggle.append(
                self.toggleMeasureBtn)
        self.measure_btn.setToolTip(
            "Measure distance\nDraw a line in Sonar View to measure a distance between two points"
        )

        #self.colormap_tick = QtWidgets.QCheckBox("Use colormap")
        #self.colormap_tick.setChecked(True)
        #self.colormap_tick.stateChanged.connect(self.sonar_processor.setColorMap)
        #self.colormap_tick.stateChanged.connect(self.playback_manager.refreshFrame)
        #self.colormap_tick.setToolTip("Color map\nColor Sonar View with a blue colormap")

        self.colormap_btn = QtWidgets.QPushButton(self)
        self.colormap_btn.setObjectName("setColormap")
        self.colormap_btn.setFlat(True)
        self.colormap_btn.setCheckable(True)
        self.colormap_btn.setChecked(True)
        self.colormap_btn.setIcon(QtGui.QIcon(uiIcons.FGetIcon("colormap")))
        self.colormap_btn.setIconSize(btn_size)
        self.colormap_btn.clicked.connect(self.sonar_processor.setColorMap)
        self.colormap_btn.clicked.connect(self.playback_manager.refreshFrame)
        self.colormap_btn.setToolTip(
            "Color map\nColor Sonar View with a blue colormap")

        self.show_detections_btn = QtWidgets.QPushButton()
        self.show_detections_btn.setObjectName("showDetections")
        self.show_detections_btn.setFlat(True)
        self.show_detections_btn.setCheckable(True)
        self.show_detections_btn.setChecked(False)
        self.show_detections_btn.clicked.connect(self.showDetectionsChanged)
        self.show_detections_btn.setToolTip(
            "Show detections\nOverlay the results from detector to Sonar View")
        self.show_detections_btn.setIcon(
            QtGui.QIcon(uiIcons.FGetIcon("detections")))
        self.show_detections_btn.setIconSize(btn_size)
        #self.show_detections_checkbox.setEnabled(False)
        #self.detector.state_changed_event.append(lambda: self.show_detections_checkbox.setEnabled(self.detector.mog_ready))

        self.show_detection_size_btn = QtWidgets.QPushButton()
        self.show_detection_size_btn.setObjectName("showDetectionSize")
        self.show_detection_size_btn.setFlat(True)
        self.show_detection_size_btn.setCheckable(True)
        self.show_detection_size_btn.setChecked(True)
        self.show_detection_size_btn.clicked.connect(
            self.fish_manager.setShowTrackingSize)
        self.show_detection_size_btn.clicked.connect(
            self.playback_manager.refreshFrame)
        #self.show_detection_size_btn.setEnabled(False)
        self.show_detection_size_btn.setToolTip(
            "Show detection size\nShow also the length of the detection")
        self.show_detection_size_btn.setIcon(
            QtGui.QIcon(uiIcons.FGetIcon("det_size")))
        self.show_detection_size_btn.setIconSize(btn_size)

        #self.show_tracks_checkbox = QtWidgets.QCheckBox("Show tracks")
        #self.show_tracks_checkbox.setChecked(False)
        #self.show_tracks_checkbox.stateChanged.connect(self.showTracksChanged)
        #self.show_tracks_checkbox.setToolTip("Show tracks\nOverlay the results from tracker to Sonar View")

        self.show_tracks_btn = QtWidgets.QPushButton()
        self.show_tracks_btn.setObjectName("showTracks")
        self.show_tracks_btn.setFlat(True)
        self.show_tracks_btn.setCheckable(True)
        self.show_tracks_btn.setChecked(True)
        self.show_tracks_btn.clicked.connect(self.showTracksChanged)
        self.show_tracks_btn.setToolTip(
            "Show tracks\nOverlay the results from tracker to Sonar View")
        self.show_tracks_btn.setIcon(QtGui.QIcon(uiIcons.FGetIcon("tracks")))
        self.show_tracks_btn.setIconSize(btn_size)

        #self.show_tracks_checkbox.setEnabled(False)
        #self.tracker.state_changed_event.append(lambda: self.show_tracks_checkbox.setEnabled(self.detector.mog_ready))

        #self.show_trackingIDs_checkbox = QtWidgets.QCheckBox("Show tracking IDs")
        #self.show_trackingIDs_checkbox.setChecked(True)
        #self.show_trackingIDs_checkbox.stateChanged.connect(self.tracker.setShowTrackingIDs)
        #self.show_trackingIDs_checkbox.stateChanged.connect(self.playback_manager.refreshFrame)
        #self.show_trackingIDs_checkbox.setEnabled(False)
        #self.show_trackingIDs_checkbox.setToolTip("Show track IDs\nShow also the IDs of the tracked fish")

        self.show_trackingIDs_btn = QtWidgets.QPushButton()
        self.show_trackingIDs_btn.setObjectName("showTrackID")
        self.show_trackingIDs_btn.setFlat(True)
        self.show_trackingIDs_btn.setCheckable(True)
        self.show_trackingIDs_btn.setChecked(True)
        self.show_trackingIDs_btn.clicked.connect(
            self.fish_manager.setShowTrackingIDs)
        self.show_trackingIDs_btn.clicked.connect(
            self.playback_manager.refreshFrame)
        #self.show_trackingIDs_btn.setEnabled(False)
        self.show_trackingIDs_btn.setToolTip(
            "Show track IDs\nShow also the IDs of the tracked fish")
        self.show_trackingIDs_btn.setIcon(
            QtGui.QIcon(uiIcons.FGetIcon("track_id")))
        self.show_trackingIDs_btn.setIconSize(btn_size)

        line = QtWidgets.QFrame()
        line.setFrameShape(QtWidgets.QFrame.HLine)
        line.setFrameShadow(QtWidgets.QFrame.Sunken)

        #self.verticalLayout.addWidget(self.image_controls_label)
        #self.verticalLayout.addWidget(self.distance_tick)
        #self.verticalLayout.addWidget(self.contrast_tick)
        #self.verticalLayout.addWidget(self.gamma_label)
        self.addWidget(self.show_echogram_detections_btn)
        self.addWidget(self.show_echogram_tracks_btn)
        self.addWidget(self.gamma_value)
        self.addWidget(self.gamma_slider)
        self.addWidget(self.bgsub_btn)
        self.addWidget(self.colormap_btn)
        self.addWidget(self.show_detections_btn)
        self.addWidget(self.show_tracks_btn)
        self.addWidget(self.show_detection_size_btn)
        self.addWidget(self.show_trackingIDs_btn)
        self.addWidget(line)
        self.addWidget(self.measure_btn)
Пример #6
0
    def initUI(self):
        self.main_layout = QtWidgets.QVBoxLayout(self)

        # Number of parallel processes
        self.parallel_layout = QtWidgets.QHBoxLayout()

        parallel_tooltip = "Defines the number of files that are processed simultaneosly / in parallel."
        self.label_p = QtWidgets.QLabel("Parallel:")
        self.label_p.setToolTip(parallel_tooltip)
        self.parallel_layout.addWidget(self.label_p)

        intValidator = EmptyOrIntValidator(1, 32, self)
        self.line_edit_p = QtWidgets.QLineEdit(self)
        self.line_edit_p.setValidator(intValidator)
        self.line_edit_p.setAlignment(QtCore.Qt.AlignRight)
        self.line_edit_p.editingFinished.connect(self.parallelEditFinished)
        self.line_edit_p.setText(str(self.n_parallel))
        self.line_edit_p.setToolTip(parallel_tooltip)

        self.parallel_layout.addWidget(self.line_edit_p)
        self.main_layout.addLayout(self.parallel_layout)

        # Save path
        self.path_layout = QtWidgets.QHBoxLayout()

        path_tooltip = "Set the folder where the results are saved."
        self.label_path = QtWidgets.QLabel("Save path:")
        self.label_path.setToolTip(path_tooltip)
        self.path_layout.addWidget(self.label_path)

        self.line_edit_path = QtWidgets.QLineEdit(self)
        #self.line_edit_path.setAlignment(QtCore.Qt.AlignRight)
        self.line_edit_path.editingFinished.connect(self.savePathEditFinished)
        self.line_edit_path.setText(self.save_path)
        self.line_edit_path.setToolTip(path_tooltip)
        self.path_layout.addWidget(self.line_edit_path)

        self.btn_path = QtWidgets.QToolButton()
        self.btn_path.setIcon(QtGui.QIcon(uiIcons.FGetIcon("three_dots")))
        self.btn_path.clicked.connect(self.selectSavePath)
        self.path_layout.addWidget(self.btn_path)

        self.main_layout.addLayout(self.path_layout)

        # Test file
        if fh.getTestFilePath() is not None:
            self.test_layout = QtWidgets.QHBoxLayout()

            test_tooltip = "Use test file instead of selected files."
            self.label_test = QtWidgets.QLabel("Test file:")
            self.label_test.setToolTip(test_tooltip)
            self.test_layout.addWidget(self.label_test)

            self.check_test = QtWidgets.QCheckBox("")
            self.check_test.stateChanged.connect(self.setListDependentButtons)
            self.test_layout.addWidget(self.check_test)

            self.main_layout.addLayout(self.test_layout)
        else:
            self.check_test = None

        # Modify files buttons
        self.list_btn_layout = QtWidgets.QHBoxLayout()

        self.select_files_btn = QtWidgets.QPushButton(self)
        self.select_files_btn.setText("Add files")
        self.select_files_btn.clicked.connect(self.getFiles)
        self.list_btn_layout.addWidget(self.select_files_btn)

        self.remove_file_btn = QtWidgets.QPushButton(self)
        self.remove_file_btn.setText("Remove file")
        self.remove_file_btn.clicked.connect(self.removeFile)
        self.list_btn_layout.addWidget(self.remove_file_btn)

        self.clear_files_btn = QtWidgets.QPushButton(self)
        self.clear_files_btn.setText("Clear files")
        self.clear_files_btn.clicked.connect(self.clearFiles)
        self.list_btn_layout.addWidget(self.clear_files_btn)

        self.main_layout.addLayout(self.list_btn_layout)

        # File list
        self.file_list = QtWidgets.QListWidget(self)
        self.main_layout.addWidget(self.file_list)
        self.file_list.currentItemChanged.connect(self.setRemoveBtnActive)

        # Status label
        self.status_label = QtWidgets.QLabel()
        self.setStatusLabel()
        self.main_layout.addWidget(self.status_label)

        # Start button
        self.start_btn = QtWidgets.QPushButton(self)
        self.start_btn.setText("Start")
        self.start_btn.clicked.connect(self.toggleBatch)
        self.main_layout.addWidget(self.start_btn)

        self.setLayout(self.main_layout)
        self.setWindowTitle("Run batch")
Пример #7
0
    def __init__(self, parent, resultsView=False, results=False):
        """Initializes the window and loads the first frame and
        places the UI elements, each in its own place.
        """
        self._postAnalysisViewer = resultsView
        self.FDetectedDict = results
        self.FParent = parent
        self._MAIN_CONTAINER = parent._MAIN_CONTAINER
        ##  Reading the file
        self.FLoadSONARFile(self.FParent.FFilePath)
        self.FParent.FStatusBarFrameNumber.setText("Frame : " +
                                                   str(self.UI_FRAME_INDEX +
                                                       1) + "/" +
                                                   str(self.File.frameCount))
        pyqtWidget.QDialog.__init__(self)
        self.setWindowTitle("Fisher - " + self.FFilePath)
        self.FLayout = pyqtWidget.QGridLayout()

        FNextBTN = pyqtWidget.QPushButton(self)
        FNextBTN.clicked.connect(self.FShowNextImage)
        FNextBTN.setShortcut(pyqtCore.Qt.Key_Right)
        FNextBTN.setIcon(pyqtGUI.QIcon(uiIcons.FGetIcon('next')))

        FPreviousBTN = pyqtWidget.QPushButton(self)
        FPreviousBTN.clicked.connect(self.FShowPreviousImage)
        FPreviousBTN.setShortcut(pyqtCore.Qt.Key_Left)
        FPreviousBTN.setIcon(pyqtGUI.QIcon(uiIcons.FGetIcon('previous')))

        self.FPlayBTN = pyqtWidget.QPushButton(self)
        self.FPlayBTN.clicked.connect(self.FPlay)
        self.FPlayBTN.setShortcut(pyqtCore.Qt.Key_Space)
        self.FPlayBTN.setIcon(pyqtGUI.QIcon(uiIcons.FGetIcon('play')))
        #self.FPlayBTN.setCheckable(True)

        self.FAutoAnalizerBTN = pyqtWidget.QPushButton(self)
        self.FAutoAnalizerBTN.setObjectName("Automatic Analyzer")
        self.FAutoAnalizerBTN.setIcon(
            pyqtGUI.QIcon(uiIcons.FGetIcon('analyze')))
        self.FAutoAnalizerBTN.clicked.connect(self.FAutoAnalizer)

        self.F_BGS_BTN = pyqtWidget.QPushButton(self)
        self.F_BGS_BTN.setObjectName("Subtract Background")
        self.F_BGS_BTN.setFlat(True)
        self.F_BGS_BTN.setCheckable(True)
        self.F_BGS_BTN.setIcon(
            pyqtGUI.QIcon(uiIcons.FGetIcon("background_subtraction")))
        self.F_BGS_BTN.clicked.connect(self.FBackgroundSubtract)

        self.F_BGS_Slider = pyqtWidget.QSlider(pyqtCore.Qt.Vertical)
        self.F_BGS_Slider.setMinimum(0)
        self.F_BGS_Slider.setMaximum(100)
        self.F_BGS_Slider.setTickPosition(pyqtWidget.QSlider.TicksRight)
        self.F_BGS_Slider.setTickInterval(10)
        self.F_BGS_Slider.setValue(self._BGS_Threshold)
        self.F_BGS_Slider.valueChanged.connect(self.F_BGS_SliderValueChanged)
        self.F_BGS_Slider.setDisabled(True)

        self.F_BGS_ValueLabel = pyqtWidget.QLabel()

        #self.FFigure = pyqtWidget.QLabel("Frame Viewer", self)
        #self.FFigure.setUpdatesEnabled(True)

        self.MyFigureWidget = MyFigure(self)
        # self.MyFigureWidget.setUpdatesEnabled(True)
        self.MyFigureWidget.setSizePolicy(pyqtWidget.QSizePolicy.Ignored,
                                          pyqtWidget.QSizePolicy.Ignored)
        self.MyFigureWidget.setMouseTracking(True)

        self.FToolbar = pyqtWidget.QToolBar(self)
        self.FToolbar.addWidget(self.FAutoAnalizerBTN)
        self.FToolbar.addWidget(self.F_BGS_BTN)
        self.FToolbar.addWidget(self.F_BGS_ValueLabel)
        # self.FToolbar.add
        self.FToolbar.addWidget(self.F_BGS_Slider)
        self.FToolbar.setOrientation(pyqtCore.Qt.Vertical)
        self.FToolbar.setFixedWidth(self.FToolbar.minimumSizeHint().width())

        self.FSlider = pyqtWidget.QSlider(pyqtCore.Qt.Horizontal)
        self.FSlider.setMinimum(1)
        self.FSlider.setMaximum(self.File.frameCount)
        self.FSlider.setTickPosition(pyqtWidget.QSlider.TicksBelow)
        self.FSlider.setTickInterval(int(0.05 * self.File.frameCount))
        self.FSlider.valueChanged.connect(self.FSliderValueChanged)

        self.FLayout.addWidget(self.FToolbar, 0, 0, 3, 1)
        self.FLayout.addWidget(self.MyFigureWidget, 0, 1, 1, 3)
        self.FLayout.addWidget(self.FSlider, 1, 1, 1, 3)
        #self.FLayout.addLayout(self.LowerToolbar, 2,1, Qt.AlignBottom)
        self.FLayout.addWidget(FPreviousBTN, 2, 1)
        self.FLayout.addWidget(self.FPlayBTN, 2, 2)
        self.FLayout.addWidget(FNextBTN, 2, 3)

        self.FLayout.setContentsMargins(0, 0, 0, 0)
        self.FLayout.setColumnStretch(0, 0)
        self.FLayout.setColumnStretch(1, 1)
        self.FLayout.setColumnStretch(2, 1)
        self.FLayout.setColumnStretch(3, 1)
        self.FLayout.setRowStretch(0, 1)
        self.FLayout.setRowStretch(1, 0)
        self.FLayout.setRowStretch(2, 0)
        self.FLayout.setSizeConstraint(pyqtWidget.QLayout.SetMinimumSize)

        if self._postAnalysisViewer:
            self.FListDetected()

        self.setLayout(self.FLayout)
        self.FDisplayImage()