Skip to content

Commit a2c21e8

Browse files
authored
Merge pull request #63 from flika-org/dev
Merging Dev into Master
2 parents a509a4a + 9f47604 commit a2c21e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+9999
-5430
lines changed

.github/workflows/publish-to-pypi.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Publish to PyPi
2-
on: push
2+
on:
3+
push:
4+
branches:
5+
- master
36
jobs:
47
publish:
58
name: publish
@@ -12,7 +15,7 @@ jobs:
1215
- name: Set up Python
1316
uses: actions/setup-python@v4
1417
with:
15-
python-version: "3.11"
18+
python-version: "3.12"
1619
- name: Build package
1720
run: |
1821
python -m pip install -U pip build

.github/workflows/run-tests.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Run Tests
2+
3+
on:
4+
# Only run on a branch that doesn't exist
5+
push:
6+
branches: [ "branch-that-does-not-exist" ]
7+
pull_request:
8+
branches: [ "branch-that-does-not-exist" ]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ["3.13"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install system dependencies for PySide6
26+
run: |
27+
sudo apt-get update
28+
# Install Qt dependencies based on Qt X11 requirements documentation
29+
# https://doc.qt.io/qt-6/linux-requirements.html
30+
sudo apt-get install -y \
31+
libegl1 \
32+
libfontconfig1 \
33+
libxcb1 \
34+
libx11-6 \
35+
libx11-xcb1 \
36+
libxcb-glx0 \
37+
libxcb-icccm4 \
38+
libxcb-image0 \
39+
libxcb-keysyms1 \
40+
libxcb-randr0 \
41+
libxcb-render0 \
42+
libxcb-render-util0 \
43+
libxcb-shape0 \
44+
libxcb-shm0 \
45+
libxcb-sync1 \
46+
libxcb-util1 \
47+
libxcb-xfixes0 \
48+
libxcb-xkb1 \
49+
libxkbcommon0 \
50+
libxkbcommon-x11-0 \
51+
libdbus-1-3
52+
53+
- name: Install dependencies
54+
run: |
55+
python -m pip install --upgrade pip
56+
python -m pip install .[dev]
57+
58+
- name: Run tests
59+
run: |
60+
pytest flika --cov=flika
61+
62+
- name: Upload coverage to Codecov
63+
uses: codecov/codecov-action@v3
64+
with:
65+
fail_ci_if_error: false

AUTHORS.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.

CHANGELOG.rst

Lines changed: 0 additions & 18 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The MIT License (MIT)
2-
Copyright (c) 2015-2017 Kyle Ellefsen
2+
Copyright (c) 2015-2025 Kyle Ellefsen
33

44
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
55

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
recursive-include flika *.ui *.png *.ico
22
include README.md
3-
include flika.desktop
3+
include flika.desktop
4+
recursive-include examples *.py

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# flika
2+
3+
![flika screencapture](flika/docs/_static/img/flika_screencapture.gif)
4+
5+
**flika** is an interactive image processing program for biologists written in Python.
6+
7+
## Website
8+
[flika-org.github.io](http://flika-org.github.io/)
9+
10+
## Documentation
11+
[flika-org.github.io/contents.html](http://flika-org.github.io/contents.html)
12+
13+
## Install
14+
[flika-org.github.io/getting-started.html#installation](http://flika-org.github.io/getting-started.html#installation)
15+
16+
## Development
17+
18+
This is how Kyle installs Flika for development on a mac.
19+
20+
```fish
21+
brew install [email protected]
22+
python3.13 -m venv ~/venvs/flika; source ~/venvs/flika/bin/activate.fish; python -m pip install --upgrade pip;
23+
cd ~/git
24+
git clone https://github.com/flika-org/flika.git
25+
cd ~/git/flika
26+
python -m pip install -e .
27+
ipython
28+
In [1]: import flika
29+
In [2]: flika.start_flika()
30+
```
31+
32+
For tests:
33+
```fish
34+
pip install -e .[dev]
35+
pytest flika --cov=flika
36+
```
37+
38+
Cleanup :
39+
```fish
40+
deactivate
41+
rm -r ~/venvs/flika
42+
```
43+
44+
45+
## Contributors
46+
47+
- [Kyle Ellefsen](https://github.com/KyleEllefsen)
48+
- [Brett Settle](https://github.com/BrettJSettle)
49+
- [George Dickinson](https://github.com/gddickinson)
50+
- [Kevin Tarhan](https://github.com/KevinTarhan)
51+
52+
53+
## Development
54+
55+
- Ruff is used for linting/formatting
56+
- VSCode/Cursor is the usually IDE
57+
- Python 3.13 is the (current) development version
58+
- PySide6 is used for the GUI

README.rst

Lines changed: 0 additions & 23 deletions
This file was deleted.

examples/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Flika Examples
2+
3+
This directory contains example scripts demonstrating various features and use cases of Flika, an interactive image processing program for biologists.
4+
5+
## Running Examples
6+
7+
### Prerequisites
8+
9+
These examples assume you have Flika installed in your Python environment. If you haven't already installed Flika, follow these steps:
10+
11+
```bash
12+
# Clone the repository (if you haven't already)
13+
git clone https://github.com/flika-org/flika.git
14+
cd flika
15+
16+
# Create and activate a virtual environment (recommended)
17+
python -m venv ~/venvs/flika
18+
source ~/venvs/flika/bin/activate
19+
20+
# Install flika in development mode
21+
pip install -e .
22+
```
23+
24+
### Running an Example
25+
26+
Each example can be run directly with Python:
27+
28+
```bash
29+
python examples/generate_random_video.py
30+
```
31+
32+
All examples launch an IPython interactive terminal by default, allowing you to interact with the flika objects after the initial script runs.
33+
34+
## Utils Directory
35+
36+
The `utils/` subdirectory contains shared code and utilities used across multiple examples:
37+
38+
- `ipython_helper.py`: Helpers for running scripts in IPython
39+
- Common initialization code
40+
- Shared helper functions
41+
42+
### Using the IPython Helper
43+
44+
All examples use the `run_in_ipython` helper to create an interactive IPython environment. You can use this in your own examples:
45+
46+
```python
47+
from utils import run_in_ipython
48+
49+
def my_flika_demo():
50+
import flika
51+
flika.start_flika()
52+
# Your flika code here
53+
54+
if __name__ == "__main__":
55+
run_in_ipython(my_flika_demo)
56+
```

examples/generate_random_video.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""
2+
Random Image Stack Example
3+
4+
This example demonstrates how to generate a random image stack using flika
5+
and perform basic operations on it.
6+
"""
7+
8+
from utils import run_in_ipython
9+
10+
11+
def random_image_demo():
12+
"""Generate a random image stack and display information about it."""
13+
import flika
14+
import flika.global_vars as g # noqa: F401
15+
16+
# Start flika
17+
print("Starting flika...")
18+
flika.start_flika()
19+
20+
# Generate a random image stack
21+
print("Generating random image stack...")
22+
window = flika.process.stacks.generate_random_image(nFrames=100, width=128)
23+
24+
# Display information about the generated image stack
25+
print(f"Created window: {window.name}")
26+
print(f"Image dimensions: {window.image.shape}")
27+
print(f"Data type: {window.image.dtype}")
28+
29+
30+
if __name__ == "__main__":
31+
# Run the demo in IPython
32+
run_in_ipython(random_image_demo)

0 commit comments

Comments
 (0)