Skip to main content

A simple plugin to interact with images Fourier transforms

Project description

napari-ft

License BSD-3 PyPI Python Version tests codecov napari hub npe2 Copier

A napari plugin for interactive Fourier transform filtering


This napari plugin was generated with copier using the napari-plugin-template (None).

Features

Interactive Fourier Transform Filter Widget

This widget allows you to:

  • Select a 2D image from the napari viewer
  • View its FFT-shifted Fourier transform (log magnitude) in the widget
  • Interactively draw rectangular or circular regions on the Fourier transform
    • Left-click and drag: Create inclusion regions (frequencies to keep)
    • Right-click and drag: Create exclusion regions (frequencies to remove)
    • Middle-click and drag: Pan the view
    • Mouse wheel: Zoom in/out
  • Toggle between rectangle and circle shape modes
  • Apply inverse Fourier transform with frequency masking
  • See real-time updates of the filtered image as you draw new regions
  • Reset boxes or view independently

The filtered image automatically updates as you draw, providing immediate visual feedback. The widget tracks changes to the source image data and scale, keeping everything synchronized.

How to Use

  1. Load a 2D image into napari viewer
  2. Open the widget: Plugins -> napari-ft -> Fourier Transform Filter
  3. Select your image from the dropdown menu
  4. The FFT-shifted Fourier transform appears in the widget
  5. Draw regions on the Fourier transform:
    • Left-click and drag to select frequencies to keep
    • Right-click and drag to exclude specific frequencies
    • Use "Shape" button to toggle between rectangles and circles
  6. The filtered image appears automatically and updates in real-time
  7. Use mouse wheel to zoom, middle-click to pan
  8. Click "Reset Boxes" to clear all regions or "Reset View" to reset zoom/pan

Installation

You can install napari-ft via pip:

pip install napari-ft

If napari is not already installed, you can install napari-ft with napari and Qt via:

pip install "napari-ft[all]"

Testing

To test the widget, run the included test script:

python test_ft_widget.py

This will open napari with a test image containing multiple frequency components.

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the BSD-3 license, "napari-ft" is free and open source software

Issues

If you encounter any problems, please [file an issue] along with a detailed description.

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

napari_ft-0.1.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

napari_ft-0.1.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: napari_ft-0.1.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for napari_ft-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e975ec22600f0267a497811f0dfee56f6764342c8cea038abb4ec419db586250
MD5 b3c63a9b87c5486c29d7b092bd4c437a
BLAKE2b-256 47ff37a0db788321f1991ba5d52a6f3116c130f6a5f0bade2936b6eba7721e10

See more details on using hashes here.

File details

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

File metadata

  • Download URL: napari_ft-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for napari_ft-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eff5799678a23ddcd158037bed143abe48b7e4bdc94950de432d5a44f5a9c5dd
MD5 d4b146702faa6cedfdd73ec8d2869300
BLAKE2b-256 eeac9d4a18fce852f4db7ab9a4ee2f39b2f490cf6a04dc6b49d5c3c32c0113c0

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