{"id":28503021,"url":"https://github.com/neurojson/easyh5","last_synced_at":"2025-07-13T21:06:15.368Z","repository":{"id":78325064,"uuid":"209475617","full_name":"NeuroJSON/easyh5","owner":"NeuroJSON","description":"EasyH5 Toolbox - An easy-to-use HDF5 data interface (loadh5 and saveh5) for MATLAB","archived":false,"fork":false,"pushed_at":"2025-04-13T14:15:50.000Z","size":227,"stargazers_count":15,"open_issues_count":0,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-07T13:37:57.354Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NeuroJSON.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.txt","contributing":null,"funding":null,"license":"LICENSE_BSD-3.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.txt","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-19T06:10:37.000Z","updated_at":"2025-05-09T12:50:52.000Z","dependencies_parsed_at":"2023-11-27T03:30:22.071Z","dependency_job_id":"25168211-2aba-47dd-8452-8f4c29371311","html_url":"https://github.com/NeuroJSON/easyh5","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/NeuroJSON/easyh5","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeuroJSON%2Feasyh5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeuroJSON%2Feasyh5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeuroJSON%2Feasyh5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeuroJSON%2Feasyh5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NeuroJSON","download_url":"https://codeload.github.com/NeuroJSON/easyh5/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeuroJSON%2Feasyh5/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265205627,"owners_count":23727506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-08T16:38:50.199Z","updated_at":"2025-07-13T21:06:15.310Z","avatar_url":"https://github.com/NeuroJSON.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://neurojson.org/wiki/upload/neurojson_banner_long.png)\n\n# EasyH5 Toolbox - An easy-to-use HDF5 data interface (loadh5 and saveh5)\n\n* Copyright (C) 2019,2022,2025  Qianqian Fang \u003cq.fang at neu.edu\u003e\n* License: GNU General Public License version 3 (GPL v3) or 3-clause BSD license, see LICENSE*.txt\n* Version: 0.9 (code name: Daseot - Korean 5)\n* URL: https://github.com/NeuroJSON/easyh5\n* Compatibility: MATLAB R2010b or newer and GNU Octave 5.0 or newer\n* Acknowledgement: This project is supported by US National Institute of Health (NIH)\n  grant [U24-NS124027 (NeuroJSON)](https://reporter.nih.gov/project-details/10308329)\n\n## Overview\n\nEasyH5 is a fully automated, fast, compact and portable MATLAB object to HDF5\nexporter/importer. It contains two easy-to-use functions - `loadh5.m` and\n`saveh5.m`. The `saveh5.m` can handle almost all MATLAB data types, including \nstructs, struct arrays, cells, cell arrays, real and complex arrays, strings, \nand `containers.Map` objects. All other data classes (such as a table, digraph, \netc) can also be stored/loaded seemlessly using an undocumented data serialization \ninterface (MATLAB only).\n\nEasyH5 stores complex-valued arrays using a special compound data type in an\nHDF5 dataset. The real-part of the data are stored as `Real` and the imaginary\npart is stored as the `Imag` component. The `loadh5.m` automatically converts\nsuch data structure to a complex array. Starting from v0.8, EasyH5 also supports\nsaving and loading sparse arrays using a compound dataset with 2 or 3\nspecialized subfields: `SparseArray`, `Real`, and, in the case of a sparse\ncomplex array, `Imag`. The sparse array dimension is stored as an attribute\nnamed `SparseArraySize`, attached with the dataset. Using the `deflate` filter\nto save compressed arrays is supported in v0.8 and later.\n\nBecause HDF5 does not directly support 1-D/N-D cell arrays or struct arrays,\nEasyH5 converts these data structures into data groups with names in the \nfollowing format\n```\n    ['/hdf5/path/.../varname',num2str(idx1d)]\n```\nwhere `varname` is the variable/field name to the cell/struct array object, \nand `idx1d` is the 1-D integer index of the cell/struct array. We also provide\na function, `regrouph5.m` to automatically collapse these group/dataset names\ninto 1-D cell/struct arrays after loading the data using `loadh5.m`. See examples\nbelow.\n\n## Installation\n\nThe EasyH5 toolbox can be installed using a single command\n```\n  addpath('/path/to/easyh5');\n```\nwhere the `/path/to/easyh5` should be replaced by the unzipped folder\nof the toolbox (i.e. the folder containing `loadh5.m/saveh5.m`).\n\nIn v0.8 and newer releases, EasyH5 supports GNU Octave 5.x or later.\nIn order to use EasyH5 with Octave, one must install a toolbox named oct-hdf5\nby running the following command in Octave once\n```\n  pkg install https://github.com/NeuroJSON/oct-hdf5/archive/refs/tags/git20250413.zip\n  pkg load oct-hdf5\n```\n\nEasyH5 supports MATLAB R2010b or newer. However, `saveh5` can not save empty\narrays for MATLAB releases before 2015.\n\n\n## Usage\n\n### `saveh5` - Save a MATLAB struct (array) or cell (array) into an HDF5 file\nSave a MATLAB struct (array) or cell (array) into an HDF5 file.\n\nExample:\n```\n  a=struct('a',rand(5),'c','string','b',true,'d',2+3i,'e',{'test',[],1:5});\n  saveh5(a,'test.h5');\n  saveh5(a(1),'test2.h5','rootname','');\n  saveh5(a(1),'test2.h5','compression','deflate','compressarraysize',1);\n  saveh5('appending data to existing file','test.h5','rootname','/name','append',1);\n  saveh5(a,'test.h5j','jdata',1);\n```\n### `loadh5` - Load data in an HDF5 file to a MATLAB structure.\nLoad data in an HDF5 file to a MATLAB structure.\n\nExample:\n```\n  a={rand(2), struct('va',1,'vb','string'), 1+2i};\n  saveh5(a,'test.h5');\n  a2=loadh5('test.h5')\n  a3=loadh5('test.h5','regroup',1)\n  isequaln(a,a3.a)\n  a4=loadh5('test.h5','/a1')\n```\n### `regrouph5` - Processing an HDF5 based data and group indexed datasets into a cell array\nProcessing a loadh5 restored data and merge \"indexed datasets\", whose\nnames start with an ASCII string followed by a contiguous integer\nsequence number starting from 1, into a cell array. For example,\ndatasets `{data.a1, data.a2, data.a3}` will be merged into a cell/struct\narray data.a with 3 elements.\n\nExample:\n```\n  a=struct('a1',rand(5),'a2','string','a3',true,'d',2+3i,'e',{'test',[],1:5});\n  a(1).a1=0; a(2).a2='test';\n  data=regrouph5(a)\n  saveh5(a,'test.h5');\n  rawdata=loadh5('test.h5')\n  data=regrouph5(rawdata)\n```\n\n## Known problems\n- EasyH5 currently does not support 2D cell and struct arrays\n- If a cell name ends with a number, such as `a10={...}`; `regrouph5` can not group the cell correctly\n- If a database/group name is longer than 63 characters, it may have the risk of being truncated\n- When saving a dynamic expression instead of a named variable, the data are stored under path `/data`\n\n## Contribute to EasyH5\n\nPlease submit your bug reports, feature requests and questions to the Github Issues page at\n\nhttps://github.com/NeuroJSON/easyh5/issues\n\nPlease feel free to fork our software, making changes, and submit your revision back\nto us via \"Pull Requests\". EasyH5 is open-source and welcome to your contributions!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneurojson%2Feasyh5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneurojson%2Feasyh5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneurojson%2Feasyh5/lists"}