py4D-browser plugin for flexible HDF5 and Zarr dataset loading
Project description
py4D-browser-flexloader
py4D-browser-flexloader is a plugin for
py4D-browser that adds a flexible
loader for HDF5 and Zarr datasets. It lets you browse datasets inside a file or
Zarr store, choose the data array to load, map arbitrary source dimensions into
py4DGUI's expected 4D datacube order, and preview the selected mapping before
loading.
This is useful for datasets that are not organized in the standard py4DSTEM file
layout, including files with multiple arrays, higher-dimensional arrays, and
flattened scan dimensions such as (Nscans, ky, kx).
Installation
You can install py4D-browser-flexloader directly from PyPI:
pip install py4d-browser-flexloader
Note:
- If you install into a fresh Python environment,
py4D-browserandpy4DSTEMwill be installed automatically as dependencies.- If you already have
py4D-browserinstalled, install this plugin into the same Python environment.
A step-by-step installation using conda looks like this:
conda create -n py4dgui python=3.12
conda activate py4dgui
python -m pip install --upgrade pip
python -m pip cache purge
pip install py4d-browser-flexloader
Usage
Start py4DGUI after activating the environment:
py4dgui
After installing this plugin, you should see a "Flex Loader" submenu under the "Plugins" menu. From there, choose the loader that matches your data source:
- Load HDF5 File... for
.h5,.hdf5,.emd,.mat, and.py4dstemfiles. - Load Zarr Directory... for directory-backed
.zarrstores. - Load Zarr Zip File... for Zarr stores saved as
.zipor.zarr.zipfiles.
The loader dialog shows the internal hierarchy of the selected file or store, including array paths, shapes, dtypes, chunks, and attributes. Once an array is selected, assign its dimensions to:
Scan YScan XDetector YDetector XFixed IndexFlattened Scan
Use Flattened Scan for datasets stored as (Nscans, ky, kx) or
(..., Nscans, ky, kx). The loader will factor the flattened scan axis into
Scan Y and Scan X before loading.
Click Update Preview to inspect a lightweight preview before loading. The preview reads only two 2D slices from the selected HDF5/Zarr dataset:
- a sqrt-scaled diffraction pattern from the central scan position
- an axial bright-field image from the central diffraction pixel
Click Load to create a py4DSTEM.DataCube from the selected 4D subset and
send it to py4DGUI. The raw source file is not modified. Calibration can be set
after loading using py4DGUI's calibration tools.
Both grouped Zarr stores and root-level Zarr arrays are supported.
License
GNU GPLv3
py4D-browser-flexloader is open source software distributed under a GPLv3 license. It is free to use, alter, or build on, provided that any work derived from py4D-browser-flexloader is also kept free and open.
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 py4d_browser_flexloader-0.0.5.tar.gz.
File metadata
- Download URL: py4d_browser_flexloader-0.0.5.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21141c81d41ecf64a11153e83587750365621d2b11b2ad93bca2798f88d1fda5
|
|
| MD5 |
afe5602eb3f9b734d4609c7f85a489b1
|
|
| BLAKE2b-256 |
adf74761ef1a1e880e6c8c81fa8e1fc45dfe741537ea75e9b8df36a645a9c07f
|
Provenance
The following attestation bundles were made for py4d_browser_flexloader-0.0.5.tar.gz:
Publisher:
publish_pypi.yml on chiahao3/py4D-browser-flexloader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py4d_browser_flexloader-0.0.5.tar.gz -
Subject digest:
21141c81d41ecf64a11153e83587750365621d2b11b2ad93bca2798f88d1fda5 - Sigstore transparency entry: 1435866663
- Sigstore integration time:
-
Permalink:
chiahao3/py4D-browser-flexloader@686d7b8897d5b807677f9309f272dc901e2fbf67 -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/chiahao3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@686d7b8897d5b807677f9309f272dc901e2fbf67 -
Trigger Event:
release
-
Statement type:
File details
Details for the file py4d_browser_flexloader-0.0.5-py3-none-any.whl.
File metadata
- Download URL: py4d_browser_flexloader-0.0.5-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e6939da5e1966cccb9fd853c19091285a24cf985a76e1441e4e908b7d18acb0
|
|
| MD5 |
c5c0a3112f152d07846beff124a78cdb
|
|
| BLAKE2b-256 |
49c18b571fd851ab194f45151b905b692077e3a108888a7f7ca428562687e107
|
Provenance
The following attestation bundles were made for py4d_browser_flexloader-0.0.5-py3-none-any.whl:
Publisher:
publish_pypi.yml on chiahao3/py4D-browser-flexloader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py4d_browser_flexloader-0.0.5-py3-none-any.whl -
Subject digest:
4e6939da5e1966cccb9fd853c19091285a24cf985a76e1441e4e908b7d18acb0 - Sigstore transparency entry: 1435866722
- Sigstore integration time:
-
Permalink:
chiahao3/py4D-browser-flexloader@686d7b8897d5b807677f9309f272dc901e2fbf67 -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/chiahao3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@686d7b8897d5b807677f9309f272dc901e2fbf67 -
Trigger Event:
release
-
Statement type: