Skip to content

Commit ca8b0e8

Browse files
authored
Merge pull request #101 from AnyBody/update_scaling_tutorials
Update scaling tutorials
2 parents 18c2286 + 32c9724 commit ca8b0e8

5 files changed

Lines changed: 340 additions & 312 deletions

File tree

Lines changed: 194 additions & 189 deletions
Original file line numberDiff line numberDiff line change
@@ -1,189 +1,194 @@
1-
// Todo: Write a small description of your model here
2-
3-
Main = {
4-
5-
// The actual body model goes in this folder
6-
AnyFolder MyModel = {
7-
8-
// Global Reference Frame
9-
AnyFixedRefFrame GlobalRef = {
10-
11-
// Todo: Add points for grounding of the model here
12-
13-
}; // Global reference frame
14-
15-
// Todo. Add the model elements such as
16-
// segments, joints, and muscles here.
17-
AnySeg SourceFemur =
18-
{
19-
Mass = 0; Jii = {0, 0, 0};
20-
AnyDrawSurf Surface =
21-
{
22-
FileName = "SourceFemur.stl";
23-
RGB = {222,202,176}/256;
24-
};
25-
AnyDrawSurf SurfaceMorphed =
26-
{
27-
FileName = "SourceFemur.stl";
28-
AnyFunTransform3D &ref = ..MyTransform3;
29-
};
30-
AnyDrawSurf SurfaceMorphedRBF =
31-
{
32-
FileName = "SourceFemur.stl";
33-
AnyFunTransform3D &ref = ..MyRBFTransform;
34-
RGB={1,0,0};
35-
};
36-
AnyDrawSurf SurfaceMorphedSTL =
37-
{
38-
FileName = "SourceFemur.stl";
39-
AnyFunTransform3D &ref = ..MySTLTransform;
40-
RGB={0,0,1};
41-
};
42-
};
43-
44-
AnySeg TargetFemur =
45-
{
46-
Mass = 0; Jii = {0, 0, 0};
47-
AnyDrawSurf Surface =
48-
{
49-
FileName = "TargetFemur.stl";
50-
RGB = {0,1,0};
51-
};
52-
53-
};
54-
55-
AnyFunTransform3DLin2 MyTransform =
56-
{
57-
//PreTransforms = {};
58-
Points0 =
59-
{{-0.00906139, 0.36453, 0.0175591}, // fovea capitis
60-
{0.0358368, -0.0100391, -0.0162062}, // lateral anterior condyle
61-
{0.0295267, -0.0112881, 0.0194889}, // medial anterior condyle
62-
{0.0282045, 0.157599, -0.0172379}, // anterior mid shaft
63-
{-0.0245689, -0.00701566, -0.0238393}, // lateral posterior condyle
64-
{-0.0320739, -0.00877602, 0.0244234}};// medial posterior condyle
65-
Points1 =
66-
{{0.289913,0.420538,0.0138931}, // fovea capitis
67-
{0.322038,0.433232,-0.378636}, // lateral anterior condyle
68-
{0.289309,0.426839,-0.372994}, // medial anterior condyle
69-
{0.328859,0.425856,-0.175012}, // anterior mid shaft
70-
{0.306293,0.487243,-0.370319}, // lateral posterior condyle
71-
{0.261891,0.47585,-0.372696}}; // medial posterior condyle
72-
Mode = VTK_LANDMARK_AFFINE;
73-
};
74-
75-
AnyFunTransform3DLin2 MyTransform2 = {
76-
Points0 = .MyTransform.Points1;
77-
Points1 = .MyTransform.Points0;
78-
Mode = VTK_LANDMARK_RIGIDBODY;
79-
};
80-
81-
AnyFunTransform3DIdentity MyTransform3 =
82-
{
83-
PreTransforms = {&.MyTransform/*,&.MyTransform2*/};
84-
};
85-
AnyFunTransform3DRBF MyRBFTransform =
86-
{
87-
PreTransforms = {&.MyTransform};
88-
PolynomDegree = 1;
89-
RBFDef.Type = RBF_Triharmonic;
90-
91-
Points0 = {
92-
{-0.00920594, 0.36459700, 0.0174376}, // fovea capitis
93-
{ 0.03691960, -0.01011610, -0.0197803}, // anterior lateral condyle
94-
{ 0.03001110, -0.00998133, 0.0186877}, // anterior medial condyle
95-
{ 0.02009270, 0.34511400, -0.0387426}, // anterior greater trochanter point
96-
{ 0.02783850, 0.18320400, -0.0217463}, // anterior shaft point
97-
{-0.02461770, -0.00623515, -0.0231383}, // posterior lateral condyle
98-
{-0.03211040, -0.00908290, 0.0246153}, // posterior medial condyle
99-
{-0.02643670, 0.35630800, 0.0014140}, // posterior head point
100-
{ 0.01780310, 0.36194400, 0.0059740}, // anterior head point
101-
{-0.00197744, 0.38387300, -0.0031698}, // superior head point
102-
{-0.00316772, 0.34248600, 0.0114698}, // inferior head point
103-
{-0.02469710, 0.30335600, -0.0171113}, // medial lesser trochanter
104-
{-0.00969883, 0.34826800, -0.0462823}, // distal trochanteric fossa
105-
{-0.01959660, 0.36243100, -0.0441186}, // proximal posterior greater trochanter
106-
{-0.00084335, 0.32253400, -0.0641596}, // distal trochanteric fossa
107-
{-0.00431680, 0.35912600, 0.0036940} // femoral COR
108-
};
109-
PointNames = {
110-
"Medial_Head_Point",
111-
"Anterior_LateralCondyle_Point",
112-
"Anterior_MedialCondyle_Point",
113-
"Anterior_GreaterTrochanter_Point",
114-
"Anterior_Shaft_Point",
115-
"Posterior_LateralCondyle_Point",
116-
"Posterior_MedialCondyle_Point",
117-
"Posterior_Head_Point",
118-
"Anterior_Head_Point",
119-
"Proximal_Head_Point",
120-
"Infeior_Head_Point",
121-
"Medial_LesserTrochanter_Point",
122-
"Distal_TrochantericFossa_Point",
123-
"Proximal_Posterior_GreaterTrochanter_Point",
124-
"Lateral_Lesser_Trochanter_Point",
125-
"Femoral_COR"
126-
};
127-
128-
Points1 = {
129-
{ 0.2900, 0.4205, 0.0139},
130-
{ 0.3220, 0.4332,-0.3786},
131-
{ 0.2893, 0.4268,-0.3730},
132-
{ 0.3599, 0.4429,-0.0050},
133-
{ 0.3289, 0.4259,-0.1750},
134-
{ 0.3062, 0.4872,-0.3703},
135-
{ 0.2619, 0.4759,-0.3727},
136-
{ 0.2900, 0.4405, 0.0139},
137-
{ 0.3200, 0.4095, 0.0134},
138-
{ 0.3100, 0.4295, 0.0314},
139-
{ 0.2983, 0.4196,-0.0066},
140-
{ 0.3089, 0.4599,-0.0355},
141-
{ 0.3349, 0.4579, 0.0050},
142-
{ 0.3329, 0.4679, 0.0175},
143-
{ 0.3519, 0.4599,-0.0355},
144-
{ 0.3075, 0.4235, 0.0139}
145-
};
146-
BoundingBox =
147-
{
148-
Type = BB_Cartesian;
149-
ScaleXYZ = {2, 2, 2};
150-
DivisionFactorXYZ = 5*{1, 1, 1};
151-
};
152-
BoundingBoxOnOff = On;
153-
};
154-
155-
AnyFunTransform3DSTL MySTLTransform =
156-
{
157-
PreTransforms = {&.MyRBFTransform};
158-
PolynomDegree = 1;
159-
RBFDef.Type = RBF_Triharmonic;
160-
AnyFixedRefFrame Input = {
161-
AnySurfSTL SourceSurf = {
162-
FileName = "SourceFemur.stl";
163-
ScaleXYZ = {1, 1, 1};
164-
};
165-
AnySurfSTL TargetSurf = {
166-
FileName = "TargetFemur.stl";
167-
ScaleXYZ = {1, 1, 1};
168-
};
169-
};
170-
171-
SurfaceObjects0 = {&Input.SourceSurf};
172-
SurfaceObjects1 = {&Input.TargetSurf};
173-
//FileName0 = "SourceFemur.stl"; // such definition was used previously
174-
//FileName1 = "TargetFemur.stl"; // such definition was used previously
175-
NumPoints = 1000;
176-
BoundingBox.ScaleXYZ = {2, 2, 2};
177-
BoundingBox.DivisionFactorXYZ = {1, 1, 1};
178-
BoundingBoxOnOff = On;
179-
};
180-
181-
}; // MyModel
182-
183-
// The study: Operations to be performed on the model
184-
AnyBodyStudy MyStudy = {
185-
AnyFolder &Model = .MyModel;
186-
Gravity = {0.0, -9.81, 0.0};
187-
};
188-
189-
}; // Main
1+
// Todo: Write a small description of your model here
2+
3+
Main = {
4+
5+
// The actual body model goes in this folder
6+
AnyFolder MyModel = {
7+
8+
// Global Reference Frame
9+
AnyFixedRefFrame GlobalRef = {
10+
11+
// Todo: Add points for grounding of the model here
12+
13+
}; // Global reference frame
14+
15+
// Todo. Add the model elements such as
16+
// segments, joints, and muscles here.
17+
18+
AnySeg SourceFemur =
19+
{
20+
Mass = 0; Jii = {0, 0, 0};
21+
AnyDrawSurf Surface =
22+
{
23+
FileName = "SourceFemur.stl";
24+
RGB = {222,202,176}/256;
25+
Opacity=0.3;
26+
};
27+
AnyDrawSurf SurfaceMorphed =
28+
{
29+
FileName = "SourceFemur.stl";
30+
AnyFunTransform3D &ref = ..MyTransform3;
31+
};
32+
AnyDrawSurf SurfaceMorphedRBF =
33+
{
34+
FileName = "SourceFemur.stl";
35+
AnyFunTransform3D &ref = ..MyRBFTransform;
36+
RGB={1,0,0};
37+
};
38+
AnyDrawSurf SurfaceMorphedSTL =
39+
{
40+
FileName = "SourceFemur.stl";
41+
AnyFunTransform3D &ref = ..MySTLTransform;
42+
RGB={0,0,1};
43+
};
44+
45+
};
46+
47+
AnySeg TargetFemur =
48+
{
49+
Mass = 0; Jii = {0, 0, 0};
50+
AnyDrawSurf Surface =
51+
{
52+
FileName = "TargetFemur.stl";
53+
RGB = {256,256,0}/256;
54+
};
55+
};
56+
57+
AnyFunTransform3DLin2 MyTransform =
58+
{
59+
//PreTransforms = {};
60+
Points0 =
61+
{{-0.00906139, 0.36453, 0.0175591}, // fovea capitis
62+
{0.0358368, -0.0100391, -0.0162062}, // lateral anterior condyle
63+
{0.0295267, -0.0112881, 0.0194889}, // medial anterior condyle
64+
{0.0282045, 0.157599, -0.0172379}, // anterior mid shaft
65+
{-0.0245689, -0.00701566, -0.0238393}, // lateral posterior condyle
66+
{-0.0320739, -0.00877602, 0.0244234}};// medial posterior condyle
67+
68+
Points1 =
69+
{{0.289913,0.420538,0.0138931}, // fovea capitis
70+
{0.322038,0.433232,-0.378636}, // lateral anterior condyle
71+
{0.289309,0.426839,-0.372994}, // medial anterior condyle
72+
{0.328859,0.425856,-0.175012}, // anterior mid shaft
73+
{0.306293,0.487243,-0.370319}, // lateral posterior condyle
74+
{0.261891,0.47585,-0.372696}}; // medial posterior condyle
75+
76+
Mode = VTK_LANDMARK_AFFINE;
77+
};
78+
AnyFunTransform3DLin2 MyTransform2 = {
79+
Points0 = .MyTransform.Points1;
80+
Points1 = .MyTransform.Points0;
81+
Mode = VTK_LANDMARK_RIGIDBODY;
82+
};
83+
AnyFunTransform3DIdentity MyTransform3 =
84+
{
85+
PreTransforms = {&.MyTransform};
86+
};
87+
88+
AnyFunTransform3DRBF MyRBFTransform =
89+
{
90+
PreTransforms = {&.MyTransform};
91+
PolynomDegree = 1;
92+
RBFDef.Type = RBF_Triharmonic;
93+
94+
Points0 = {
95+
{-0.00920594, 0.36459700, 0.0174376}, // fovea capitis
96+
{ 0.03691960, -0.01011610, -0.0197803}, // anterior lateral condyle
97+
{ 0.03001110, -0.00998133, 0.0186877}, // anterior medial condyle
98+
{ 0.02009270, 0.34511400, -0.0387426}, // anterior greater trochanter point
99+
{ 0.02783850, 0.18320400, -0.0217463}, // anterior shaft point
100+
{-0.02461770, -0.00623515, -0.0231383}, // posterior lateral condyle
101+
{-0.03211040, -0.00908290, 0.0246153}, // posterior medial condyle
102+
{-0.02643670, 0.35630800, 0.0014140}, // posterior head point
103+
{ 0.01780310, 0.36194400, 0.0059740}, // anterior head point
104+
{-0.00197744, 0.38387300, -0.0031698}, // superior head point
105+
{-0.00316772, 0.34248600, 0.0114698}, // inferior head point
106+
{-0.02469710, 0.30335600, -0.0171113}, // medial lesser trochanter
107+
{-0.00969883, 0.34826800, -0.0462823}, // distal trochanteric fossa
108+
{-0.01959660, 0.36243100, -0.0441186}, // proximal posterior greater trochanter
109+
{-0.00084335, 0.32253400, -0.0641596}, // distal trochanteric fossa
110+
{-0.00431680, 0.35912600, 0.0036940} // femoral COR
111+
};
112+
PointNames = {
113+
"Medial_Head_Point",
114+
"Anterior_LateralCondyle_Point",
115+
"Anterior_MedialCondyle_Point",
116+
"Anterior_GreaterTrochanter_Point",
117+
"Anterior_Shaft_Point",
118+
"Posterior_LateralCondyle_Point",
119+
"Posterior_MedialCondyle_Point",
120+
"Posterior_Head_Point",
121+
"Anterior_Head_Point",
122+
"Proximal_Head_Point",
123+
"Infeior_Head_Point",
124+
"Medial_LesserTrochanter_Point",
125+
"Distal_TrochantericFossa_Point",
126+
"Proximal_Posterior_GreaterTrochanter_Point",
127+
"Lateral_Lesser_Trochanter_Point",
128+
"Femoral_COR"
129+
};
130+
131+
Points1 = {
132+
{ 0.2900, 0.4205, 0.0139},
133+
{ 0.3220, 0.4332,-0.3786},
134+
{ 0.2893, 0.4268,-0.3730},
135+
{ 0.3599, 0.4429,-0.0050},
136+
{ 0.3289, 0.4259,-0.1750},
137+
{ 0.3062, 0.4872,-0.3703},
138+
{ 0.2619, 0.4759,-0.3727},
139+
{ 0.2900, 0.4405, 0.0139},
140+
{ 0.3200, 0.4095, 0.0134},
141+
{ 0.3100, 0.4295, 0.0314},
142+
{ 0.2983, 0.4196,-0.0066},
143+
{ 0.3089, 0.4599,-0.0355},
144+
{ 0.3349, 0.4579, 0.0050},
145+
{ 0.3329, 0.4679, 0.0175},
146+
{ 0.3519, 0.4599,-0.0355},
147+
{ 0.3075, 0.4235, 0.0139}
148+
};
149+
BoundingBox =
150+
{
151+
Type = BB_Cartesian;
152+
ScaleXYZ = {2, 2, 2};
153+
DivisionFactorXYZ = 5*{1, 1, 1};
154+
};
155+
BoundingBoxOnOff = On;
156+
};
157+
158+
159+
AnyFunTransform3DSTL MySTLTransform =
160+
{
161+
PreTransforms = {&.MyRBFTransform};
162+
PolynomDegree = 1;
163+
RBFDef.Type = RBF_Triharmonic;
164+
AnyFixedRefFrame Input = {
165+
AnySurfSTL SourceSurf = {
166+
FileName = "SourceFemur.stl";
167+
ScaleXYZ = {1, 1, 1};
168+
};
169+
AnySurfSTL TargetSurf = {
170+
FileName = "TargetFemur.stl";
171+
ScaleXYZ = {1, 1, 1};
172+
};
173+
};
174+
175+
SurfaceObjects0 = {&Input.SourceSurf};
176+
SurfaceObjects1 = {&Input.TargetSurf};
177+
//FileName0 = "SourceFemur.stl"; // such definition was used previously
178+
//FileName1 = "TargetFemur.stl"; // such definition was used previously
179+
NumPoints = 1000;
180+
BoundingBox.ScaleXYZ = {2, 2, 2};
181+
BoundingBox.DivisionFactorXYZ = {1, 1, 1};
182+
BoundingBoxOnOff = On;
183+
};
184+
185+
186+
}; // MyModel
187+
188+
// The study: Operations to be performed on the model
189+
AnyBodyStudy MyStudy = {
190+
AnyFolder &Model = .MyModel;
191+
Gravity = {0.0, -9.81, 0.0};
192+
};
193+
194+
}; // Main

Scaling/_static/lesson3/image1.png

0 Bytes
Loading

Scaling/_static/lesson3/image5.png

0 Bytes
Loading

Scaling/_static/lesson3/image6.png

0 Bytes
Loading

0 commit comments

Comments
 (0)