Panel+Bokeh-based GUI Toolkit for LiberTEM
Project description
Widget-based web GUI package intended to support the LiberTEM library for electron microscopy data analysis. The primary usage environment is from within Jupyter Notebooks. Built using the Panel and Bokeh frameworks.
Runs LiberTEM User Defined Functions (UDFs) in interactive panels, which simplies adjustment of parameters and exploring data.
The framework is capable of running certain analyses on top of the LiberTEM-live framework, allowing for interactive live acquisitions in a Jupyter Notebook.
There are two ways to use the UI tools:
as standalone analysis windows connected to a dataset
through a
UIContextwindow manager, which can dynamically add and remove windows as required
The standalone case (where ctx, ds are
LiberTEM Context and DataSet objects):
from libertem_ui.windows.com import CoMImagingWindow
# Create the window using a context and dataset
com_window = CoMImagingWindow.using(ctx, ds)
# Display the window itself
com_window.layout()
# Results from the window are stored in a dataframe-based results manager
# This provides a GUI result browser using a .layout() method
com_window.results_manager.layout()
# Results in the manager can be extracted into Python objects using methods
result_id = '3kd9sn'
rc = com_window.results_manager.get_result_container(result_id)
assert isinstance(rc.data, np.ndarray)
A second standalone window can be linked to the first,
and will share the data and LiberTEM resources. Results from
both windows will appear in the same results_manager.
from libertem_ui.windows.imaging import VirtualDetectorWindow
# Create new window linked to the previous window
v_window = VirtualDetectorWindow.linked_to(com_window)
# Display the new window
v_window.layout()
When two-or-more windows are linked, certain results can be displayed
in other windows to help navigate the data. For example, a log-sum over
all frames generated by the FrameImagingWindow can be displayed
in the VirtualDetectorWindow frame plot, to help parametrize an
annular darkfield analysis.
For a more tightly-integrated experience, the managed UIContext
can dynamically add and remove windows, as well as run analyses
from multiple windows in parallel:
from libertem_ui.api import UIContext
# Create the UIContext object
# This orchestrates:
# - add/remove analysis windows
# - providing work to the LiberTEM Context
# - managing and saving results from analyses
ui_context = UIContext.for_offline(ctx, ds)
# Display main window for running analyses
ui_context.layout()
# Display table / dataframe-based results manager
ui_context.results_manager.layout()
see examples/ for some more complete example use cases.
Installation
libertem_ui requires Python 3.10 or greater.
As always, it is advisable to use a virtual or conda environment for testing packages.
pip install libertem-ui
The optional dependencies libertem-ui[libertem] and libertem-ui[notebook] install the necessary components to run LiberTEM windows and Jupyter notebooks, respectively.
Disclaimer
LiberTEM-panel-ui is at an early proof-of-concept stage. All interfaces
and functionality is subject to change in the future. Notably, the primary usage
environment is in a Jupyter Notebook - standalone usage as a web app through
panel serve is not well tested.
If you are interested in the project and would like to see it taken further, please don’t hesitate to get in touch by posting an Issue.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file libertem_ui-0.0.1.tar.gz.
File metadata
- Download URL: libertem_ui-0.0.1.tar.gz
- Upload date:
- Size: 116.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc166552a91df68d80255fea630edae87e3a8755f223dfcf6104840a9efe62d7
|
|
| MD5 |
4e39b94504f4c49e937a9e0ffc3b8be8
|
|
| BLAKE2b-256 |
57f90b2b5e28570712ce9af2798ffcb316288fcb0a98a40266d78cf1237770a6
|
Provenance
The following attestation bundles were made for libertem_ui-0.0.1.tar.gz:
Publisher:
python-publish.yml on LiberTEM/LiberTEM-panel-ui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
libertem_ui-0.0.1.tar.gz -
Subject digest:
fc166552a91df68d80255fea630edae87e3a8755f223dfcf6104840a9efe62d7 - Sigstore transparency entry: 246126653
- Sigstore integration time:
-
Permalink:
LiberTEM/LiberTEM-panel-ui@f3bb5589c976ab90a06321c2098cb6719b1127d7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/LiberTEM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f3bb5589c976ab90a06321c2098cb6719b1127d7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file libertem_ui-0.0.1-py3-none-any.whl.
File metadata
- Download URL: libertem_ui-0.0.1-py3-none-any.whl
- Upload date:
- Size: 143.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5325fdfc5f580609444ee17a7f5b9a4189e90de27547b18ff6c1145caabf93ac
|
|
| MD5 |
5a637a413bbb06e6af10b0e585a80141
|
|
| BLAKE2b-256 |
ce740c9e0f1a350ae1246ec7ecff2691795b9cd2d8b4603ece5c3cdd28e1a07f
|
Provenance
The following attestation bundles were made for libertem_ui-0.0.1-py3-none-any.whl:
Publisher:
python-publish.yml on LiberTEM/LiberTEM-panel-ui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
libertem_ui-0.0.1-py3-none-any.whl -
Subject digest:
5325fdfc5f580609444ee17a7f5b9a4189e90de27547b18ff6c1145caabf93ac - Sigstore transparency entry: 246126654
- Sigstore integration time:
-
Permalink:
LiberTEM/LiberTEM-panel-ui@f3bb5589c976ab90a06321c2098cb6719b1127d7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/LiberTEM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f3bb5589c976ab90a06321c2098cb6719b1127d7 -
Trigger Event:
workflow_dispatch
-
Statement type: