예제 #1
0
    def _createBottomRightPanel(self, **kwargs):
        """ Creates the bottom right panel, containing the SpinSlider """
        panel = ViewPanel(self, layoutType=ViewPanel.HORIZONTAL)
        spinSlider = SpinSlider(panel,
                                text='Radius ',
                                minValue=1,
                                maxValue=10000,
                                currentValue=100)
        panel.addWidget(spinSlider, 'spinSlider')

        return panel
예제 #2
0
    def _createTopRightPanel(self, **kwargs):
        """
        Build the top right panel: ViewPanel with ImageView
        The ImageView should be accessed using the 'imageView' key.

        Keyword Args:
                The kwargs arguments for the ImageView

        Return:
            :class:`ViewPanel <datavis.widgets.ViewPanel>`
        """
        panel = ViewPanel(self)
        kwargs['parent'] = self
        panel.addWidget(ImageView(**kwargs), 'imageView')
        return panel
예제 #3
0
    def _createTopRightPanel(self, **kwargs):
        """ Build the top right panel: ViewPanel with VolumeView widget
        The VolumeView should be accessed using the 'volumeView' key.

        Keyword Args:
            kwargs: The keyword arguments for the :class:`~datavis.views.VolumeView`

        Returns:
            :class:`~datavis.widgets.ViewPanel`
        """
        panel = ViewPanel(self)
        kwargs['parent'] = panel
        view = VolumeView(self._model.getModel(0), **kwargs)
        panel.addWidget(view, 'volumeView')
        return panel
예제 #4
0
    def _createLeftPanel(self, **kwargs):
        """
        Build the left panel: List of images. The ColumnsView will be accessed
        from the returned ViewPanel using the 'columnsView' key.

        Keyword Args:
            The kwargs arguments for the ColumnsView

        Returns:
            :class:`~datavis.widgets.ViewPanel`
        """
        panel = ViewPanel(self, layoutType=ViewPanel.VERTICAL)
        panel.addWidget(
            ColumnsView(parent=panel, model=EmptyTableModel(), **kwargs),
            'columnsView')
        return panel
예제 #5
0
    def _createBottomRightPanel(self, **kwargs):
        """ Creates a FormWidget from the given 'options' param.
        The FormWidget should be accessed using the 'optionsWidget' key.

        Keyword Args:
            options: params options. See FormWidget specifications
            method:  Function to invoke when the apply button is clicked
        """
        self._paramsForm = kwargs.get('form', None)
        self._method = kwargs.get('method')

        panel = ViewPanel(self, layoutType=ViewPanel.VERTICAL)
        if self._paramsForm is not None:
            self._formWidget = FormWidget(self._paramsForm,
                                          parent=panel,
                                          name='params')
            panel.addWidget(self._formWidget,
                            'optionsWidget',
                            alignment=qtc.Qt.AlignLeft)
        else:
            self._formWidget = None

        self._applyButton = qtw.QPushButton(panel)
        self._applyButton.setText('Apply')
        self._applyButton.setFixedWidth(90)
        self._applyButton.clicked.connect(self.__onApplyButtonClicked)
        panel.addWidget(self._applyButton,
                        'applyButton',
                        alignment=qtc.Qt.AlignBottom)
        return panel
예제 #6
0
    def _createTopRightPanel(self, **kwargs):
        """ Build the top right panel: ViewPanel with two ImageView widgets
        The left ImageView should be accessed using the 'leftImageView' key.
        The right ImageView should be accessed using the 'rightImageView' key.

        Keyword Args:
            The kwargs arguments for the two
            :class:`ImageView <datavis.views.ImageView>`.

        Returns:
            :class:`ViewPanel <datavis.widgets.ViewPanel>`.
        """
        panel = ViewPanel(self)
        defaultImgViewKargs = {
            'histogram': False,
            'toolBar': False,
        }
        k = dict(defaultImgViewKargs)
        k.update(kwargs)
        leftImageView = ImageView(parent=self, model=None, **k)
        panel.addWidget(leftImageView, 'leftImageView')
        rightImageView = ImageView(parent=self, model=None, **k)
        leftImageView.setXLink(rightImageView)
        leftImageView.setYLink(rightImageView)
        panel.addWidget(rightImageView, 'rightImageView')
        return panel
예제 #7
0
    def _createRightPanel(self, **kwargs):
        """
        Build the right panel: (Top) ViewPanel with ImageView(but subclasses
        might create different widgets). (Botton) ViewPanel with an InfoPanel
        (in subclasses should be implemented).
        The top right panel should be accessed using the 'topRightPanel' key.
        The bottom right panel should be accessed using the 'topRightPanel' key.

        Keyword Args:
            The kwargs arguments for the top right panel (ImageView)

        Return:
            :class:`ViewPanel <datavis.widgets.ViewPanel>`
        """
        rightPanel = ViewPanel(self, ViewPanel.VSPLITTER)
        topRightPanel = self._createTopRightPanel(**kwargs)
        bottomRightPanel = self._createBottomRightPanel(**kwargs)
        rightPanel.addWidget(topRightPanel, 'topRightPanel')
        if bottomRightPanel is not None:
            rightPanel.addWidget(bottomRightPanel, 'bottomRightPanel')

        return rightPanel