Skip to main content

Some useful functions for Data Analysis

Project description

pybhu

pybhu currently exposes a desktop scientific image viewer for 2D and 3D array data. This README is intentionally focused on the public img_viewer interface.

Highlights

  • Interactive PyQt6 viewer for 2D and 3D image stacks
  • Support for .npy, .npz, and .pkl datasets
  • Layer navigation, colormap selection, histogram-based contrast control, colorbar display, and FFT analysis

Repository Structure

.
|-- __init__.py
|-- img_viewer/
|   |-- api.py
|   |-- viewer.py
|   |-- loader.py
|   |-- state.py
|   |-- histogram_dialog.py
|   |-- colorbar_dialog.py
|   |-- fft.py
|   `-- fft_dialog.py
`-- README.md

Public Interface

img_viewer

The main application in this repository is a PyQt6 + Matplotlib scientific viewer for array-based data. It is designed for quick inspection of 2D images and 3D stacks, with built-in tools for:

  • browsing layers in a stack
  • switching colormaps and inverting palettes
  • adjusting intensity limits from a histogram window
  • displaying a separate colorbar window
  • computing forward or inverse 2D FFTs with selectable window functions

Requirements

The repository currently ships as source code and does not yet include packaging metadata such as pyproject.toml. Install dependencies manually before use.

The examples below assume the package is available as pybhu, either because the project folder is named pybhu or because you install/package it that way.

Core viewer dependencies:

pip install numpy scipy matplotlib pyqt6

Quick Start

Launch the image viewer from a NumPy array

import numpy as np
from pybhu import img_viewer

data = np.random.rand(256, 256, 16)
viewer = img_viewer(data, colormap_name="viridis", initial_layer=0)
viewer.app.exec()

If you are already inside an environment that owns the Qt event loop, you may not need to call viewer.app.exec().

Open data directly from file

from pybhu import img_viewer

viewer = img_viewer("example_stack.npz")
viewer.app.exec()

Supported viewer file types:

  • .npy
  • .npz
  • .pkl

For .npz and .pkl, the loader searches recursively for 2D or 3D arrays and lets you choose among multiple datasets when needed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybhu-0.1.9.tar.gz (88.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybhu-0.1.9-py3-none-any.whl (99.1 kB view details)

Uploaded Python 3

File details

Details for the file pybhu-0.1.9.tar.gz.

File metadata

  • Download URL: pybhu-0.1.9.tar.gz
  • Upload date:
  • Size: 88.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pybhu-0.1.9.tar.gz
Algorithm Hash digest
SHA256 be8745356b92c2d22a0d17291525940b969b0079c2e5946bd4dfc3e21dbfd1aa
MD5 25eb6d0a59fb6a13b3491233bc89c127
BLAKE2b-256 4019cc6e0140ba4d0b6855e05287b07d651d6076b707a3e768d573767d627849

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybhu-0.1.9.tar.gz:

Publisher: workflow.yml on Korbinhu/pybhu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybhu-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: pybhu-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 99.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pybhu-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 d1774aa9b8b942ee373ad99f592900872cd6d8aac89eeaf261ee765271a16155
MD5 562d3ac7c92a798f8ae19a464c729847
BLAKE2b-256 2a1a5085988deaaffdfb54bb52d40f2ec8d99290c42f8135ea4daa3bbe6ec556

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybhu-0.1.9-py3-none-any.whl:

Publisher: workflow.yml on Korbinhu/pybhu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page