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.0.tar.gz (15.0 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.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ndslice-0.1.0.tar.gz
  • Upload date:
  • Size: 15.0 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.0.tar.gz
Algorithm Hash digest
SHA256 b4f162cb076b88595b75c445357da19a17e1a2bf280b7a21fff361cd0d1f8651
MD5 12473155916cf93e4c6236105feba1dd
BLAKE2b-256 f6b545c59a171129497e2f6ef4d1f521d8b24f57af73938ef3cb907bdf4d42ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ndslice-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d916d83273eac6fb963a7c81bdd14ad999301e788bc37de330a7abdb153fa2c
MD5 7f124c80942ae7e6ab4678a722af4ecb
BLAKE2b-256 eb6ca75c1cd74043a6d4452e75ed39cd54822a6ed6f54babef91b81500cb294d

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