Hi everyone,
I need to change the directory of the c3d files from C:\Fatemeh\SafeJoints\C3D-files (in the C3D-files folder there are a few folders named Subject1, Subject2, ...) to C:\Box\data_SafeJoints\C3D\Study\V3DProc\Overground ((in the Overground folder there are a few folders named Subject1, Subject2, ...). The current code is
#ifpathexists "../SJ-Data/"
#path SJ_C3D_FILES_PATH"../SJ-Data/patient_data"
#else
#path SJ_C3D_FILES_PATH "C3D-files"
#endif
The above code automatically detect the subjects and I do not need to change the name of each subject manually. The libdef file is located in C:\Fatemeh\SafeJoints directory. Is that possible to change the code in such a way that detect the c3d files located in each of the Subject1, Subject2 ... folders for each subject in the following directory:
C:\Box\data_SafeJoints\C3D\Study\V3DProc\Overground?
Hi Fatemeh,
I think you have already customized the code a little bit, and I think you just need a bit more. In these path statements, you can also provide the complete path, and that should work. Please try this:
#ifpathexists "C:\Box\data_SafeJoints\C3D\Study\V3DProc\Overground"
#path SJ_C3D_FILES_PATH "C:\Box\data_SafeJoints\C3D\Study\V3DProc\Overground/patient_data"
#else
#path SJ_C3D_FILES_PATH "C3D-files"
#endif
However, I am not sure where you have these folders SJ-Data and patient_data. You have used these folders in the identifier SJ_C3D_FILES_PATH but it's not present in the complete path that you provided. Do these folders exist inside the Overground folder? You may need to adjust path slightly.
Best regards,
Dave
Hi Dave,
Thanks for your response!
When I include the code that you provide, I get the following error:
Constructing model tree...
ERROR(OBJ.FILE1) : ModelSetup.any(133) : ModelSetup.C3DFileData.FileName : Problem with file : walk_0_ground_1.c3d : Failed to open the specified c3d file
Model loading skipped
I do not understand why the code is not able to open the c3d files. Any idea on how I can solve this problem?
I changed the path to the following and it works:
#ifpathexists "C:\Box\data_SafeJoints\C3D\Study\V3DProc\Overground"
#path SJ_C3D_FILES_PATH "C:\Box\data_SafeJoints\C3D\Study\V3DProc\Overground"
#else
#path SJ_C3D_FILES_PATH "C3D-files"
#endif
in the C:\Box\data_SafeJoints\C3D\Study\V3DProc\Overground, there is no folder named C3D-files. Instead, there are some folders named Subject_1,Subject_2,Subject_3 .... The c3d files are insided these folders. what i do not understand is how the above code works, without existing the C3D-files folder?
The other thing that i want to know is how I can change the above code to a relative path instead of absolute path?
Hi Fatemeh,
Glad to know that you got it to work.
It's a little bit hard to say why exactly your model works without looking at the complete model. I am sure your model is customized as we don't have the identifier SJ_C3D_FILES_PATH in the models in the AMMR.
You should look at Main.ModelSetup.TrialSpecificdata.TrialFileName and see how it is constructed in AnyScript. There is perhaps a way the subject folder is identified in some way.
Yes, there is a way to define relative path from the directory containing the file where it is defined. You can use ..\ to go a level up. Of course you can use it multiple times in a sequence to go multiple levels up, for example:
#path SJ_C3D_FILES_PATH "..\..\..\C3D\Study\V3DProc\Overground"
Best regards,
Dave