Change Output folder path to be different than folder that contains .main file

Hello,

I have a problem that might be really easy to solve when you know where to look at.

I want to set up a folder structure to facilitate the analysis of multiple gait analysis trials similar to the Plug-in-gait_MultiTrial_StandingRef MOCAP example in the AMMR. Therefore I adapted Plug-in-gait_Simple Lower Body example. I send a picture here of which folder structure I would like to achieve.

I managed to change the path definitions to have one folder with subfolders for all the subjects (Trial & Subjectspecific data), one with the setup of the model (Labspecific data) and one with the c3d files that I use. Now I want to assign one output folder where all the results (mainly the h5 file from the inverse dynamics study) are saved.

It seems that by default those output data are stored in automatically created folder in the some folder where the .main file is located. This I would like to change.

When I try to define the output path directly in the .main file:
#define ANYBODY_PATH_OUTPUT “…/…/Output”

I get the following error:
‘ANYBODY_PATH_OUTPUT’ : Identifier already defined at : D:\ANYBODY\AMMR\Tools\conditional_paths.any(12)

How can I avoid this problem, ideally without having to change the ANYMOCAP model?

I’ll be very grateful for every help as I’m a new user.

Kind regards,
Johanna

Folder%20structure

Hi Johanna,

Try writing this define before the inclusion of standard libraries (normally very beginning of the Main file).
I believe this should overwrite the default value.

Kind regards, Pavel

Hi Pavel,

Thank you a lot for your quick and helpful answer.

I inserted the path definition just at the beginning of the Main file. It loaded well so I tried to run a simple parameter identification to see if the data is saved in the right folder. After this I got the error message that the file could not be opened for writing.

Do you have any idea how I can solve this?

Kind regards
Johanna

I just solved the problem. I don’t know why exactly but I had to create a new folder in the Output folder named LowerExtremity_S1 (or other name of the subject). I suppose that the need to do so is caused somewhere in the model definition in the AMMR.

Kind regards
Johanna

Most likely you were writing into a system folder or another writing-protected folder. It is a good idea to move your models to the user specific place and work there. Please remember if you modify AMMR and would like to switch to another model - it may not work as expected.

Kind regards,
Pavel

I will keep in mind not to modify the AMMR, especially as I don’t have a deep understanding of how the models are built there.

Do you have any suggestions what is the best way to deal with the h5 files created with the output of the inverse dynamics study? Are all the results from the study saved in there? And with which software can I analyse it?

Thank you for your help.

Kind regards
Johanna

1 Like

Yes, results are in H5 file. There are tools in Matlab and Python to read H5 files, which are normally used for analysis.

Then I’ll take a look at those.

Thanks again for your really quick help.

Kind regards,
Johanna