# Shared Boundary Implementation

**URL:** <https://shapeworks.discourse.group/t/shared-boundary-implementation/105>\
**Category:** Uncategorized\
**Created:** [January 7, 2023, 9:44pm UTC](https://shapeworks.discourse.group/t/shared-boundary-implementation/105 "2023-01-07T21:44:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![BMoscoloni](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@BMoscoloni](https://shapeworks.discourse.group/u/BMoscoloni)\
**Post date:** [January 7, 2023, 9:44pm UTC](https://shapeworks.discourse.group/t/shared-boundary-implementation/105/1 "2023-01-07T21:44:39Z")

</div>

Hello everyone,

I am currently working on a statistical shape mode of cardiac biventricular meshes. I am performing a multidomain optimization of the left ventricle and right ventricle and it works just fine, however, I am wondering if there is a way to add a constraint on the septum so that the particles lying in that shared boundary are shared between the two shapes.  
I am not sure if there is a built-in way to do this but any advice on how to represent the shared boundary could be helpful.

Thank you all in advance!

Kind regards,

Beatrice

---

<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:** [January 9, 2023, 4:34pm UTC](https://shapeworks.discourse.group/t/shared-boundary-implementation/105/2 "2023-01-09T16:34:45Z")

</div>

Yes, we have performed shape analysis on shared boundaries such as biventricle data. An example pipeline using a toy dataset is provided here:

> <https://github.com/SCIInstitute/ShapeWorks/blob/master/Examples/Python/peanut_shared_boundary.py>

---

<div class="post-metadata">

**Author:** ![BMoscoloni](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@BMoscoloni](https://shapeworks.discourse.group/u/BMoscoloni)\
**Post date:** [January 23, 2023, 2:13pm UTC](https://shapeworks.discourse.group/t/shared-boundary-implementation/105/3 "2023-01-23T14:13:43Z")

</div>

Hello,

Thank you for you reply!  
I tried implementing the shape model similarly to the example and I’m getting some good result for the single domains, however in the reconstructed mean shape the surfaces are not matching at the boundaries and they intersect (I’m attaching a screenshot of the mean shape).  
I suppose that there is an underlining issue with the orientation and alignment of the shape, but I am not sure what is the best approach to fix this. At the moment I’m doing ICP alignment during the grooming step and Procrustes alignment during the optimization step but maybe I need to do some an extra alignment step the pre-processing too? Do you have any advice how to fix this?

Kind regards,

Beatrice

 ![image](https://global.discourse-cdn.com/free1/uploads/shapeworks/original/1X/048ac1841f103b842ee89a52a2ea585aa7fbf14d.jpeg)

---

<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:** [January 24, 2023, 5:13pm UTC](https://shapeworks.discourse.group/t/shared-boundary-implementation/105/4 "2023-01-24T17:13:32Z")

</div>

For our biventricle models, we aligned the ventricle meshes before generating the shared boundary, we then didn’t used any further alignment (e.g. 4 domain alignment or procrustes).

---

<div class="post-metadata">

**Author:** ![BMoscoloni](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@BMoscoloni](https://shapeworks.discourse.group/u/BMoscoloni)\
**Post date:** [April 13, 2023, 5:33pm UTC](https://shapeworks.discourse.group/t/shared-boundary-implementation/105/5 "2023-04-13T17:33:09Z")

</div>

Hello,

I have a further question regarding shared boundary implementation. I am following the example on the GitHub, but I am having quite jagged edges in the meshes after shared boundary extraction. I am currently using .smoothSinc(30, 0.5) but the result is still not ideal. Is there anything else that can help getting better results? Perhaps some specific pre-processing of the original meshes.

Thanks for your help and kind regards,

Beatrice

---

<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:** [April 13, 2023, 10:37pm UTC](https://shapeworks.discourse.group/t/shared-boundary-implementation/105/6 "2023-04-13T22:37:37Z")

</div>

We’ve also encountered difficulty in smoothing the boundaries afterward.

You could try remeshing at a high vertex count (e.g. higher than original) and see if that helps.

---

<div class="post-metadata">

**Author:** ![BMoscoloni](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@BMoscoloni](https://shapeworks.discourse.group/u/BMoscoloni)\
**Post date:** [May 17, 2023, 3:18pm UTC](https://shapeworks.discourse.group/t/shared-boundary-implementation/105/7 "2023-05-17T15:18:46Z")

</div>

Hello,

I managed to obtain a satisfactory smoothing of the boundaries playing around with smoothing factors, however now I am having some troubles during the optimization.

While the particles on the other domains are in good correspondence, the ones on the boundary contour seem to be completely off and the first modes are mostly picking up on that (see image - this is mode 2).

 ![image](https://global.discourse-cdn.com/free1/uploads/shapeworks/original/1X/7c9b39be5e2fc6b22c0fb29a4e41a164f3c70d52.jpeg)

Has anyone encountered similar problems or do you know how to solve it?

Thank you in advance for your help!

Kind regards,

Beatrice
