PyQtGraph – Image View
The PyQtGraph module is a graphics and user interface library for Python that provides functionality commonly required in designing and science applications. Its primary goals are to provide fast, interactive graphics for displaying data (plots, video, etc.). Widget used for display and analysis of image data. Implements many features like displaying 2D and 3D image data. For 3D data, a z-axis slider is displayed allowing the user to select which frame is displayed. Displays histogram of image data with movable region defining the dark/light levels, editable gradient provides a color lookup table, frame slider may also be moved using left/right arrow keys as well as pgup, pgdn, home, and end.
Basic analysis features includes:
1. ROI and embedded plot for measuring image values across frames
2. Image normalization / background subtraction
We can create an image view with the help of command given below:
# creating a pyqtgraph image view object img = pg.ImageView()
- Import pyqtgraph, pyqt5 and numpy modules.
- Create Main window class.
- Create an image view object.
- Create an image using numpy and gaussian filter of the pyqtgraph module.
- Create a custom color map and set it to the image view.
- Add the image video view to the grid layout with other widgets.
- Set grid layout widget as the central widget of main window.
Below is the implementation based on the above approach: