Windows desktop app for controlling a NIREOS HERA hyperspectral camera, Tango XY stage, and optional Nikon Ti Z through Micro-Manager. It supports site-guided hyperspectral acquisition, flatfield normalization, ENVI export, and long timelapse scans.
The top-level run_app.py is only a launcher. The app logic lives in the tracked hera_app/ package.
- HERA camera connection, live preview, HDR, exposure/gain, ROI, and hyperspectral acquisition.
- Tango XY stage control with saved sites, per-site ROI, and selected-site loops/timelapse.
- Nikon Ti Z control through Micro-Manager, including saved Z, safe Z range, and max-jump protection.
- Flatfield reference acquire/import, plus
Raw,Flatfield, andNormalizeddisplay/export. - ENVI export for
_raw,_ref, and_nrm, with HyperLAB-compatible headers. - Background logs, issue summaries, trigger logs, and helper-service acquisition for longer runs.
- Windows x64 and Python 3.
- NIREOS Hera SDK /
HeraAPI.dll, valid SDK license, HERA device configuration, and camera drivers. - Tango stage DLL/runtime when XY stage control is needed.
- Micro-Manager 2.0 and
pymmcorewhen Nikon Ti Z control is needed.
Current default Micro-Manager config:
C:\Program Files\Micro-Manager-2.0\NikonTi_Z.cfg
This config should contain only the Ti scope/Z drive, without lamp or shutter devices.
From the repository folder:
cd "C:\BIOS DATA\Lina\PYTHON\hera-trigger-app"
python run_app.pyDefault output/log folder:
C:\BIOS DATA\jiayi\APP
hera-trigger-app/
run_app.py launcher
hera_app/
app.py main Tk app and shared state
controllers/ HERA, Tango, Micro-Manager, NIS-Z wrappers
helpers/ HERA helper service/process logic
mixins/ UI and feature modules
Important mixins:
ui_builder.py: UI construction and widget behavior.device.py: HERA/Tango connection, license, preflight, helper service.acquisition.py: parameter apply, acquisition, callbacks, saving.timelapse.py: one-loop/timelapse worker, site retries, trigger log.stage.py: XY motion, saved sites, per-site ROI/Z.micro_z_mixin.py: Nikon Ti Z connection, moves, safe range, max jump.flatfield.py: reference acquire/import and normalization.live_view.py,roi.py,hyperspectral_viewer.py,export.py: display, ROI, viewer, and ENVI/HyperLAB export.
- Launch the app and connect HERA/Tango.
- Check
Status,License,Live, andStage. - Use
Preflightbefore long runs to check SDK/license/export folder/disk space. - Set camera
Parameters: gain, exposure, and16-bit HDR. - Set
Control Baroptions: spectral mode, sampling, bands, averaging, binning, and data type. - Select ROI, or clear ROI for full-frame workflow.
- If using Z, click
Connect Z, focus each site, thenAdd NeworUpdateinSaved Sites. - Choose export folder/name/stamp and selected products:
_raw,_ref,_nrm. - Run
Start Single Acquisition,Run One Loop, orRun Timelapse.
ExposureandGainapply when you pressEnter, click away from the field, or pressSet.16-bit HDRcalls the SDK HDR setting before acquisition. Saved-data HDR status should be verified from SDK data/cube HDR flags when available.Control Barsettings should be applied withSet.Bands = 0lets the SDK use its recommended/default band count.Samplingcan beUniform lambdaorUniform nuwhen supported by the installed SDK.- Unsupported or read-only settings are logged instead of silently ignored.
ROI can be selected in Live View or entered as width/height. Apply Box uses the corner fields, Square makes a square ROI, and Clear returns to full-frame workflow.
The app keeps the user-selected ROI for display/export even when the SDK reports ROI as full-frame or read-only. If the SDK returns a full-frame cube, the app can crop display and ENVI output to match the selected ROI.
Saved Sites stores site number, name, XY, active ROI, and Z when Micro-Manager Z is connected. If Z is unavailable, a dummy 0.000 placeholder is stored and is not treated as a real focus target.
Saved Z movement is always enabled for Run One Loop and Run Timelapse:
- Micro-Manager Z must be connected.
- Every selected site must have a real saved Z.
- Saved Z must be inside
Safe Zrange. Default:0 - 11000 um. - Single Z moves must be within
Max Jump. Default:50 um. - Each site runs
XY -> saved Z -> dwell -> HERA acquisition.
Go To also moves to the saved Z when a real saved Z exists and Z is connected.
The timelapse Sites field accepts all, comma-separated site numbers, and ranges such as 1-5.
Start Single Acquisition: acquire the current position/ROI once.Run One Loop: run selected sites once.Run Timelapse: repeat selected-site loops.Interval (min): wait time from the end of one loop to the start of the next loop.0starts the next loop immediately.- During interval waiting, the app restarts live view when possible so focus can be checked.
Pausepauses between safe steps and can be pressed again to resume.Stop Timelapsestops after the current safe point.Abort Acquisitionaborts the active HERA acquisition.
Trigger logs include site, cycle, XY, target Z, confirmed Z, Z delta, ROI, export path, and status.
Flatfield Acquire acquires a reference cube from the current ROI/position and stores it as the active flatfield. Import Ref loads a saved reference. Clear removes the active flatfield.
With a compatible flatfield:
- Hyperspectral View can display
Normalized,Raw, orFlatfield. _rawsaves the sample cube._refsaves the active matching reference._nrmsaves sample divided by reference.
Export choices are independent of the current display mode.
The Export panel controls folder, name, optional timestamp, product selection, and notes. Notes are written into ENVI metadata/descriptions.
Open in HyperLAB opens every .hdr saved in the most recent export. If no export is remembered from the current session, it falls back to the newest export header in the output folder.
Main log files in the output folder:
hera_background_status.log
hera_last_issues.log
hera_fatal_crash.log
helper_cache\
Use Open Log for the issue summary. Use hera_background_status.log for detailed timing, SDK callbacks, movement, retry, and saving events.
Private/local materials are ignored by Git, including:
NIS-Z-Bridge/design_previews/local/- runtime caches such as
__pycache__/ - output data and logs
For code changes:
python -m py_compile <touched-python-files>
git status
git add <changed-files>
git commit -m "<area>: <summary>"
git pushFor UI or hardware changes, verify manually in the app and inspect hera_background_status.log.
No open-source license file has been added yet. Add one before distributing the code outside the project.