A graphical user interface (GUI) for PIMS (screenshot below)
This viewer is based on PyQt5 and is able to work with N-dimensional image files that are opened by PIMS.
Also, it has a plugin infrastructure that can be used to extend the main functionality.
Pimsviewer can be installed using conda:
conda install -c conda-forge pimsviewer
Alternatively, it can also be installed using pip:
pip install pimsviewer
When installing the latest source version, always install it with pip
(and not with python setup.py develop
, this will lead to dependency errors for PyQt
):
Normal installation:
pip install .
Development installation:
pip install . -e
After installing the viewer, an executable pimsviewer
is available. Simply run the command via your terminal/command line interface.
$ pimsviewer --help
Usage: pimsviewer [OPTIONS] [FILEPATH]
Options:
--example-plugins / --no-example-plugins
Load additional example plugins
--help Show this message and exit.
All examples below are also available as script files in the examples
folder.
By running pimsviewer --example-plugins
, you can preview the example plugins used below.
You can use the viewer in a Python script as follows:
import sys
from pimsviewer import GUI
from PyQt5.QtWidgets import QApplication
filepath = 'path/to/file'
# Class names of extra plugins to add
plugins = []
app = QApplication(sys.argv)
gui = GUI(extra_plugins=plugins)
gui.open(fileName=filepath)
gui.show()
sys.exit(app.exec_())
Or, if you do not need a reference to the actual object but you just want to start the program:
from pimsviewer import run
run('path/to/file')
In both cases, you can omit the file path.
This example adds a processing function that adds an adjustable amount of noise to an image. The amount of noise is tunable with a slider.
from pimsviewer import run
from pimsviewer.plugins import ProcessingPlugin
run('path/to/file', [ProcessingPlugin])
This example annotates features that were obtained via trackpy onto a video. Tracked positions are loaded from a pandas DataFrame CSV file by the user.
from pimsviewer import run
from pimsviewer.plugins import AnnotatePlugin
run('path/to/file', [AnnotatePlugin])
By looking at the code for the example plugins, it should be fairly easy to extend pimsviewer using your own plugins. Contact one of the maintainers if you have any trouble writing your own plugins.
Pimsviewer version 1.0 was written by Casper van der Wel, versions starting from 2.0 are written by Ruben Verweij.