# SegmentMesher, Error: Command 'cleaver-cli.exe' returned non-zero exit status 3221226505

**URL:** https://discourse.slicer.org/t/segmentmesher-error-command-cleaver-cli-exe-returned-non-zero-exit-status-3221226505/31172
**Category:** Support
**Tags:** segmentmesher
**Created:** [August 16, 2023, 12:08pm UTC](https://discourse.slicer.org/t/segmentmesher-error-command-cleaver-cli-exe-returned-non-zero-exit-status-3221226505/31172 "2023-08-16T12:08:56Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Mehdi\_Khamesi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mehdi_khamesi/32/67180_2.png) [@Mehdi\_Khamesi](https://discourse.slicer.org/u/Mehdi_Khamesi)
#### Post date: [August 16, 2023, 5:34am UTC](https://discourse.slicer.org/t/segmentmesher-error-command-cleaver-cli-exe-returned-non-zero-exit-status-3221226505/31172/1 "2023-08-16T05:34:36Z")

</div>

Operating system: Windows 10  
Slicer version: 5.2.2  
Expected behavior: Creating volumetric mesh  
Actual behavior: Error: Command ‘cleaver-cli.exe’ returned non-zero exit status 3221226505

Hello everyone,

I have a Segmentation.seg.nrrd file which include four segments. I want to create volumetric mesh of that. But when I choose that and run SegmentMesher, it gives me the following error:

Error: Command ‘cleaver-cli.exe’ returned non-zero exit status 3221226505

I have tried it several times, even by one segment but got the same response.  
Please let me know if you have any suggestions to solve this issue.

Best wishes  
Mehdi

---

<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: [August 16, 2023, 12:12pm UTC](https://discourse.slicer.org/t/segmentmesher-error-command-cleaver-cli-exe-returned-non-zero-exit-status-3221226505/31172/3 "2023-08-16T12:12:26Z")

</div>

Try to adjust the parameters to generate a smaller, simpler, less accurate model to see if the mesh generation succeeds then.

---

<div class="post-metadata">

### Author: ![Mehdi\_Khamesi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mehdi_khamesi/32/67180_2.png) [@Mehdi\_Khamesi](https://discourse.slicer.org/u/Mehdi_Khamesi)
#### Post date: [August 16, 2023, 2:18pm UTC](https://discourse.slicer.org/t/segmentmesher-error-command-cleaver-cli-exe-returned-non-zero-exit-status-3221226505/31172/4 "2023-08-16T14:18:24Z")

</div>

Thanks for your attention.  
In fact, it does not generate mesh for a simple small tumor.

 ![Untitled](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/d/8d0b43aa4a4b22a4f4f1ce81445bc4712fae3787.png)

---

<div class="post-metadata">

### Author: ![Mehdi\_Khamesi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mehdi_khamesi/32/67180_2.png) [@Mehdi\_Khamesi](https://discourse.slicer.org/u/Mehdi_Khamesi)
#### Post date: [August 16, 2023, 6:27pm UTC](https://discourse.slicer.org/t/segmentmesher-error-command-cleaver-cli-exe-returned-non-zero-exit-status-3221226505/31172/5 "2023-08-16T18:27:56Z")

</div>

I installed this extension on another computer with same system and it works.  
So it seems that the model is not the problem.

Do you have any suggestion in this regard?

Many thanks

---

<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: [August 17, 2023, 11:23am UTC](https://discourse.slicer.org/t/segmentmesher-error-command-cleaver-cli-exe-returned-non-zero-exit-status-3221226505/31172/6 "2023-08-17T11:23:05Z")

</div>

It may be possible that language/regional settings in your operating system cause problems - indicated by the special characters in the working directory.

Could you try changing [this line](https://github.com/lassoan/SlicerSegmentMesher/blob/11c44ad4cb637a263facfdd980711dc370d6faa7/SegmentMesher/SegmentMesher.py#L638) to the line below and test if it resolved the issue?

```
    tempDirName = "test123“

```

---

<div class="post-metadata">

### Author: ![Mehdi\_Khamesi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mehdi_khamesi/32/67180_2.png) [@Mehdi\_Khamesi](https://discourse.slicer.org/u/Mehdi_Khamesi)
#### Post date: [August 18, 2023, 1:31pm UTC](https://discourse.slicer.org/t/segmentmesher-error-command-cleaver-cli-exe-returned-non-zero-exit-status-3221226505/31172/7 "2023-08-18T13:31:28Z")

</div>

Thank you for your response. I have installed the software in Windows 10 and to change this code I would try installing in Linux this weekend.

However, I wanted to analyze the output in COMSOL and I got it from the other computer. But I found that I can’t import .vtk or .msh into COMSOL. It seems that importing mesh file into COMSOL is much more complicated than other format specially for adding different physics. Also, I tried Gmsh and Salome to convert it to other importable formats. This wasn’t successful, too.

On the other hand, when I saved the model as STL format, it gives me a specific error in COMSOL (Geometry error (fin): Self-intersecting curve)  
Is there anyway to improve the quality of STL file that 3D Slicer gives us? Or any ideas to solve this issue?

Hope the best,  
Mehdi

---

<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: [August 18, 2023, 8:45pm UTC](https://discourse.slicer.org/t/segmentmesher-error-command-cleaver-cli-exe-returned-non-zero-exit-status-3221226505/31172/8 "2023-08-18T20:45:41Z")

</div>

Some users reported that they successfully converted VTK volumetric meshes using `meshio` Python package. You can install it into 3D Slicer’s Python environment by opening the Python console, typing `pip_install('meshio')`, then follow examples of the meshio package documentation.

---

<div class="post-metadata">

### Author: ![Mehdi\_Khamesi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mehdi_khamesi/32/67180_2.png) [@Mehdi\_Khamesi](https://discourse.slicer.org/u/Mehdi_Khamesi)
#### Post date: [August 20, 2023, 6:39pm UTC](https://discourse.slicer.org/t/segmentmesher-error-command-cleaver-cli-exe-returned-non-zero-exit-status-3221226505/31172/9 "2023-08-20T18:39:01Z")

</div>

Yes, as always you are right. It was due to language settings.

How ever I changed it in control panel. In fact, I didn’t understand in which section of program I need to change this code. I need to change line number 638, but where? Could you tell the path.

Many thanks
