HDF5 Browser¶
Overview¶
The HDF5 Browser is a custom Igor Pro tool for exploring, browsing, and transferring data between HDF5 files and Igor Pro experiments. It provides a Data Browser-style two-pane interface where each pane independently displays either an HDF5 file or the current Igor experiment’s data folder hierarchy.
Key Features:
Two independent panes: simultaneously browse two HDF5 files, or one HDF5 file and the Igor experiment
Collapsible tree navigation: expand/collapse groups to navigate hierarchies
Value preview widget: inline display of scalar values, text strings, and previews of 1D/2D arrays
Attribute display: view metadata (HDF5 attributes, Igor wave notes, folder attributes)
Copy operations: transfer datasets/groups between panes and into/out of Igor Pro
Drag-and-drop: intuitively move or copy items using mouse drag
Right-click context menu: quick access to copy, inspect, plot, and folder management functions
Attribute preservation: round-trip HDF5 attributes through Igor experiment exports/imports via wave notes and sidecar waves
File Types and Data Sources¶
Supported HDF5 File Formats¶
The browser accepts standard HDF5 files and Igor experiment files (which can embed HDF5):
.h5 — Standard HDF5 file format
.h5xp — Igor Pro experiment file containing HDF5 data (read/write)
.pxp — Igor Pro experiment file (readable as HDF5 via Igor’s native HDF5 interface)
Igor Experiment as Data Source¶
Each pane can also browse the current Igor experiment directly by clicking the “Igor” button. This displays:
Folders — mapped from Igor data folders
Waves — individual Igor waves (numeric or text)
Variables — scalar numeric values
Strings — text variables
Attributes — wave notes and folder sidecar attributes (see Attribute Preservation below)
Data Type Mappings¶
HDF5 to Igor¶
When copying data from HDF5 to Igor:
Igor to HDF5¶
When copying data from Igor to HDF5:
Copy Operations¶
Overview¶
You can transfer data in all four directions:
HDF5 → HDF5 (between two open HDF5 files in left and right panes)
HDF5 → Igor (from HDF5 file into current Igor experiment)
Igor → HDF5 (from Igor experiment into an open HDF5 file)
Igor → Igor (within the current Igor experiment; essentially a local copy/move)
Initiating a Copy¶
- Method 1: Right-click context menu
Right-click any node in the tree
Select from the menu: - “Copy to other pane” — copies to the opposite pane - “Copy to Igor” (only if right-clicking HDF5 node) — copies to current Igor experiment - (More options may be available; see Right-Click Context Menu below)
- Method 2: Drag-and-drop
Click and hold on a node
Move the mouse ≥4 pixels (the movement threshold to distinguish drag from a simple click)
Visual ghost feedback (a TitleBox) follows the mouse to show drop destination
Release over the target group/folder in the opposite pane (or same pane)
Drop confirms; copy or move is executed
Copy Semantics¶
- Name collisions
If the destination already contains an item with the same name, the existing item is silently overwritten (no dialog).
Plan your copy operations accordingly; there is no undo.
- Recursive copy
If you copy a group or folder, all child groups, subgroups, and datasets are copied recursively.
This preserves the entire subtree structure at the destination.
- Same-pane operations (drag-and-drop within same pane)
Dragging within the same pane is a MOVE operation: the source is copied to the destination, then the source is deleted.
Useful for reorganizing Igor experiments or HDF5 file structures.
Caveat: Moving into a descendant of the source is prevented to avoid corruption.
- Cross-pane operations (drag-and-drop between panes)
Dragging from one pane to another is a COPY operation: the source remains unchanged.
Use this to duplicate data or transfer between HDF5 files.
- Read-only panes
If an HDF5 file is open in read-only mode (e.g., on a read-only file system), the “Copy to X” options will be disabled for that pane.
Attribute Preservation¶
Overview¶
One of the most important features is that attributes (metadata) are preserved when copying data between HDF5 and Igor Pro. This ensures that calibration information, sample metadata, and other scientific information travels with the data.
HDF5 Attributes → Igor¶
When copying from HDF5 to Igor:
Dataset attributes are encoded into the wave note of the destination Igor wave as
key=value;pairs, one per semicolon-separated item. - Example:Q_resolution=0.001; units=1/Angstrom; sample_name=SiO2 powder;Group attributes are stored in a sidecar wave named
Igor___folder_attributesinside the destination folder. - This wave is automatically created and contains the encoded attribute list. - This pattern matches the CanSAS/HDF5gateway convention.Multi-value attributes (arrays in HDF5) are encoded as comma-separated lists enclosed in brackets. - Example:
wavelengths=[0.7, 1.5, 2.3];
Igor → HDF5 Attributes¶
When copying from Igor to HDF5:
Wave notes are parsed and converted back into HDF5 attributes on the dataset. - The browser looks for
key=value;pairs in the note and creates corresponding HDF5 attributes. - If the wave note contains free-form text (nokey=structure), it is stored as a single HDF5 attribute namedIgorWaveNote.Folder attributes (from the
Igor___folder_attributessidecar wave) are converted to HDF5 group attributes. - These are automatically attached to the HDF5 group corresponding to the Igor folder.Text values are preserved as HDF5 string attributes.
Numeric values are preserved with their original precision (float64 for doubles, etc.).
Drag-and-Drop Mechanics¶
Movement Threshold¶
A drag is only recognized if the mouse moves ≥4 pixels from the initial click position. This threshold prevents accidental drags when you are simply clicking to select a node.
Visual Feedback¶
While dragging: - A TitleBox ghost follows your mouse cursor, showing the source node and destination group. - The destination tree has a focus ring drawn around it to indicate where the drop will occur. - This visual feedback is removed when you release the mouse.
Drop Behavior¶
You can drop on:
- Any group (HDF5) or folder (Igor) to move/copy the source into it
- The root group (/) to place the item at the top level
You cannot drop: - Into your own descendant (prevents circular references and corruption) - Into a read-only pane (disabled automatically)
After a successful drop: - The trees refresh to show the new structure - The source selection is cleared (to avoid stale references) - If it was a MOVE (same pane), the source item is gone - If it was a COPY (cross-pane), the source remains
Supported Data Types¶
Numeric Types¶
int8, int16, int32, int64 — signed integers
uint8, uint16, uint32, uint64 — unsigned integers (converted to signed storage if necessary)
float32, float64 — single and double precision floats
Complex64, Complex128 — complex numbers (stored as 2-column wave in Igor if loaded)
Text Types¶
Fixed-length strings — stored as text waves
ASCII and UTF-8 — both supported
Unsupported / Limited Types¶
Compound types (nested struct-like records in HDF5) — preview and bulk load is not supported; requires custom handling via raw HDF5 access
Variable-length strings — may work in limited cases; contact support
Opaque types — not supported
≥3D arrays — can be browsed and metadata viewed, but no preview or bulk load in the browser (use Python / raw HDF5 tools)
References (HDF5 region/object references) — not dereferenced automatically
Limitations and Troubleshooting¶
File Access Issues¶
- “file opened READ-ONLY”
The HDF5 file is on a read-only volume or you lack write permissions.
You can still read and copy from the file, but cannot create, modify, or delete within it.
To fix: save the file to a writable location or change file permissions.
- “could not open file” or FileID=-1
File may be locked by another process (HDF5View, Python, another Igor instance).
Solution: close the file in the other application and try again.
- Stale FileID errors on restart
If Igor crashes with an HDF5 file open, the next restart may show stale file references.
Solution: kill and reopen the browser panel. The IR3HB_InitPackage() function will reset all file IDs to -1.
Data Type Conversions¶
- Losing precision with uint8..uint64 to signed Igor storage
Igor Pro 10 waves are signed integers only.
Unsigned integer data is copied as-is, but values > 2^31-1 will overflow in signed representation.
Solution: if you have high bit-depth unsigned data, use Python or raw HDF5 tools instead.
- Text vs. numeric ambiguity
Datasets containing only numbers (e.g., a string
"123") are stored as text waves in Igor, not numbers.This preserves fidelity, but means you must be aware of the actual type when processing.
Large Arrays¶
- Bulk load of very large arrays
Igor Pro allocates the entire array in RAM. If an HDF5 dataset is larger than available memory, loading will fail.
Solution: either increase system RAM, load only a slab of the data via Python/raw HDF5, or contact support.
- Preview truncation
Previews are limited to 50 rows (and 10 columns for 2D).
To see the full data, load the wave via “Copy to Igor” and inspect in Igor’s Data Browser, or use external viewers.
Attribute Round-Tripping¶
- Wave notes are cleared on copy to new wave
If you copy an Igor wave to another location, the wave note (containing attributes) travels with it.
However, if the destination wave already exists and you overwrite it, the old note is lost.
Plan accordingly; keep backups of important metadata.
- Sidecar waves may interfere with data folders
The sidecar wave
Igor___folder_attributesuses a special naming convention to avoid collisions.If you have a data folder item with a name starting with
Igor___, it may interact unexpectedly.Recommendation: avoid that naming pattern in your Igor data folders.
Example Workflows¶
Open the HDF5 browser: Macros → HDF5 Browser (or call
IR3HB_HDF5Browser()from the command line).Click “Open Left File…” and select your beamline’s HDF5 file (e.g.,
scan_12345.h5).In the left pane, expand the tree to find the calibration dataset (e.g.,
/calibration/energy_keVor/instrument/detector/efficiency).Select the calibration dataset.
Right-click and choose “Copy to Igor Experiment”.
The wave appears in your Igor root data folder.
Inspect the value preview and attributes.
Move or rename the wave as needed.
Open the HDF5 browser.
Click “Open Left File…” and select the first HDF5 file.
Click “Open Right…” and select the second HDF5 file.
In each pane, navigate to the datasets you want to compare.
Click on the dataset in the left pane to preview it.
Click on the corresponding dataset in the right pane to preview it side-by-side.
Inspect the Type/Shape/DType and attributes to understand the structure.
If they are identical, you can drag from one to the other to copy into the other file (cross-pane copy).
Open the HDF5 browser and open an HDF5 file for editing (must have write access).
Create new groups/folders as needed by right-clicking a parent group and selecting “Create Group”.
Drag datasets from their current location to the new groups (same-pane drag = MOVE).
Delete misplaced items by right-clicking and selecting “Delete”.
When done, the HDF5 file is automatically updated on disk.
Open the HDF5 browser.
Open an existing HDF5 file (or a new empty one) on the right side.
Click “Igor” on the left side to browse the Igor experiment.
In the left pane, find the folder you want to export (e.g.,
root:SAS:MySample:).Right-click the folder and select “Copy to Other Pane”.
Select where in the HDF5 file you want the folder to go (e.g., click on the
/samplesgroup in the right pane, then right-click and “Copy to Other Pane”).The entire folder and all waves/subfolders are recursively copied into the HDF5 file.
Attributes (from wave notes and sidecar waves) are preserved as HDF5 attributes.
Technical Details¶
Data Folder Organization¶
All browser state is stored under:
root:Packages:Irena:HDF5Browser:Left/Right:
FilePath, FileName (SVAR: file path and name)
FileID (NVAR: HDF5 file ID, -1 if closed)
IsReadOnly (NVAR: 1 if read-only, 0 if read-write)
SourceType (SVAR: "HDF5" or "Igor" or "" if closed)
SelectedFullTreeIdx (NVAR: index into FullTreeText of selected node)
SelectedPath (SVAR: full HDF5 or Igor path of selected node)
SelectedKind (SVAR: "G" for group/folder, "D" for dataset/wave, "" if closed)
SelectedDType (SVAR: HDF5 datatype class or Igor wave type)
SelectedShape (SVAR: shape string, e.g., "50 x 10" or "scalar")
FullTreeText (text wave, 3 cols: path, name, kind)
FullTreeMeta (numeric wave, 3 cols: depth, parentRow, hasChildren)
ExpandedState (numeric 0/1 wave: expanded or collapsed state per node)
VisibleRows (numeric wave: indices into FullTree of visible rows)
TreeListWave (text wave, 2 cols: ["+/-", node name] for ListBox)
TreeSelWave (numeric wave: ListBox selection bitmap)
Preview: (data folder holding preview waves)
(one wave per preview, e.g., ``previewData``)
(automatically cleared and recreated on each selection)
ScalarValueStr (SVAR: display string for scalar value preview)
PreviewListWave (text wave: preview rows for 1D/2D array display)
PreviewSelWave (numeric wave: ListBox selection bitmap for preview)
AttrListWave (text wave, 2 cols: [attr name, attr value])
AttrSelWave (numeric wave: ListBox selection bitmap for attributes)
Tree Data Structure¶
FullTreeText: holds every group and dataset in the file (one row per node) - Column 0: full HDF5 or Igor path (e.g.,
/groups/data/wave1orroot:Folder:subfolder) - Column 1: short name of the node (e.g.,wave1) - Column 2: kind indicator:"G"for group/folder,"D"for dataset/waveFullTreeMeta: parallel numeric columns for tree bookkeeping - Column 0: depth (0 = root, 1 = child of root, etc.) - Column 1: parentRow (index into FullTree of the parent node, -1 for root) - Column 2: hasChildren (0 or 1; 1 if the node has any children)
ExpandedState: 0/1 wave parallel to FullTree - 0 = group is collapsed (children hidden) - 1 = group is expanded (children shown)
VisibleRows: numeric wave of indices into FullTree - Rebuilt whenever the user expands or collapses a group - Contains only the rows that should be currently visible (respects collapsed state) - Used to compute row numbers for the ListBox display
TreeListWave: text wave fed to the ListBox - Column 0: expand/collapse marker (
"+"for collapsed groups,"-"for expanded groups, blank for leaf nodes) + indentation spaces - Column 1: node short name + indentation spaces - Rebuilt whenever VisibleRows changes
Getting Help and Reporting Bugs¶
In Igor: click the red “Get Help” button in the browser window (top right).
Documentation: this file serves as the primary reference.
Bug reports or feature requests: contact the Irena/Indra development team or file an issue on the project repository.
Version History¶
- v1.04 (2026-05-13)
Phase 5: Drag-and-drop between tree panes and within the same pane.
Cross-pane drag = COPY; same-pane drag = MOVE.
Movement threshold of 4 px distinguishes drag from click.
Drop into own descendant is prevented.
Visual ghost TitleBox feedback follows the mouse.
- v1.03 (2026-05-12)
Phase 4: HDF5 attribute preservation across all copy directions.
Dataset attributes encoded as wave notes (
key=value;format).Group attributes stored as sidecar wave
Igor___folder_attributes(CanSAS-compatible).Recursive walkers for both HDF5↔HDF5 and HDF5↔Igor.
Multi-value attributes encoded as
[v1,v2,v3]in notes.
- v1.02 (2026-05-12)
Phase 2: Copy buttons and right-click context menu.
Supports all four copy directions: HDF5↔HDF5, HDF5↔Igor, Igor↔Igor.
Recursive group/folder copy with silent overwrite on collision.
Context menu: copy to other pane, copy to Igor, create group/folder, delete, show metadata, plot 1D.
- v1.01 (2026-05-12)
Added Igor experiment as a data source (per-pane toggle).
Each pane can browse HDF5 file or current Igor experiment.
Walks Igor data folders, waves, variables, and strings.
- v1.00 (2026-05-12)
Phase 1: Two-pane HDF5 browser with collapsible tree navigation.
Value display widget for scalars/strings and 1D/2D array previews.
Attribute listing for the selected node.
See Also¶
Igor Pro HDF5 documentation: https://docs.wavemetrics.com/igorpro/HDF5/
HDF5 standard specification: https://www.hdfgroup.org/
CanSAS HDF5 gateway (attribute conventions): https://www.sas.org/fileadmin/user_upload/cansashdf5/cansashdf5.html