# How to Calculate Mode Coefficients for a Target Shape in ShapeWorks

**URL:** <https://shapeworks.discourse.group/t/how-to-calculate-mode-coefficients-for-a-target-shape-in-shapeworks/284>\
**Category:** Uncategorized\
**Created:** [October 23, 2024, 5:50pm UTC](https://shapeworks.discourse.group/t/how-to-calculate-mode-coefficients-for-a-target-shape-in-shapeworks/284 "2024-10-23T17:50:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexzeng](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@Alexzeng](https://shapeworks.discourse.group/u/Alexzeng)\
**Post date:** [October 23, 2024, 5:50pm UTC](https://shapeworks.discourse.group/t/how-to-calculate-mode-coefficients-for-a-target-shape-in-shapeworks/284/1 "2024-10-23T17:50:47Z")

</div>

Hello everyone, I would like to ask a question in this forum. I have input seven samples into ShapeWorks for analysis, and I obtained the mean shape of the project as well as the displacements of different modes. If I want to know the coefficient values that a particular sample holds in different modes, i.e., how to solve for the coefficients in the equation: target shape = mean shape + sum(coefficient \* mode shape displacement)? Is there a way to obtain this within the software, or can I calculate this using a Python script? Thank you!

---

<div class="post-metadata">

**Author:** ![amorris](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amorris](https://shapeworks.discourse.group/u/amorris)\
**Post date:** [October 23, 2024, 5:59pm UTC](https://shapeworks.discourse.group/t/how-to-calculate-mode-coefficients-for-a-target-shape-in-shapeworks/284/2 "2024-10-23T17:59:31Z")

</div>

Yes, you can export the PCA Component Scores from within ShapeWorks Studio.

---

<div class="post-metadata">

**Author:** ![Alexzeng](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@Alexzeng](https://shapeworks.discourse.group/u/Alexzeng)\
**Post date:** [November 4, 2024, 6:59am UTC](https://shapeworks.discourse.group/t/how-to-calculate-mode-coefficients-for-a-target-shape-in-shapeworks/284/3 "2024-11-04T06:59:59Z")

</div>

Thanks a lot for your response ! But I wonder why it’s not fit to my original obj data when I use the PCA Component Scores data from Shapeworks. I wanna know how to use the values of these PCA component scores. Thanks !

---

<div class="post-metadata">

**Author:** ![amorris](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amorris](https://shapeworks.discourse.group/u/amorris)\
**Post date:** [November 5, 2024, 6:29pm UTC](https://shapeworks.discourse.group/t/how-to-calculate-mode-coefficients-for-a-target-shape-in-shapeworks/284/4 "2024-11-05T18:29:34Z")

</div>

The original samples world particles (aligned, with procrustes if enabled) should match:

`mean_shape + (score1 * eigenvector1) + (score2 * eigenvector2) + (score3 * eigenvector3) + ...`

Using all most should enable you to reconstruct each shape in the original dataset.

---

<div class="post-metadata">

**Author:** ![Alexzeng](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@Alexzeng](https://shapeworks.discourse.group/u/Alexzeng)\
**Post date:** [November 15, 2024, 8:16am UTC](https://shapeworks.discourse.group/t/how-to-calculate-mode-coefficients-for-a-target-shape-in-shapeworks/284/5 "2024-11-15T08:16:22Z")

</div>

OK, I see ! Thanks a lot for your response ! I can successfully reconstruct the target model finally !
