Skip to main content

Interactive N-dimensional numpy array viewer with FFT support

Project description

ndslice

Interactive N-dimensional array viewer with FFT support for NumPy arrays.

Features

  • N-dimensional slicing: View any 2D slice of your N-dimensional data
  • Multiple view modes: Image view and line plot modes
  • FFT/IFFT support: Apply Fourier transforms along any dimension with a click
  • Complex data support: View real, imaginary, magnitude, or phase components
  • Scale transformations: Linear and symmetric logarithmic scaling
  • Interactive controls: Mouse hover for pixel values, dynamic zooming, and panning

Installation

From PyPI

pip install ndslice

From source

git clone https://github.com/henricryden/ndslice.git
cd ndslice
pip install -e .

Usage

Basic Usage

The ndslice() function opens an interactive window to explore your N-dimensional arrays:

from ndslice import ndslice
import numpy as np

# View a 4D array
data_4d = np.random.randn(10, 20, 30, 40)
ndslice(data_4d)

# View complex FFT data
fft_data = np.fft.fftn(data_4d)
ndslice(fft_data, title='FFT Data')

Interactive Features

  • Dimension Selection: Click Y/X buttons to choose which dimensions to display
  • Slicing: Use spinboxes to select the slice index for other dimensions
  • FFT Transforms:
    • Left-click dimension labels to apply FFT
    • Right-click to apply inverse FFT
    • Click again to return to native domain
  • Channel Selection (for complex data): Real, Imaginary, Magnitude, or Phase
  • Scale Options: Linear or Symmetric Log scaling
  • Display Modes: Square pixels, square FOV, or fit to window
  • View Modes: Switch between 2D image view and 1D line plot
  • Complex Data: View real, imaginary, magnitude, or phase components

Requirements

  • Python >= 3.8
  • NumPy >= 1.20.0
  • PyQtGraph >= 0.12.0
  • PyQt5 >= 5.15.0

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments

Built with PyQtGraph for high-performance visualization.

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

ndslice-0.1.1.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

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

ndslice-0.1.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file ndslice-0.1.1.tar.gz.

File metadata

  • Download URL: ndslice-0.1.1.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for ndslice-0.1.1.tar.gz
Algorithm Hash digest
SHA256 af74cb6eea75650b10a331164b66a6067382b8e807264be7c979a8b40f4c01fe
MD5 cafe5ebdf16a5e47fce9d2a56b1eb44a
BLAKE2b-256 715aaee090e55346b549cede51675c24a9a1825067877c76c64b64119dbfa757

See more details on using hashes here.

File details

Details for the file ndslice-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ndslice-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for ndslice-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0edc52d69d317fd60cbdcfd8783c8856cd394db7256665eac2484a4d9c7c6bfb
MD5 582593dcdd4da516974aef298d3a60b7
BLAKE2b-256 fdcd2d90a925765b4cb303e57746364e0ce43a890855f4a96b19e9c7e56d67de

See more details on using hashes here.

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