Skip to main content

Linescan kymograph blood flow analysis.

Project description

KymFlow

PyPI version PyPI - Python Version License: GPL v3+ Tests codecov

KymFlow is a NiceGUI-based application for browsing kymograph TIFF files, editing metadata, and running Radon-based flow analysis.

The backend lives in src/kymflow_core and is completely GUI-agnostic, so scripts and notebooks can reuse the same API for analysis, metadata editing, or batch processing.


Requirements

  • Python 3.11+
  • uv for dependency management (recommended)

Quick Start

Install and Run GUI

  1. Create a virtual environment:

    python -m venv kymflow-venv

  2. Activate the virtual environment:

    # On macOS/Linux:
    source kymflow-venv/bin/activate
    
    # On Windows:
    kymflow-venv\Scripts\activate
    
  3. Install KymFlow with GUI dependencies:

    pip install 'kymflow[gui]'
    
  4. Run the GUI:

    python -m kymflow_gui.main
    

    The GUI will open in your default web browser at http://localhost:8080 (or the next available port).

Getting the Source

Clone the repository (or download the ZIP) from GitHub:

git clone https://github.com/mapmanager/kymflow.git
cd kymflow

All commands below assume you are in the project root.


Installation (uv)

KymFlow uses a src/ layout and should be installed in editable mode. With uv this is a single command:

uv pip install -e ".[gui]"

This creates (or updates) .venv/, installs the package in editable mode, and pulls in the GUI + dev extras. If you add/remove dependencies in pyproject.toml, rerun the same command. Regular source edits do not require reinstalling.

Not using uv? Any standard tool can install the same extras via: pip install -e ".[gui]" or the equivalent in your environment.


Running the GUI

Launch the NiceGUI app with:

uv run python -m kymflow_gui.main

This automatically uses the uv-managed environment and keeps editable imports intact. The GUI defaults to port 8080; tweak defaults in src/kymflow_gui/config.py if needed.


Running Tests

uv pip install -e ".[test]"
uv run pytest tests/                    # Run all tests
uv run pytest tests/kymflow_core/      # Run only core tests
uv run pytest tests/kymflow_gui/       # Run only GUI tests (when you add them)

Run tests without data using

uv run pytest -m "not requires_data"

Working with Jupyter Notebooks

Install the optional notebook extras (once):

uv pip install -e ".[notebook]"

Launch Jupyter Lab inside the repo (it will open in the notebooks/ folder by default):

uv run jupyter lab --notebook-dir notebooks

You can also use jupyter notebook if you prefer the classic interface. All dependencies run inside the same uv-managed environment.


Project Layout

kymflow/
├─ src/
│  ├─ kymflow_core/       # backend (KymFile, metadata, analysis, repository)
│  └─ kymflow_gui/        # NiceGUI frontend (layout, components)
├─ tests/                 # unit/integration tests
├─ pyproject.toml
├─ README.md
└─ .venv/                 # uv-managed virtualenv

Contributing

Issues and pull requests are welcome. Please include clear steps to reproduce bugs and run uv run pytest before submitting changes. More detailed guidelines will be added later.

Troubleshooting

To kill a stale nicegui. By default it should be running on port 8080.

sudo lsof -iTCP:8080 -sTCP:LISTEN

Then look for pid and kill <pid>

Development

To push a new version from local dev machine

edit version in pyproject.toml

version = "0.1.1"

Then

git commit -am "Bump version to 0.1.1"

git tag -a v0.1.1 -m "KymFlow 0.1.1"
git push origin main
git push origin v0.1.1

To append info to macOS app

Build your macOS app bundle and go to:

  • GitHub → Releases → “Draft a new release”
  • Select tag v0.1.1
  • In the description, paste the 0.1.1 section from CHANGELOG.md.
  • Attach the macOS .dmg / .zip / .app as an asset.
  • Publish release.

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

kymflow-0.1.2.tar.gz (3.1 MB view details)

Uploaded Source

Built Distribution

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

kymflow-0.1.2-py3-none-any.whl (82.2 kB view details)

Uploaded Python 3

File details

Details for the file kymflow-0.1.2.tar.gz.

File metadata

  • Download URL: kymflow-0.1.2.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for kymflow-0.1.2.tar.gz
Algorithm Hash digest
SHA256 18d8fa3c5d3f2c1801efa92b52d3f193052f4638d7e14851be9a9f900ca2463f
MD5 257d3d4480e2b1a0f9a656e550165f60
BLAKE2b-256 335d4973c7b3c37f42f01f3c3e1a9fa35f59f226bf964d843c61af4ac2da0f4c

See more details on using hashes here.

File details

Details for the file kymflow-0.1.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for kymflow-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e7e81f5b4a9fae13f7b12a5290487a636982beb67fab9977fe51ea6a8b53f00e
MD5 f330e7cf52df9a7dd9746e96b14b890e
BLAKE2b-256 5ece51f1cf90deb4b9d0b5a0a176de83057b3287a0987da23b70eb49b9edc9b5

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