subject-specific implementation of pelvic alignment

Provide a musculoskeletal model of the full thoracolumbar spine and rib cage for researchers to use in their investigations of spine and thorax kinematics and dynamics.
User avatar
Riza Bayoglu
Posts: 26
Joined: Wed Aug 02, 2023 8:54 am

subject-specific implementation of pelvic alignment

Post by Riza Bayoglu » Thu Mar 21, 2024 1:51 pm

Hi,

Many thanks for sharing your spine model with the biomechanics community. I am investigating spinal loads using your model and like to implement subject-specific measurements of pelvic-incidence and pelvic tilt alignment. I was wondering if you have any recommendations for achieving this goal without disrupting the model architecture much. Thanks for your feedback.

Riza

User avatar
Jacob J. Banks
Posts: 97
Joined: Tue Jul 15, 2014 5:17 am

Re: subject-specific implementation of pelvic alignment

Post by Jacob J. Banks » Thu Mar 21, 2024 2:21 pm

You're welcome, your kind words are appreciated.

As for implementing participant-specific pelvic information... do you not produce the desired result using just the scaling tool? Or are you creating these models without a markerset?
If you're creating/scaling without a markerset, you can just manually change the default offset angles (for the pelvis, this would be relative to global) within the .osim files (I recommend using a source code editor, like Notepad++).

We commonly do this for spine curvature (from CT scans of vertebral angles), only we have written API Matlab scripts to automate it for larger datasets.

You may also need to adjust the S1/L5 offset angle equal/opposite so as to not have them leaning forward etc.

Let me know if this isn't clear to you. Also open to virtually meeting if need be.
Jake Banks

User avatar
Riza Bayoglu
Posts: 26
Joined: Wed Aug 02, 2023 8:54 am

Re: subject-specific implementation of pelvic alignment

Post by Riza Bayoglu » Mon Mar 25, 2024 3:19 pm

Hi Jacob,

Thanks for the prompt reply and really appreciate the willingness to help. Apologies for not providing much background information earlier. I have a large dataset of standing x-rays, and I like to implement individual measurements of spinal and pelvic alignment parameters. I am running static optimization through Python scripting. I do not have a market set for model scaling.

Your comments were very helpful. I can now represent spinal alignment by adjusting the default value of the coordinates at each disc level. I can also implement measured SS and PT by setting the initial orientation of the pelvis_offset frame of the groun_pelvis joint. For example, the code below will increase SS by 10 deg and decrease PT by 10 deg, PI does not change.

Code: Select all

<PhysicalOffsetFrame name="pelvis_offset">
			<orientation>0 0 0.1744</orientation>
How can I then implement measured PI value? I played around a bit and noticed that changing orientation of the sacrum_offset frame of the pelvis_sacrum joint, changes PT, SS, and PI at the same time. For example, the code below will decrease PT by 6.13 deg and increase SS by 10 deg and PI by 3.87 deg. However, I only like to set the exact PI value since I can adjust SS and PT by adjusting for the ground_pelvis joint.

Code: Select all

<PhysicalOffsetFrame name="sacrum_offset">
			<orientation>0 0 0.1744</orientation>

A few other things I found out are. Changing the value of the disc coordinates in the motion file alter both spinal alignment and loads. However, changing the value of the pelvic_tilt coordinate in the motion file always set this coordinate value to zero even if I set the default value in the osim file. I am new to OpenSim, and I appreciate your help.
Last edited by Riza Bayoglu on Wed Mar 27, 2024 7:04 pm, edited 1 time in total.

User avatar
Jacob J. Banks
Posts: 97
Joined: Tue Jul 15, 2014 5:17 am

Re: subject-specific implementation of pelvic alignment

Post by Jacob J. Banks » Tue Mar 26, 2024 7:53 am

Thanks again for the kind words.

Are you sure that changing the Sacrum_offset z orientation changes those 3 angles? It shouldn't impact anything in the x or y. I just modified a model (by editing the .osim file by hand) the way you are and I don't see PT/PI changes.

