Metadata-Version: 2.4
Name: chaldene
Version: 0.2.0
Summary: Visual Programming in JupyterLab for Image Processing
Project-URL: Homepage, https://github.com/c3di/chaldene.git
Project-URL: Bug Tracker, https://github.com/c3di/chaldene.git/issues
Project-URL: Repository, https://github.com/c3di/chaldene.git.git
Author-email: Fei Chen <boxchenfei@gmail.com>
License: BSD 3-Clause License
        
        Copyright (c) 2024, Fei Chen
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Keywords: jupyter,jupyterlab,jupyterlab-extension
Classifier: Framework :: Jupyter
Classifier: Framework :: Jupyter :: JupyterLab
Classifier: Framework :: Jupyter :: JupyterLab :: 4
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Requires-Dist: chaldene-super-resolution
Requires-Dist: comm==0.2.2
Requires-Dist: im2im
Requires-Dist: ipywidgets>=7.0.0
Requires-Dist: jupyter-server<3.0.0,>=2.0.0
Requires-Dist: jupyterlab<5.0.0,>=4.0.0
Requires-Dist: matplotlib==3.10.1
Requires-Dist: numpy==2.2.4
Requires-Dist: opencv-python-headless==4.11.0.86
Requires-Dist: pandas==2.2.3
Requires-Dist: pillow==11.1.0
Requires-Dist: pyimagej==1.7.0
Requires-Dist: requests>=2.28.0
Requires-Dist: scikit-image==0.25.2
Requires-Dist: scipy==1.15.2
Description-Content-Type: text/markdown

<h1 align="center">Chaldene</h1>

<p align="center">
<a href="https://pypi.org/project/chaldene/"><img src="https://img.shields.io/pypi/v/chaldene.svg" alt="PyPI Package"></a>
<a href="https://youtu.be/xu5FFn5Igi4"><img src="https://img.shields.io/badge/📺_Video-Teaser-red?logo=youtube" alt="Teaser"></a>
<a href="https://youtu.be/arSr3VAsaAg"><img src="https://img.shields.io/badge/📺_Video-Tutorial-red?logo=youtube" alt="Tutorial"></a>
<a href="https://youtu.be/_oGRUvKrpbU"><img src="https://img.shields.io/badge/📺_Video-Use_Cases-red?logo=youtube" alt="Use Cases"></a>
   <a href="https://mybinder.org/v2/gh/c3di/chaldene/HEAD"><img src="https://mybinder.org/badge_logo.svg" alt="Binder"></a>
<a href="./LICENSE"><img src="https://img.shields.io/badge/License-BSD%203--Clause-blue.svg" alt="License"></a>
</p>

<p align="center">
<em>Notebook-Embedded Visual Workflow Authoring for Scientific Image Processing</em>
</p>

<p align="center">
<img src="docs/assets/teaser.png" alt="Chaldene teaser">
</p>

## Key Features

- Low-barrier, drag-and-drop node-based authoring with an explicit, reusable workflow representation
- Image-specific inspection and comparison support, including branching, stepwise views, synchronized viewing, cursor linking, and difference overlays, with intermediate images captured as a visual trace
- Co-locates workflow structure, parameter settings, outputs, and narrative context within a single notebook artifact during authoring

## Installation

### Local Installation

The only external requirement is **OpenJDK 11** (required for
PyImageJ), for example with Conda:

```bash
conda install -c conda-forge "openjdk=11"
```

Then install Chaldene and launch JupyterLab:

```bash
pip install chaldene
jupyter lab
```

### Use Without Local Installation

Chaldene targets practitioners with limited programming experience, so it is
not intended to require manual installation and configuration by each end
user. Instead, it can be provided through preconfigured environments, such as
[Binder](https://mybinder.org/v2/gh/c3di/chaldene/HEAD), managed
JupyterHub/JupyterLab servers, or lab-maintained software images, allowing
practitioners to focus on workflow authoring rather than software
administration.

## Quick Start

1. **Create a new notebook**
   - Click "+" to create a new notebook
   - Add a Visual Code cell from the cell toolbar

2. **Start building workflows**
   - Drag and drop nodes to create your image processing workflows
   - Connect nodes to build workflows
   - Adjust parameters and inspect the outputs to refine the workflows

## Examples

📂 **Examples are available in the `use_cases/` folder**

Below are two representative workflows created by users, demonstrating Chaldene's capabilities for interactive image processing:

<p align="center">
<img src="docs/assets/task1.png" alt="Workflow 1: Image Analysis Pipeline" width="70%">
</p>

<p align="center">
<img src="docs/assets/task2.png" alt="Workflow 2: Processing Chain" width="70%">
</p>

## More Features

### Publish to Zenodo

Archive your workflow files or results to [Zenodo](https://zenodo.org) and mint a citable **DOI**, directly from JupyterLab.

1. Create a Zenodo [personal access token](https://zenodo.org/account/settings/applications/tokens/new/) with the `deposit:write` and `deposit:actions` scopes.
2. In the JupyterLab file browser, **right-click the empty area** and choose **Publish to Zenodo**.
3. In the dialog, select one or more files/folders to publish (folders are zipped automatically).
4. Enter your access token, then a title, author(s), and description.
5. All selected items are uploaded to a single Zenodo record and the minted **DOI** is shown when publishing completes.

### Python API

`ChaldeneClient` lets you control VP cells from Python — useful for driving
parameters with `ipywidgets`, running parameter sweeps, or integrating VP
cells into larger notebook workflows.

```python
from chaldene import ChaldeneClient

client = ChaldeneClient()
```

Once a VP cell is visible in the notebook, `client.get_ready_cell_ids()`
returns its ID. From there you can update node inputs and re-run the cell:

```python
cell_id = client.get_ready_cell_ids()[-1]
client.set_input(cell_id, node_id='1', handle_id='in1', value=[0.2, 0.8])
client.run(cell_id)
```

Combine with `ipywidgets.interact` for live parameter control:

```python
import ipywidgets as widgets

@widgets.interact(threshold=widgets.FloatSlider(min=0.0, max=1.0, step=0.05))
def update(threshold):
    ids = client.get_ready_cell_ids()
    if ids:
        client.set_input(ids[-1], '1', 'in1', [threshold, 0.9])
        client.run(ids[-1])
```

See [`api_tutorials/`](api_tutorials/) for full working examples.

## Development

- 📖 [Developer Guide](docs/README_DEVELOP.md) - Setup and development instructions
- 🚀 [Release Guide](docs/RELEASE.md) - Package Build and Release

<!--
## Cite

If you use this package in your research, please cite our paper:

**For the visual programming environment:**
```bibtex
@INPROCEEDINGS{chen2022Chaldene,
  author={Chen, Fei and Slusallek, Philipp and Müller, Martin and Dahmen, Tim},
  booktitle={2022 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC)}, 
  title={Chaldene: Towards Visual Programming Image Processing in Jupyter Notebooks}, 
  year={2022},
  volume={},
  number={},
  pages={1-3},
  doi={10.1109/VL/HCC53370.2022.9832910}}
```
-->
