flimkit-web-ui 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2026 FLIMKit
4
+
5
+ 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:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ **If you use FLIMKit in academic work, a citation or acknowledgment is appreciated.** There is no formal publication yet but it is planned — for now, please reference the GitHub repository and the author's name.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,107 @@
1
+ Metadata-Version: 2.4
2
+ Name: flimkit-web-ui
3
+ Version: 0.1.0
4
+ Summary: A browser front end for FLIMKit: every desktop mode, driven from a web page
5
+ Author-email: Alex Hunt <alexander.hunt@ed.ac.uk>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/FLIMKit/flimkit-web-ui
8
+ Project-URL: FLIMKit, https://github.com/FLIMKit/FLIMKit
9
+ Keywords: FLIM,FLIMKit,plugin,fluorescence,lifetime,phasor,web
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
14
+ Requires-Python: >=3.12
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE.md
17
+ Provides-Extra: test
18
+ Requires-Dist: pytest; extra == "test"
19
+ Requires-Dist: numpy; extra == "test"
20
+ Requires-Dist: matplotlib; extra == "test"
21
+ Requires-Dist: pillow; extra == "test"
22
+ Dynamic: license-file
23
+
24
+ # flimkit-web-ui
25
+
26
+ A browser front end for [FLIMKit](https://github.com/FLIMKit/FLIMKit). Start FLIMKit, open `http://127.0.0.1:8765`, and every desktop mode is there in a web page: Single FOV, Tile Stitch, Phasor, Batch and the Machine IRF builder, plus the project browser, synthetic data generator, preferences and plugin manager.
27
+
28
+ It is an add-on, not a second copy of the app. The page drives the desktop window's own form variables and presses its own buttons, so a fit started from the browser runs through exactly the same code path as one started from the desktop, and the two stay in sync.
29
+
30
+ ## Install
31
+
32
+ ```
33
+ pip install flimkit-web-ui
34
+ ```
35
+
36
+ Install it into the same Python environment FLIMKit runs from. FLIMKit finds it through the `flimkit.plugins` entry point, so there is nothing else to wire up. On the next start the server comes up automatically and **Tools > Open Web UI** opens it in your browser.
37
+
38
+ Verify the install with:
39
+
40
+ ```bash
41
+ python -c "import flimkit_web_ui; print('ok')"
42
+ ```
43
+
44
+ Tested with FLIMKit 0.13.4.
45
+
46
+ ## What is in the page
47
+
48
+ | Tab | What you can do |
49
+ |---|---|
50
+ | **Single FOV** | Pick a file or z-stack, all eight IRF methods, fit model and components, fit window, masking, pile-up and background correction, run and cancel the fit. The live preview shows intensity, lifetime, decay and residuals, with the colour scale, view and τ weighting controls and the z-slider. |
51
+ | **ROI analysis** | Draw rectangle, ellipse, polygon and freehand regions straight onto the preview, rename, delete, import and export GeoJSON and CSV, and fit an ROI decay with the fit plot and table shown in the page. |
52
+ | **Tile Stitch** | All four pipelines (stitch only, stitch and fit, per-tile fit, multidimensional series), per-pixel map exports, tile registration and per-tile IRFs. |
53
+ | **Phasor** | Load a PTU or resume a session, click the phasor plot to place cursors, drag them, polygon cursors, radius and ratio, phasor filters, Find Peaks (with one-click cursors on each peak), FRET trajectory and donor FRET fit, cursor-gated decay fit, save the session. |
54
+ | **Batch** | Multi-tile ROI, single FOV and timelapse batches, with every export option and the timelapse reference lifetimes. |
55
+ | **Machine IRF** | Build a machine IRF from PTU and XLSX pairs and see the result plotted. |
56
+ | **Results** | The run log, fit summary table and CSV, image export (PNG, OME-TIFF, OME-Zarr), the output image browser, session save and restore, and expert settings. |
57
+ | **Tools** | Project folder browser and recent files, synthetic PTU generator, preferences, plugins, about, update check and error logs. |
58
+
59
+ Files are chosen with a file browser in the page, which lists folders on the machine FLIMKit is running on. Anything the desktop would offer as a save dialog is either written to the path you give or downloaded by the browser.
60
+
61
+ ## How it behaves
62
+
63
+ - **One app, shared state.** There is one FLIMKit window behind the page. Several tabs or people can open it, but they all control the same form and the same results, and the last edit wins. Only one fit runs at a time.
64
+ - **Dialogs move to the page while you use it.** While a web page is open and has been used in the last 30 minutes, FLIMKit's desktop pop-ups (errors, warnings, "missing input", channel and frequency prompts) appear as notices in the page instead of blocking the desktop. Close the tab and the desktop behaves normally again.
65
+ - **Progress windows still appear on the desktop.** The page mirrors their progress and can cancel them.
66
+
67
+ ## Security
68
+
69
+ The server listens on `127.0.0.1` only and has no authentication. Anyone who can reach it can browse your files and run FLIMKit, so do not expose it to a network you do not trust.
70
+
71
+ The address is read from the `plugin:web_ui` section of `~/.flimkit/config.json`:
72
+
73
+ ```json
74
+ {
75
+ "plugin:web_ui": {
76
+ "host": "127.0.0.1",
77
+ "port": 8765
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## Working on it
83
+
84
+ ```bash
85
+ pip install --no-deps 'flimkit @ git+https://github.com/FLIMKit/FLIMKit'
86
+ pip install -e '.[test]'
87
+ pytest -q
88
+ ```
89
+
90
+ The tests are headless: they check the plugin registers, the dialog and threading bridge, the API helpers and the HTTP server against a stand-in app, so they need no display and no FLIMKit scientific stack.
91
+
92
+ | File | What it does |
93
+ |---|---|
94
+ | `flimkit_web_ui/__init__.py` | Registers the startup hook that starts the server and the **Tools > Open Web UI** entry |
95
+ | `flimkit_web_ui/server.py` | The HTTP server and its routes |
96
+ | `flimkit_web_ui/bridge.py` | Runs calls on the Tk thread, routes desktop dialogs to the page, tracks progress windows and renders the desktop's figures |
97
+ | `flimkit_web_ui/api.py` | Form fields, app state, Single FOV, ROIs, results and expert settings |
98
+ | `flimkit_web_ui/api_modes.py` | Tile Stitch, Batch, Machine IRF, Phasor, projects and the tools menu |
99
+ | `flimkit_web_ui/page.html`, `core.js`, `fov.js`, `modes.js` | The page |
100
+
101
+ ## Releasing
102
+
103
+ Push a tag like `v0.1.0`. The `publish` workflow builds the package and uploads it to PyPI through trusted publishing, and the `release` workflow attaches the wheel and sdist to a GitHub release.
104
+
105
+ ## Licence
106
+
107
+ MIT, same as FLIMKit.
@@ -0,0 +1,84 @@
1
+ # flimkit-web-ui
2
+
3
+ A browser front end for [FLIMKit](https://github.com/FLIMKit/FLIMKit). Start FLIMKit, open `http://127.0.0.1:8765`, and every desktop mode is there in a web page: Single FOV, Tile Stitch, Phasor, Batch and the Machine IRF builder, plus the project browser, synthetic data generator, preferences and plugin manager.
4
+
5
+ It is an add-on, not a second copy of the app. The page drives the desktop window's own form variables and presses its own buttons, so a fit started from the browser runs through exactly the same code path as one started from the desktop, and the two stay in sync.
6
+
7
+ ## Install
8
+
9
+ ```
10
+ pip install flimkit-web-ui
11
+ ```
12
+
13
+ Install it into the same Python environment FLIMKit runs from. FLIMKit finds it through the `flimkit.plugins` entry point, so there is nothing else to wire up. On the next start the server comes up automatically and **Tools > Open Web UI** opens it in your browser.
14
+
15
+ Verify the install with:
16
+
17
+ ```bash
18
+ python -c "import flimkit_web_ui; print('ok')"
19
+ ```
20
+
21
+ Tested with FLIMKit 0.13.4.
22
+
23
+ ## What is in the page
24
+
25
+ | Tab | What you can do |
26
+ |---|---|
27
+ | **Single FOV** | Pick a file or z-stack, all eight IRF methods, fit model and components, fit window, masking, pile-up and background correction, run and cancel the fit. The live preview shows intensity, lifetime, decay and residuals, with the colour scale, view and τ weighting controls and the z-slider. |
28
+ | **ROI analysis** | Draw rectangle, ellipse, polygon and freehand regions straight onto the preview, rename, delete, import and export GeoJSON and CSV, and fit an ROI decay with the fit plot and table shown in the page. |
29
+ | **Tile Stitch** | All four pipelines (stitch only, stitch and fit, per-tile fit, multidimensional series), per-pixel map exports, tile registration and per-tile IRFs. |
30
+ | **Phasor** | Load a PTU or resume a session, click the phasor plot to place cursors, drag them, polygon cursors, radius and ratio, phasor filters, Find Peaks (with one-click cursors on each peak), FRET trajectory and donor FRET fit, cursor-gated decay fit, save the session. |
31
+ | **Batch** | Multi-tile ROI, single FOV and timelapse batches, with every export option and the timelapse reference lifetimes. |
32
+ | **Machine IRF** | Build a machine IRF from PTU and XLSX pairs and see the result plotted. |
33
+ | **Results** | The run log, fit summary table and CSV, image export (PNG, OME-TIFF, OME-Zarr), the output image browser, session save and restore, and expert settings. |
34
+ | **Tools** | Project folder browser and recent files, synthetic PTU generator, preferences, plugins, about, update check and error logs. |
35
+
36
+ Files are chosen with a file browser in the page, which lists folders on the machine FLIMKit is running on. Anything the desktop would offer as a save dialog is either written to the path you give or downloaded by the browser.
37
+
38
+ ## How it behaves
39
+
40
+ - **One app, shared state.** There is one FLIMKit window behind the page. Several tabs or people can open it, but they all control the same form and the same results, and the last edit wins. Only one fit runs at a time.
41
+ - **Dialogs move to the page while you use it.** While a web page is open and has been used in the last 30 minutes, FLIMKit's desktop pop-ups (errors, warnings, "missing input", channel and frequency prompts) appear as notices in the page instead of blocking the desktop. Close the tab and the desktop behaves normally again.
42
+ - **Progress windows still appear on the desktop.** The page mirrors their progress and can cancel them.
43
+
44
+ ## Security
45
+
46
+ The server listens on `127.0.0.1` only and has no authentication. Anyone who can reach it can browse your files and run FLIMKit, so do not expose it to a network you do not trust.
47
+
48
+ The address is read from the `plugin:web_ui` section of `~/.flimkit/config.json`:
49
+
50
+ ```json
51
+ {
52
+ "plugin:web_ui": {
53
+ "host": "127.0.0.1",
54
+ "port": 8765
55
+ }
56
+ }
57
+ ```
58
+
59
+ ## Working on it
60
+
61
+ ```bash
62
+ pip install --no-deps 'flimkit @ git+https://github.com/FLIMKit/FLIMKit'
63
+ pip install -e '.[test]'
64
+ pytest -q
65
+ ```
66
+
67
+ The tests are headless: they check the plugin registers, the dialog and threading bridge, the API helpers and the HTTP server against a stand-in app, so they need no display and no FLIMKit scientific stack.
68
+
69
+ | File | What it does |
70
+ |---|---|
71
+ | `flimkit_web_ui/__init__.py` | Registers the startup hook that starts the server and the **Tools > Open Web UI** entry |
72
+ | `flimkit_web_ui/server.py` | The HTTP server and its routes |
73
+ | `flimkit_web_ui/bridge.py` | Runs calls on the Tk thread, routes desktop dialogs to the page, tracks progress windows and renders the desktop's figures |
74
+ | `flimkit_web_ui/api.py` | Form fields, app state, Single FOV, ROIs, results and expert settings |
75
+ | `flimkit_web_ui/api_modes.py` | Tile Stitch, Batch, Machine IRF, Phasor, projects and the tools menu |
76
+ | `flimkit_web_ui/page.html`, `core.js`, `fov.js`, `modes.js` | The page |
77
+
78
+ ## Releasing
79
+
80
+ Push a tag like `v0.1.0`. The `publish` workflow builds the package and uploads it to PyPI through trusted publishing, and the `release` workflow attaches the wheel and sdist to a GitHub release.
81
+
82
+ ## Licence
83
+
84
+ MIT, same as FLIMKit.
@@ -0,0 +1,18 @@
1
+ import webbrowser
2
+
3
+ from flimkit.plugins import startup, tool
4
+
5
+ from . import server
6
+
7
+ FLIMKIT_PLUGIN_API = 1
8
+
9
+
10
+ @startup(id='web_ui', order=900)
11
+ def launch_web_ui(app):
12
+ server.start(app)
13
+
14
+
15
+ @tool(id='open_web_ui', label='Open Web UI', menu='Tools', order=850)
16
+ def open_web_ui(app):
17
+ server.start(app)
18
+ webbrowser.open(server.url())