# Some problems about SegPostProcess

**URL:** <https://discourse.slicer.org/t/some-problems-about-segpostprocess/23845>\
**Category:** SlicerSALT\
**Created:** [June 13, 2022, 4:31am UTC](https://discourse.slicer.org/t/some-problems-about-segpostprocess/23845 "2022-06-13T04:31:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuanzhen\_cui](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/yuanzhen_cui/32/15624_2.png) [@yuanzhen\_cui](https://discourse.slicer.org/u/yuanzhen_cui)\
**Post date:** [June 13, 2022, 4:31am UTC](https://discourse.slicer.org/t/some-problems-about-segpostprocess/23845/1 "2022-06-13T04:31:03Z")

</div>

Operating system:MacOs  
Slicer version:4.1120210226  
Expected behavior:I try to execute the SegPostProcess with the example names “InputImage.nrrd” which download from the slicerssalt workshop.  
Actual behavior:The Log messages shows "SegPostProcess terminated with a fault.  
". Actually I also tried several \*.nrrd and \*.nii files, all of them didn’t execute SegPostProcess sucessfully. And If I use that files to execute “GenParaMesh” directly, Log messages will show Euler number is not satisfied. I really need some help.  
Thanks a lot!  
Cui

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 13, 2022, 1:48pm UTC](https://discourse.slicer.org/t/some-problems-about-segpostprocess/23845/2 "2022-06-13T13:48:17Z")

</div>

Could you describe what you would like to achieve? There may be other modules that work better.

---

<div class="post-metadata">

**Author:** ![yuanzhen\_cui](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/yuanzhen_cui/32/15624_2.png) [@yuanzhen\_cui](https://discourse.slicer.org/u/yuanzhen_cui)\
**Post date:** [June 13, 2022, 3:12pm UTC](https://discourse.slicer.org/t/some-problems-about-segpostprocess/23845/3 "2022-06-13T15:12:31Z")

</div>

Hi Mr.Lasso,  
Thanks for your reply, I will describe my question more specifically.

I want to generate mean shape from some medical nrrd files. And according to the tutorial, I should implement SPHARM first. But none of my examples complete “SegPostProcess” with default parameters. Error: **SegPostProcess terminated with a fault.** Even I try the example names “cillinder\_seg.nrrd” which download from the [slicersalt workshops](https://data.kitware.com/#collection/586fbb7b8d777f05f44a5c7b/folder/5e8cbd312660cbefba9c19b0). The “SegPostProcess” also failed to execute successfully.

And if I skip the “SegPostProcess” and implement “GenParaMesh” directly, I encounter **Euler equation not satisfied. Euler Number : 106516 - 106508 = 8**.

I think SPHARM is an essential step to generate mean shape because RigidAlignment require Surface meshes and parametrization sphere which are the output of the SPHARM. So I’m stuck.

Thanks again for your attention!  
Cui

---

<div class="post-metadata">

**Author:** ![yuanzhen\_cui](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/yuanzhen_cui/32/15624_2.png) [@yuanzhen\_cui](https://discourse.slicer.org/u/yuanzhen_cui)\
**Post date:** [June 13, 2022, 3:36pm UTC](https://discourse.slicer.org/t/some-problems-about-segpostprocess/23845/4 "2022-06-13T15:36:55Z")

</div>

Mr.Lasso,

According to the tutorial, **SegPostProcess** “_ensure spherical topology of the segmentations by filling any interior holes and by applying two smoothing operations_”, So I deduce SegPostProcess can solve the problem of **Euler equation**. Is my guess correct?

Then, I find the function **Label Map Smoothing** , which seems to have the same function as **SegPostProcess**. So I apply this function to my nrrd files. Surprisingly, some of them can implement **GenParaMesh** without Euler equation error. But others still have Euler equation error.

This is my whole process. Looking forward to your reply. Thanks!  
Cui

---

<div class="post-metadata">

**Author:** ![styner](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/styner/32/1024_2.png) [@styner](https://discourse.slicer.org/u/styner)\
**Post date:** [June 13, 2022, 5:53pm UTC](https://discourse.slicer.org/t/some-problems-about-segpostprocess/23845/5 "2022-06-13T17:53:17Z")

</div>

Hi Cui  
Are you trying to run SegPostProcess on a label/segmentation image with a single label? If not, then you need to provide which label (number) you would like to extract before you run SegPostProcess. This might be your problem with SegPostProcess.

And yes, essentially SegPostProcess smooths the label/segmentation (it performs a closing operation, a surface smoothing and a small hole filing operation). Using the Label Map Smoothing module will partially accomplish a similar thing (though the smoothing operator is different and there is no specific hole filing).

Martin

---

<div class="post-metadata">

**Author:** ![yuanzhen\_cui](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/yuanzhen_cui/32/15624_2.png) [@yuanzhen\_cui](https://discourse.slicer.org/u/yuanzhen_cui)\
**Post date:** [June 14, 2022, 9:19am UTC](https://discourse.slicer.org/t/some-problems-about-segpostprocess/23845/6 "2022-06-14T09:19:10Z")

</div>

Hi Mr.Styner,

Thank you very much for your help! Indeed, I forgot to set the label number that I want to extract.  
I have successfully run the **SegPostProcess** , and thanks for explaning the relation between **SegPostProcess** and **Label Map Smoothing**.

Have a nice day.  
Cui
