Simple image viewer with 3D, complex and floating images support.
Project description
Intro
Primawera is a simple imager viewer with support for non-standard image data such as complex, floating point or 3D image data.
Installation
This package is available at PyPI. To install the package using pip
run:
python -m pip install primawera
Building
Required packages
More detailed information about version of packages is inside the pyproject.toml
file.
- Python 3.10
- numpy
- PIL
- PyQt5
- Qt
- h5py
Building and installing the package
Make sure you have the latest version of setuptools
, pip
and venv
packages as the building requires some
newer features of setuptools
.
Inside the root folder run:
python -m build
The command should build a wheel file inside the dist
folder. To install it run:
pip install <PATH TO WHEEL FILE>
Usage
Open empty window
It is possible to run the viewer without any data.
from primawera.app import create_window
create_window()
Visualise numpy data
If you want to visualise data inside a numpy array, you will have to import the function run_app
. Sometimes it is not
possible to automatically infer the mode (see Pillow image modes).
in which case it has to be provided manually.
from primawera.app import run_app
import numpy as np
data = np.random.random((10, 10, 10))
run_app(data)
# Or
run_app(data, mode="float")
# You can also add overlay data
overlay_data = np.random.random(data.shape) # same shape as data
run_app(data, mode="float", overlay_data=overlay_data)
Run from terminal
Simply run
primawera
Recognized image modes (case insensitive)
Image type | Legal Mode |
---|---|
Boolean | 1, bool |
Grayscale | gray, grey, grayscale, greyscale, I;16 I;16B |
RGB | rgb, color, colour |
Floating | f, float, floating |
Complex | c, complex |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for primawera-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6213582d7804cc5f4241e34ad351feffe514949d75796c5297055d8d063777e9 |
|
MD5 | ff61de232959f7fa856c784ca805d920 |
|
BLAKE2b-256 | 38764868188d04bbaa6a036097f0e2ca86579a914e237db92a4d90fa1f95421a |