As for motion files, yes changing values would/should impact the loads. In theory you could just do all this via a motion file (if you are looking at static loads)... with the exception of the sacrum/pelvis offsets (as those are not currently controllable with .mot file, but you could easily add a joint instead of the simple weld/offset stuff).

Jake Banks
PS: Just so we are the same page. I assume...
SS = Sacrum Slope in the Sagittal plane (about Z)
PI = Pelvis Inclination (in sagittal)
PT = Pelvic Tilt (also in the sagittal?)

User avatar
Riza Bayoglu
Posts: 26
Joined: Wed Aug 02, 2023 8:54 am

Re: subject-specific implementation of pelvic alignment

Post by Riza Bayoglu » Tue Mar 26, 2024 10:01 am

Yes, I see changes in PT, SS, and PI when I modify the z orientation of the sacrum_offset frame of the pelvis_sacrum joint. I am using the MaleFullBodyModel_v2.0_OS4.osim model. Any yes, these definitions are correct. I am only working on sagittal alignment. I am also attaching an image showing what has changed in the model, the initial alignment, modified alignment, and measured parameters. For a 10 deg change, PT decreases by 6.13 deg, SS increases by 10 deg, and PI increases by 3.87 deg.
pelvic_alingment.PNG
pelvic_alingment.PNG (339.18 KiB) Viewed 2913 times
Also, I noticed why the value of the pelvic_tilt coordinate in the mot file is not implemented. It seems the osim file has the coordinate defined as 'pelvis_tilt', but the mot file has it 'pelvic_tilt'. The model probably could not associate these two.

User avatar
Jacob J. Banks
Posts: 97
Joined: Tue Jul 15, 2014 5:17 am

Re: subject-specific implementation of pelvic alignment

Post by Jacob J. Banks » Wed Mar 27, 2024 6:00 am

Sorry for the delay, I had meetings in the afternoon (yesterday).

Hmmmmm.... at the risk of pointing out the obvious, 6.13 + 3.87 = 10. So it appears to be a compensation for the SS to put the feet flat on the ground. Why the adjustment is proportioned that way, I do not know.

So, is this when you are just playing around, or with your images and scaling? I also see a lot of added markers.

Otherwise, send me the base (which I have, but still) and the adjusted model, and list the exact steps you're doing to get the 'adjusted' model. (note: you'll have to zip them to attach to this thread).
Jake Banks

User avatar
Riza Bayoglu
Posts: 26
Joined: Wed Aug 02, 2023 8:54 am

Re: subject-specific implementation of pelvic alignment

Post by Riza Bayoglu » Wed Mar 27, 2024 2:09 pm

Hi Jacob,

Sorry for getting back here late, I had back to back meetings today. Thanks so much for the help.

I started to feel like this might have something to do with the position of the center of the pelvis_sacrum joint. When we change the default value of the pelvis_tilt coordinate, both pelvis and sacrum rotate the same amount and adjust the SS and PT to the value we set, PI does not change (that is how it is already, no problem here). When we change the default orientation of the sacrum_offset frame, if the joint center of the pelvis_sacrum joint is at the mid-sacral point (mid-point between superior anterior and superior poster points of the S1 endplate), I expect only SS and PI will change and PT should stay the same since PT is calculated from the vertical axis and the vector running from the hip joint center to the mid-sacral point. If the joint center is not placed at the mid-sacral point, both SS and PT will change, and thus PI. So, we should be able to first change the z-orientation of the sacrum_offset frame to set the desired PI and then use the pelvis_tilt coordinate to set for SS.

I have attached the base and the adjusted models here together with the other files to run static optimization. I added spinal markers to the models to calculate default alignment parameters. I do not yet implement patient measurements, no images or scaling was implemented. Also, I renamed the pelvis_tilt entry from pelvic_tilt in the motion file. The only difference in the base and adjusted models are the initial orientation of sacrum (0.1744 rad). I used the below codes to do that:

Code: Select all

