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.
Metadata
Release files for py4D-browser-flexloader 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py4d_browser_flexloader-0.0.5.tar.gz | 24.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py4d_browser_flexloader-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 49.2 kB
Release files / py4d_browser_flexloader-0.0.5.tar.gz
| Download URL | py4d_browser_flexloader-0.0.5.tar.gz |
|---|---|
| Size | 24.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21141c81d41ecf64a11153e83587750365621d2b11b2ad93bca2798f88d1fda5
|
|
BLAKE2b-256 checksum How to use checksums |
adf74761ef1a1e880e6c8c81fa8e1fc45dfe741537ea75e9b8df36a645a9c07f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 3, 2026.
Transparency logRelease files / py4d_browser_flexloader-0.0.5-py3-none-any.whl
| Download URL | py4d_browser_flexloader-0.0.5-py3-none-any.whl |
|---|---|
| Size | 24.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e6939da5e1966cccb9fd853c19091285a24cf985a76e1441e4e908b7d18acb0
|
|
BLAKE2b-256 checksum How to use checksums |
49c18b571fd851ab194f45151b905b692077e3a108888a7f7ca428562687e107
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 3, 2026.
Transparency log