Implementing project folder structure in AMS project

Hi,

I’m posting some tips on how to create a project, where (C3D-) files and results are stored in a project folder structure. Using this, it is (or seems) no longer necessary to copy-paste files to and from the location where the model is located. By setting the experiment folder in the modelsetup once and other trial specific details (Subject,trialdata,trialnumber) in the TrialSpecificData, it is possible to perform the different analyses from one single location, but meanwhile keep a very structured project.

I’ve added these additions to my own model which was based on the AMMRV1.3 GaitLowerExtremityProject. As I am not adding a zip-file with my model (not completely finished yet) which is slightly different from the repository model, it could be that I missed to post some small details. Secondly, I am not working with the inverse dynamic model (yet), so I haven’t stated changes needed for that (but it seems pretty straightforward to me). My apologies for any inconvenience, but it works (almost perfectly) for me and would like share it to enable improvements for this adaptations.

There is only one slight problem concerning classoperation macro’s, as it seems that these text based macro’s ignore backslashes (which is vital for the folder structure). Therefore optimized parameters are still stored in the AMS folder. -> solved by removing the “strformat()” command in the macro (see http://forum.anyscript.org/showthread.php?p=13038&posted=1#post13038).

Kind regards,

Bart Koning


Explanation of folder structure:

- Experiment root folder (Main.ModelSetup.ExperimentProperties.ExperimentFolder)
__- Subject (Main.TrialSpecificData.Subject)
____- Trialdate (Main.TrialSpecificData.TrialDate)
______- Vicon (location original C3D files: Main.TrialSpecificData.InputFolder)
________- C3Dfile (Main.ModelSetup.C3DFileData.FileName)
______- AnyBody (folder for anybody results: Main.TrialSpecificData.OutputFolder)
________- Results (Main.Studies.MotionOptimization.ModelOutputs.JointKinematics.JointKinematics.FileName)


Additions in AMS (in order of addition)
- ModelSetup.any (Define root folder of the project)

AnyFolder ExperimentProperties = {
// Location of markerdata and other subject specific properties
AnyString ExperimentFolder = “D:\Schaatsplankmeting\ProjectFolder”;
};

- TrialSpecificData.any (Define location and name of specific trail):

// Subject
AnyString Subject = “Subj”;
//TrialNumber
AnyString TrialDate = “20100712”;
AnyString TrialNumber = “03”;
AnyString ExportName = Subject + TrialDate + TrialNumber;

// In- and output folders
AnyString InputFolder = Main.ExperimentProperties.ExperimentFolder + Subject + “” + TrialDate + “\Vicon”;
AnyString OutputFolder = Main.ExperimentProperties.ExperimentFolder + Subject + “” + TrialDate + “\Anybody”;

//Starting and end element for the analysis of part a
AnyString TrialPart = “a”; // I use this when I cut very long trials into seperate parts

// C3D file name
AnyString C3Daddition = “labeling_Final";
AnyString NameOfFile = Subject + "
” + TrialDate + TrialNumber + C3Daddition;

- ModelSetup.any (direct AMS to correct c3d-file)
AnyInputC3D C3DFileData = {

FileName = Main.TrialSpecificData.InputFolder + Main.TrialSpecificData.NameOfFile+ “.c3d”;
… etc

- Output.any (create output)
AnyString OutputFolder = Main.TrialSpecificData.OutputFolder;
AnyString TrialName = Main.TrialSpecificData.Subject + “_” + Main.TrialSpecificData.TrialDate + Main.TrialSpecificData.TrialNumber;
AnyString TrialPart = Main.TrialSpecificData.TrialPart;

AnyOutputFile JointKinematics = {
FileName = …OutputFolder + …TrialName + …TrialPart +"-joint_kinematics.AnyOut"; // I choose to use the extension AnyOut
SepSign = ", ";

};//End JointKinematics

- MotionAndParamOptimization.Main.any & InitialPos.Main.any (stores widget values in the project output folder)
Main.Project ={
Files = {
SetValueFile = Main.TrialSpecificData.OutputFolder + Main.TrialSpecificData.NameOfFile+"-MarkerPositionWidgetValues.txt";
};
};