Anybody v.8 does not save my ouput

Dear all,

I am working with a model that performs a one-legged squat. It worked well when I was using AnyBody version 7, but after upgrading to version 8, I have encountered a problem when saving my results.

The model loads and runs the simulation without any issues, and it saves data into the H5 file. However, when I open the file, I notice that the Main.Studies.MainStudy.Output.Model data is not saved.

Here is the part of my script responsible for saving the data:

// Define the simulation sequence and save the .h5 using the patient name
AnyOperationMacro SimulationSequence = {
MacroStr={
"operation Main.Studies.CalibrationStudy.Kinematics",
"run",
"operation Main.Studies.MainStudy.InverseDynamics",
"run",
"classoperation Main.Studies.MainStudy.Output" + strquote("Save data") + " --file=" + strquote(Main.SetSpecs.GeneralAnalysisSpecs.OutputFileName) + " --type=Deep"
};
}; // end SimulationSequence

Could anybody help me with this problem? Do I need to provide more information?

Thank you in advance!

Theresa

Hi Theresa

I think I can certainly help you. Stuff are only saved a single time in the HDF5 files even though AnyBody has multiple references (or paths) to the same object.

I version AnyBody 7 this meant that the things could suddenly be stored in different places if the model was restructured.

This is what hit you when using AnyBody 8. Now data is always stored in the same way - although different from version 7. Your data is still there just stored on a different path.

solutuion 1:

If you use Python to open the HDF5 files, then a quick workaround is to use the AnyPyTools library. It has a wrapper for the h5py library which handles the problem for you. So instead of

import h5py

do

import anypytools.h5py_wrapper as h5py

Then you can load the data without thinking about where it is located in the hdf5 file. It also allows you to use the AnyBody names with dots (e.g. Main.MyStudy.Output.Model) instead of the hdf5 way with slashes (i.e. Main/MyStudy/Output/Model)

(see the bottom of this page for more info)

Solution 2

I version 8 we added a new _Main object in the output folder so people could always find there data through the full model path in a fixed location.

So if this is for example the data you need:

Main.HumanModel.BodyModel.Right.Leg.Seg.Foot.r

And your study is called: Main.MyStudy

Then you can always find the data in the hdf5 file under this path:

Main/MyStudy/Output/_Main/HumanModel/BodyModel/Right/Leg/Seg/Foot/r
1 Like

Hi Morten,
Thank you for your answer, it helped me a lot!

1 Like