FrameBrowser#

This module defines two main classes:

  • FrameBrowser: a widget with 4 buttons (first, previous, next, last) to browse between frames and a text entry to access a specific frame by typing it’s number)

  • HorizontalSliderWithBrowser: a FrameBrowser with an additional slider. This class inherits qt.QAbstractSlider.

API#

class HorizontalSliderWithBrowser(parent=None)[source]#

Slider widget combining a QSlider and a FrameBrowser.

../../../_images/HorizontalSliderWithBrowser.png

The data model is an integer within a range.

The default value is the default QSlider value (0), and the default range is the default QSlider range (0 – 99)

The signal emitted when the value is changed is the usual QAbstractSlider signal valueChanged. The signal carries the value (as an integer).

Parameters:

parent (QWidget) – Optional parent widget

lineEdit()[source]#

Returns the line edit provided by this widget.

Return type:

qt.QLineEdit

limitWidget()[source]#

Returns the widget displaying axes limits.

Return type:

qt.QLabel

setMinimum(value)[source]#

Set minimum value

Parameters:

value (int) – Minimum value

setMaximum(value)[source]#

Set maximum value

Parameters:

value (int) – Maximum value

setRange(first, last)[source]#

Set minimum/maximum values

Parameters:
  • first (int) – Minimum value

  • last (int) – Maximum value

setValue(value)[source]#

Set value

Parameters:

value (int) – value

value()[source]#

Get selected value

class FrameBrowser(parent=None, n=None)[source]#

Frame browser widget, with 4 buttons/icons and a line edit to provide a way of selecting a frame index in a stack of images.

../../../_images/FrameBrowser.png

It can be used in more generic case to select an integer within a range.

Parameters:
  • parent (QWidget) – Parent widget

  • n (int) – Number of frames. This will set the range of frame indices to 0–n-1. If None, the range is initialized to the default QSlider range (0–99).

lineEdit()[source]#

Returns the line edit provided by this widget.

Return type:

qt.QLineEdit

limitWidget()[source]#

Returns the widget displaying axes limits.

Return type:

qt.QLabel

getRange()[source]#

Returns frame range

Returns:

(first_index, last_index)

setRange(first, last)[source]#

Set minimum and maximum frame indices.

Initialize the frame index to first. Update the label text to “ limits: first, last”

Parameters:
  • first (int) – Minimum frame index

  • last (int) – Maximum frame index

setNFrames(nframes)[source]#

Set minimum=0 and maximum=nframes-1 frame numbers.

Initialize the frame index to 0. Update the label text to “1 of nframes”

Parameters:

nframes (int) – Number of frames

getValue()[source]#

Return current frame index

setValue(value)[source]#

Set 0-based frame index

Value is clipped to current range.

Parameters:

value (int) – Frame number