# How to skip alignments during para to spharm mesh

**URL:** <https://discourse.slicer.org/t/how-to-skip-alignments-during-para-to-spharm-mesh/9848>\
**Category:** SlicerSALT\
**Created:** [January 17, 2020, 7:52am UTC](https://discourse.slicer.org/t/how-to-skip-alignments-during-para-to-spharm-mesh/9848 "2020-01-17T07:52:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oh\_jeongseok](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/oh_jeongseok/32/5694_2.png) [@Oh\_jeongseok](https://discourse.slicer.org/u/Oh_jeongseok)\
**Post date:** [January 17, 2020, 7:52am UTC](https://discourse.slicer.org/t/how-to-skip-alignments-during-para-to-spharm-mesh/9848/1 "2020-01-17T07:52:04Z")

</div>

Hello, I’m using 3D Slicer and SPHARM extentions.

I tried making surface ssm with tibias. To apply this methods, I align all models before using SPHARM(picture on right).

However, while SPHARM module is running, the alignments were changed.  
(the picture on the left is result of alignment which is done by SPHARM module)  
I tried to run with using registration templetes but the results were same.

So, I want to know if it can do SPHARM mesh generation without doing align again(suppose the models are all aligned already like picture on the right)

Thank you for read this question.!  
[Screenshot from 2020-01-17 14-33-35|690x391](https://discourse.slicer.org/404)

Regards,  
Jeongseok

---

<div class="post-metadata">

**Author:** ![Oh\_jeongseok](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/oh_jeongseok/32/5694_2.png) [@Oh\_jeongseok](https://discourse.slicer.org/u/Oh_jeongseok)\
**Post date:** [January 17, 2020, 1:24pm UTC](https://discourse.slicer.org/t/how-to-skip-alignments-during-para-to-spharm-mesh/9848/2 "2020-01-17T13:24:24Z")

</div>

Operating system: ubuntu 16.04  
Slicer version: 4.10.2  
Expected behavior:  
Actual behavior:

 ![Screenshot from 2020-01-17 14-33-35](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/8/e8369379a4b23335be754fd7d0efa71a95acc17a.png)

Hello,

I tried making surface ssm with tibias. To apply this methods, I align all models before using SPHARM(picture on right).

However, while SPHARM module is running, the alignments were changed.  
(the picture on the left is result of SPHARM module’s doing alignment)  
I tried to run with using registration templetes but the results were same.

So, I want to know if it can do SPHARM mesh generation without doing align again(suppose the models are all aligned already like picture on the right)

Thank you for read this question.

Regards,  
Jeongseok

---

<div class="post-metadata">

**Author:** ![bpaniagua](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bpaniagua/32/20_2.png) [@bpaniagua](https://discourse.slicer.org/u/bpaniagua)\
**Post date:** [January 17, 2020, 9:28pm UTC](https://discourse.slicer.org/t/how-to-skip-alignments-during-para-to-spharm-mesh/9848/3 "2020-01-17T21:28:42Z")

</div>

Hi Jeonseonk

Sorry to hear you are having trouble.  
What output files are you showing in that display? What is the suffix appended by the module?

Thanks,  
Bea

---

<div class="post-metadata">

**Author:** ![Oh\_jeongseok](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/oh_jeongseok/32/5694_2.png) [@Oh\_jeongseok](https://discourse.slicer.org/u/Oh_jeongseok)\
**Post date:** [January 19, 2020, 10:57pm UTC](https://discourse.slicer.org/t/how-to-skip-alignments-during-para-to-spharm-mesh/9848/4 "2020-01-19T22:57:32Z")

</div>

The left side is capture of \_\_surf\_SPHARM\_ellalign.vtk s and colormap attribute was paraPhi , and right side is of \_\_surf\_SPHARM.vtk s.

I’m using 3D slicer, so I didn’t use command lines. I changed iteration numbers, subdivision levels and registration templete options. As I mentioned above, I tried without templete option too but it doesn’t changed. I also tried flip option but it was not really good.

Thank you,  
Jeongseok.

---

<div class="post-metadata">

**Author:** ![bpaniagua](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bpaniagua/32/20_2.png) [@bpaniagua](https://discourse.slicer.org/u/bpaniagua)\
**Post date:** [January 20, 2020, 2:09pm UTC](https://discourse.slicer.org/t/how-to-skip-alignments-during-para-to-spharm-mesh/9848/5 "2020-01-20T14:09:59Z")

</div>

Hi,

First, you need to work only with the \*surf\_SPHARM.vtk cases. In those (that right now are flipped), you will need to manually enforce flips (see pp. 44 in the [SPHARM tutorial](https://docs.google.com/presentation/d/1ZZ6UpONwTl_GKk66Kde9Brq0PIDujw2pKavm1RD1SBo/present?slide=id.p44)) since some of your tibias are wider in the upside than the downside.

This will mean identifying those cases that are flipped and enforce the right alignment for those cases.  
When you recompute those flips then you will be able to use the \*ellalign.vtk cases.

Hope that helps!  
Bea

---

<div class="post-metadata">

**Author:** ![Oh\_jeongseok](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/oh_jeongseok/32/5694_2.png) [@Oh\_jeongseok](https://discourse.slicer.org/u/Oh_jeongseok)\
**Post date:** [January 21, 2020, 8:19am UTC](https://discourse.slicer.org/t/how-to-skip-alignments-during-para-to-spharm-mesh/9848/6 "2020-01-21T08:19:01Z")

</div>

Hi,

Thank you for your suggestion. However, I have some more questions.

1. Can I skip alignment process?  
Either I use flip or not, it seems like that do ellipsoid align to find poles and then make the mesh, and after this process, multiply the inverse of transformation matrix to go back to original location. It might be the \*surf\_SPHARM.vtk s. The figures are results with some flip options but no flip to 1~6th models, but alignments are changed and the \*surf\_SPHARM.vtk s are also affected by that… So I take care about ellalign things and try to find skipping alignment process.

 ![ellaligned_Screenshot from 2020-01-21 16-48-38](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/7/873a3674962b40787e4d5d6d80e37007f0f50871.png)

1. Is GenParaMesh process necessary to solve this problem? I’m now thinking this can occur because from GenParaMesh process also affected with alignments that I didn’t expect. I didn’t check ‘Overwrite’ options in GenParaMesh process so that I can use existing files.

If I have wrong concept, please let me know.

because english is not native language, I couldn’t explain simple and clear. Please understand me.  
Thank you for your help.  
Jeongseok

---

<div class="post-metadata">

**Author:** ![bpaniagua](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bpaniagua/32/20_2.png) [@bpaniagua](https://discourse.slicer.org/u/bpaniagua)\
**Post date:** [January 21, 2020, 2:16pm UTC](https://discourse.slicer.org/t/how-to-skip-alignments-during-para-to-spharm-mesh/9848/7 "2020-01-21T14:16:58Z")

</div>

Hi Jeongseok

For what i see, the only way you will be able to use all your data is to flip certain cases (for what i can see 11B07, 11b09, 11B21, 11B23 and 11B24). The flip process is very fast, it only re-runs paratospharmmesh. What i would do is:

1. First generate all possible flips for one of those cases, just to find the right flip for your data.
2. Once the right flip has been identified, run it for all the cases that require flipping.

We incorporated all of this in the new module to make it easier, before we used bash scripts that just re-run ParaToSPHARMMesh. Let me know if you rather use that.

HTH  
Bea
