TSeg2ScaleFrame error

Dear AnyBody,

I was trying to create/implement my own scaling law to incorporate subject-specific tibial geometries. However I received an error message as below:
ERROR(SCR.PRS9) : D:/B…s/Data/2…t/S02/W…g/S…n/M…l/ScalingTibiaR_xc.any(27) : ‘TSeg2ScaleFrame’ : Unresolved object

I looked up for TSeg2ScaleFrame but didn’t find much explanations. Your help is greatly appreciated!

here is my scaling law:

#ifdef NO_HUMAN_MODEL
AnyFunTransform3DIdentity TSeg2ScaleFrame = {};
#endif

#ifndef SOURCE_TIBIA
#path SOURCE_TIBIA “D:\Brent Edwards\Data\20170717_First batch of musculoskeletal-FE project\S02\Walking\S2G1L1F0 - GRFprediction\Model\StandingModel_Left.stl”
#endif

#ifndef TARGET_TIBIA
#path TARGET_TIBIA “D:\Brent Edwards\Data\20170717_First batch of musculoskeletal-FE project\S02\Walking\S2G1L1F0 - GRFprediction\Model\Brent_S02_morphed_source.stl”
#endif

AnyFolder ScalingTibiaR = {

AnyFile src = SOURCE_TIBIA;
AnyFile trg = TARGET_TIBIA;

AnyInt size = STL_Size(src, 1); //get the size of the stl
AnyInt VertNum = 200; //specify number of landmarks to be extracted automatically
AnyInt vertices = iarr(1, VertNum)*floor(size[0]/VertNum); //evenly space landmarks in the index field

AnyMatrix P0 = 0.001STL_Vertices(src, vertices, 1); //extract vertices with given indices
AnyMatrix P1 = 0.001
STL_Vertices(trg, vertices, 1); //conversion from mm to m

AnyFunTransform3DLin2 affinetransform =
{
Points0 = .TSeg2ScaleFrame(.P0);
Points1 = .P1;
Mode = VTK_LANDMARK_AFFINE;
};

AnyFunTransform3DRBF rbftransform =
{
PreTransforms = {&.affinetransform};
RBFDef.Type = RBF_Triharmonic;
PolynomDegree = 1;
Points0 = .affinetransform.Points0;
Points1 = .affinetransform.Points1;
BoundingBoxOnOff = On;
BoundingBox.Type = BB_Cartesian;
BoundingBox.ScaleXYZ = {1,2,2}*1.2;
BoundingBox.DivisionFactorXYZ = {1,1,1}*3;
};

AnyFunTransform3DLin2 reversetransform =
{
Points0 = .affinetransform.Points1;
Points1 = .affinetransform.Points0;
Mode = VTK_LANDMARK_RIGIDBODY;
};

AnyFunTransform3DIdentity finaltransform =
{
PreTransforms = {&.rbftransform, &.reversetransform};
};
};

Hi Phoebe,

TSeg2ScaleFrame is a transformation needed to move sources entities into a “scaling ref. frame”. Just imagine if we want to scale along the longest dimension, but the segment is not oriented properly. TSeg2ScaleFrame just ensures that the segment will get scaled properly.

TSeg2ScaleFrame are already preconstructed and the user does not need to worry about it, but unfortunately they only appeared recently. And in the version 1.6.6, they are defined in all scaling laws, but not for the MoCap model, because the model structure was different.

I would recommend you to try using AMMR2.0 and migrate your model to work with the new AMMR. But at the moment the following change seemed to work just fine for me on your model:


    //Points0 = ..TSeg2ScaleFrame(.P0); 
    Points0 = .P0; 

Hi Pavel,

I tried to upgrade to AnyBody.7.1 which comes with AMMR 2.0. However, many folders under C:\Program Files\AnyBody Technology\AnyBody.7.1\AMMR\Body\AAUHuman\ such as ToolBox, Documentation, FootGM, LegTD-FootGM, TrunkNeck are gone. My model stops running since it calls TooBox/MoCap/CreateMarkerClass.any.

Shall I stick to v7.0? How do I get AMMR2.0 under AMS v7.0?

Thank you very much!
-Phoebe

Hi Pavel,

I tried to upgrade to AnyBody.7.1 which comes with AMMR 2.0. However, I see that AMMR 2.0 has a distinctly different structure such as ToolBox, Documentation, FootGM, LegTD-FootGM, TrunkNeck are all moved to different locations. I feel it will be a lot of work to manually modify every file’s location defined in libdef.any and class.any.

Is there a quick & efficient way to migrate to AMMR2.0?

Thank you very much!
-Phoebe

Just to update:

I used "#include “C:\Program Files\AnyBody Technology\AnyBody.7.1\AMMR\libdef.any” at the beginning of the main file to make sure the correct version of AMMR was called. Then I got errors from BodyModel.any:
ERROR(SCR.SCN6) : C:/P…s/A…y/A…1/AMMR/Body/A…n/B…s/G…l/BodyModel.any(16) : ‘BM_LEG_RIGHT’ : Unexpected character.

It seems that the structure of AMMR 2.0 is different with AMMR 1.6 with files saved in different places. My model working in AnyBody 7.0 and AMMR1.6 stopped working in v7.1 and v2.0.

Is there a quick and efficient method to migrate to the new environment? thank you in advance!

-Phoebe

Hi Phoebe,

I am afraid it will not be easy to just switch to the new version of repository. The MoCap model was discontinued and replaced by a newer MoCap processing framework.

We would very much recommend to start using the newer system as soon as possible. It is much easier to use, does not require reloading, and many other improvements. You could reuse quite a lot of your code when you migrate to the new model. Hopefully it will not cause too much discomfort.

Here is the link to the tutorial on how to use the new version of MoCap processing model.

You could also have a look at the examples in the repository, and, in particular, this one:
Application\MocapExamples\Plug-in-gait_MultiTrial_StandingRef\

Please let me know if you have any further questions.

Kind regards,
Pavel