<PhysicalOffsetFrame name="sacrum_offset">
	<!--The geometry used to display the axes of this Frame.-->
	<FrameGeometry name="frame_geometry">
		<!--Path to a Component that satisfies the Socket 'frame' of type Frame.-->
		<socket_frame>..</socket_frame>
		<!--Scale factors in X, Y, Z directions respectively.-->
		<scale_factors>0.20000000000000001 0.20000000000000001 0.20000000000000001</scale_factors>
	</FrameGeometry>
	<!--Path to a Component that satisfies the Socket 'parent' of type C (description: The parent frame to this frame.).-->
	<socket_parent>/bodyset/sacrum</socket_parent>
	<!--Translational offset (in meters) of this frame's origin from the parent frame's origin, expressed in the parent frame.-->
	<translation>0 0.049000000000000002 0</translation>
	<!--Orientation offset (in radians) of this frame in its parent frame, expressed as a frame-fixed x-y-z rotation sequence.-->
	<orientation>0 0 0.1744</orientation>
</PhysicalOffsetFrame>
Riza
Attachments
models.zip
(249.16 KiB) Downloaded 120 times

User avatar
Jacob J. Banks
Posts: 97
Joined: Tue Jul 15, 2014 5:17 am

Re: subject-specific implementation of pelvic alignment

Post by Jacob J. Banks » Thu Mar 28, 2024 12:50 pm

Did your 'work around' work?
I'm admittedly a little confused (still). It seems to me like things are working. The angles/inputs may just not be how things are defined clinically, so you may need to adjust them to match how the model works. Otherwise, it is just a geometry problem.

Sorry, for my lack of understanding. You don't need to humor me and continue to explain your problem if you don't want to. Otherwise, I can help problem solve any OpenSim related frustrations.
Jake Banks

User avatar
Riza Bayoglu
Posts: 26
Joined: Wed Aug 02, 2023 8:54 am

Re: subject-specific implementation of pelvic alignment

Post by Riza Bayoglu » Thu Mar 28, 2024 1:48 pm

I might be wrong, but I haven't tried it yet.

Were you able to download the attached models? What did you exactly change and observed in the results that seemed things are working?

I am interested to learn how to set the PI angle to an exact measured value. I can change the PI angle, but not to the exact value I set in the model. For example, I like to increase the default PI value by 10 deg, but I can only increase it by 3.87 deg when I change the sacrum_offset z-orientation. If I was only working with a few models, I could manually change the coordinates until I achieve the desired alignment. But I like to automate this procedure for a large dataset.

Just to wake sure we are looking at the same coordinates:

To change PT and SS, I am changing this code in the base model (highlighted the changed value in bold):

Code: Select all

<WeldJoint name="pelvis_sacrum">
	<!--Path to a Component that satisfies the Socket 'parent_frame' of type PhysicalFrame (description: The parent frame for the joint.).-->
	<socket_parent_frame>pelvis_offset</socket_parent_frame>
	<!--Path to a Component that satisfies the Socket 'child_frame' of type PhysicalFrame (description: The child frame for the joint.).-->
	<socket_child_frame>sacrum_offset</socket_child_frame>
	<!--Physical offset frames owned by the Joint that are typically used to satisfy the owning Joint's parent and child frame connections (sockets). PhysicalOffsetFrames are often used to describe the fixed transformation from a Body's origin to another location of interest on the Body (e.g., the joint center). When the joint is deleted, so are the PhysicalOffsetFrame components in this list.-->
	<frames>
		<PhysicalOffsetFrame name="pelvis_offset">
			<!--The geometry used to display the axes of this Frame.-->
			<FrameGeometry name="frame_geometry">
				<!--Path to a Component that satisfies the Socket 'frame' of type Frame.-->
				<socket_frame>..</socket_frame>
				<!--Scale factors in X, Y, Z directions respectively.-->
				<scale_factors>0.20000000000000001 0.20000000000000001 0.20000000000000001</scale_factors>
			</FrameGeometry>
			<!--Path to a Component that satisfies the Socket 'parent' of type C (description: The parent frame to this frame.).-->
			<socket_parent>/bodyset/pelvis</socket_parent>
			<!--Translational offset (in meters) of this frame's origin from the parent frame's origin, expressed in the parent frame.-->
			<translation>0 0 0</translation>
			<!--Orientation offset (in radians) of this frame in its parent frame, expressed as a frame-fixed x-y-z rotation sequence.-->
			<orientation>0 0 0</orientation>
		</PhysicalOffsetFrame>
		<PhysicalOffsetFrame name="sacrum_offset">
			<!--The geometry used to display the axes of this Frame.-->
			<FrameGeometry name="frame_geometry">
				<!--Path to a Component that satisfies the Socket 'frame' of type Frame.-->
				<socket_frame>..</socket_frame>
				<!--Scale factors in X, Y, Z directions respectively.-->
				<scale_factors>0.20000000000000001 0.20000000000000001 0.20000000000000001</scale_factors>
			</FrameGeometry>
			<!--Path to a Component that satisfies the Socket 'parent' of type C (description: The parent frame to this frame.).-->
			<socket_parent>/bodyset/sacrum</socket_parent>
			<!--Translational offset (in meters) of this frame's origin from the parent frame's origin, expressed in the parent frame.-->
			<translation>0 0.049000000000000002 0</translation>
			<!--Orientation offset (in radians) of this frame in its parent frame, expressed as a frame-fixed x-y-z rotation sequence.-->
			<orientation>0 0 [b]0.1744[/b]</orientation>
		</PhysicalOffsetFrame>
	</frames>
