I would like to have some details about saving/reading anydata.h5 files.
First, does the deep structure save everything from the study?
The flat structure only returns the tree structure right?
Second, if I want to read the h5 file, is using hdf5read in MatLab the best option? Say I want to have access to the Gastrocnemius force and plot it?
Is the following the best thing to do?
We do not use Matlab and I cannot try this exact syntax, but i expect something like the following to do the job (possibly not the most efficient way):
Fm_gastro = hdf5read(‘filename.anydata.h5’).Output.Model.HumanModel.Left.Leg.Mus.Gastrocnemius.Fm;
I tried the following in Octave and it worked for me - I expect it to work similarly in Matlab:
Fm_gastro = load(‘filename.anydata.h5’).Output.Model.HumanModel.Left.Leg.Mus.Gastrocnemius.Fm;
Otherwise you could just try the attribute filter (try with dots) as you described and see whether this works or not.
Alternatively you may just use AnyOutputFile class to get the values that you need rather than outputting everything.
I was wondering if I send the h5 file to someone who doesn’t know the structure of the AnyBody tree, would it be possible to actually display the contents of the h5 file within MatLab in a quick way?
Hi Stephanie
In fact, yes, you can, but it’s pretty long Here is the way :
Info= h5info('SS.anydata.h5');
This will create a structure variable containing the whole model. To find your variable of interest, you’ll have to look into the “group” substructure.
Another way is to display the informations :
h5disp('SS.anydata.h5');
This will write all your content in the Matlab command window. It can be pretty convinient if your model is small but become tough if you have a lot of variable your anybody model.