</WeldJoint>
To change PI, I am changing the highlighted value from the ground_pelvis joint.

Code: Select all

<PhysicalOffsetFrame name="pelvis_offset">
	<!--The geometry used to display the axes of this Frame.-->
	<FrameGeometry name="frame_geometry">
		<!--Path to a Component that satisfies the Socket 'frame' of type Frame.-->
		<socket_frame>..</socket_frame>
		<!--Scale factors in X, Y, Z directions respectively.-->
		<scale_factors>0.20000000000000001 0.20000000000000001 0.20000000000000001</scale_factors>
	</FrameGeometry>
	<!--Path to a Component that satisfies the Socket 'parent' of type C (description: The parent frame to this frame.).-->
	<socket_parent>/bodyset/pelvis</socket_parent>
	<!--Translational offset (in meters) of this frame's origin from the parent frame's origin, expressed in the parent frame.-->
	<translation>-0.080000000000000002 -0.079000000000000001 0</translation>
	<!--Orientation offset (in radians) of this frame in its parent frame, expressed as a frame-fixed x-y-z rotation sequence.-->
	<orientation>0 0 [b]0.1744[/b]</orientation>
</PhysicalOffsetFrame>
Sorry if this feels all confusing. I am happy to do a call if it is easier. Please let me know.

User avatar
Jacob J. Banks
Posts: 97
Joined: Tue Jul 15, 2014 5:17 am

Re: subject-specific implementation of pelvic alignment

Post by Jacob J. Banks » Fri Mar 29, 2024 6:26 am

I'm slowly getting there...

I think what you suggested does ~95% of what you want it to. However, as you pointed out in an earlier correspondence, the Sacrum rotates about a point distal to the top center from which you reference your angles (see pic). I can't recall 100% why this is, but it is. You could, in theory change that, but it would require a lot of changes to anything that attaches the sacrum or Pelvis. And the biggest 'pain', though only for eye candy and it wouldn't impact the modeling results, would be to change the .vtp files so that GUI looks good (I've done this prior for the ribs, it's a pain).

So, I would suggest keeping this as is, but to do some geometry. After assigning your Sacral orientation offset, calculate the amount that angle raised/lowered and moved in the A/P linear direction the top center of the Sacrum. Then just remove those unwanted changes. This should work, and maybe even be overkill given that Sacrum rotates relative to the pelvis and that coordinate system is virtually aligned to the top of the sacrum (just way more anterior).
(in the pic I attached, the top coordinate system is what the sacrum moves relative to)

Does this help at all?

Assuming it sort of works. You may also want to consider normalizing the muscle lengths to whatever standing posture you come up with, so the muscles are at the same relative spot on their length strength curve between participants. This probably isn't huge issue, but something to consider.
Attachments
Picture2.png
Picture2.png (119.77 KiB) Viewed 2771 times

POST REPLY