# Question on using decimated model in VMTK plugin

**URL:** <https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054>\
**Category:** Support\
**Tags:** vmtk, centerlines\
**Created:** [June 16, 2020, 11:55am UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054 "2020-06-16T11:55:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 16, 2020, 11:55am UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/1 "2020-06-16T11:55:52Z")

</div>

Hello Everyone,

I’ve decimated a model (Reduction: 0.7). The decimated model is used for Computing centerlines. After I hit Preview, the following is displayed in Python interactor

`Mesh subdivision failed. Skip subdivision step.`

Could someone explain what this error means? Is it ok do proceed with computing centerlines after the above-mentioned error pops up?

---

<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 16, 2020, 1:04pm UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/2 "2020-06-16T13:04:35Z")

</div>

By default, triangles of the mesh are subdivided to make network extraction more robust. However, mesh subdivision may fail for non-manifold meshes.

If your mesh resolution is already high enough (this is the case most of the time) then skipping mesh subdivision is not a problem. However, the failure indicates that the mesh has errors, which may impact network extraction, therefore you may consider smoothing the segmentation using median method (before model exporting the segmentation to model).

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 16, 2020, 1:37pm UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/3 "2020-06-16T13:37:46Z")

</div>

> [@lassoan](#):
>
> smoothing the segmentation using median method

Thank you.  
I couldn’t locate the module that offers smoothing using median method. Can I simply use Segment Editor and set `Smoothing Factor` to 1?

---

<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 16, 2020, 1:39pm UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/4 "2020-06-16T13:39:54Z")

</div>

Median smoothing method is available in Segment Editor’s Smoothing effect.

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 16, 2020, 1:56pm UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/5 "2020-06-16T13:56:35Z")

</div>

Thank you. Can I use the default value of 3.00 mm for Kernel size?

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 16, 2020, 2:49pm UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/6 "2020-06-16T14:49:57Z")

</div>

@lasson

I’ve used Median Smoothing to smooth the segment using default value of 3.00 mm for Kernel size . The [smoothed segment](https://github.com/DeepaMahm/misc/blob/master/Segmentation3_smoothed.seg.nrrd)  
was decimated (0.9 reduction) was converted to [model](https://github.com/DeepaMahm/misc/blob/master/segment3_model.vtk). The [decimated model](https://github.com/DeepaMahm/misc/blob/master/segment3_deci_0.9.vtk) is now used for Computing Centerlines.

Unfortunately, I get the same error (`Mesh subdivision failed. Skip subdivision step.`) for 0.9 reduction. This error doesn’t occur for 0.7 reduction now. But since the memory usage is high while computing centerlines, I want to decimate it \>0.9.

Could you please have a look at the model files shared in the links provided above?

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 17, 2020, 1:30am UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/7 "2020-06-17T01:30:42Z")

</div>

@lassoan

If you had a chance to look at the files, I’d like to know if the same error appears and I would also like to ask for suggestions on how to resolve to this error.  
Thanks a lot for all your support

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 17, 2020, 5:21pm UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/8 "2020-06-17T17:21:18Z")

</div>

@lassoan  
Reducing above 0.9 doesn’t work most of the time. I am really stuck here, unfortunately.

```
Mesh subdivision failed. Skip subdivision step.
Input model preparation failed. It probably has surface errors.
```

---

<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 17, 2020, 5:32pm UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/9 "2020-06-17T17:32:42Z")

</div>

There are several decimation methods available. Some of them work perfectly with your data set. I’m tuning things a bit and then describe which one to use and how.

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 17, 2020, 5:33pm UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/10 "2020-06-17T17:33:56Z")

</div>

Thanks a ton 🙂 🙃

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 19, 2020, 3:32am UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/11 "2020-06-19T03:32:49Z")

</div>

Hi @lassoan  
May I know when I will be able to use this feature?

---

<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 19, 2020, 4:47pm UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/12 "2020-06-19T16:47:12Z")

</div>

It is available in today’s Slicer Preview Release:

> [@New module: Extract Centerline (in SlicerVMTK extension)](https://discourse.slicer.org/t/new-module-extract-centerline-in-slicervmtk-extension/12117):
>
> We added a completely new module that makes vessel (or airway or any other tree structure) centerline extraction much faster, flexible, and robust. It can quickly extract a network, determine branch endpoints automatically, allows editing of endpoints, computing centerlines, branches, and quantitative metrics (radius, curvature, torsion, etc). The new “Extract Centerline” module is available in SlicerVMTK extension for latest Slicer-4.11 release (it replaces the old “Centerline Computation” modu…

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 20, 2020, 11:51am UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/13 "2020-06-20T11:51:57Z")

</div>

Hi @lassoan  
Thanks a lot, I really like the new module especially the relocation of endpoints for positioning on the Voronoi model, autodetect, and deletion of endpoints. In the Windows version, I could view both centerline and Voronoi model after hitting `Apply`. I am not able to view the Voronoi model in Linux version though.

Could you please explain a bit about how `Decimation Aggressiveness` woks?

I’d also like to know if the documentation of `Extract Centerlines` module is already available.

---

<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 20, 2020, 8:55pm UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/14 "2020-06-20T20:55:24Z")

</div>

Parameters are explained in tool tips that appear when you hover over with the mouse and leave there for a few seconds.

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 21, 2020, 3:30am UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/15 "2020-06-21T03:30:24Z")

</div>

Thank you.

> [@Deepa](#):
>
> I am not able to view the Voronoi model in Linux version though

 ![Untitled](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/f/0f151ad45441e4a712ea9510f24c63a7bf7cb05a.png)

Could you please look into this?

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 21, 2020, 3:55am UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/16 "2020-06-21T03:55:42Z")

</div>

> [@lassoan](#):
>
> Parameters are explained in tool tips that appear when you hover over with the mouse and leave there for a few seconds.

Thank you. I’m trying to understand the relation between `Target point count` and `Decimation aggressiveness`. From what I understand from the explanations provided in the tool tip, `Target point count` does the function of `Reduction` (a ratio, varied between 0-1; similarly what’s the range of `Decimation aggressiveness`) previously available in the `centerline computation` module i.e reduce the number of points on the surface. But I don’t clearly understand how `Decimation aggressiveness`

> Lower values preserve mesh integrity better but it may not be possible to reduce number of points to desired level

is related to `Target point count`. For instance, I thought if I vary one (e.g. `Target point count`) the other parameter (`Decimation Aggressivess`) will vary as a function of the former. But this doesn’t happen.

Could you please explain this a bit?

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [June 21, 2020, 4:00am UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/17 "2020-06-21T04:00:19Z")

</div>

> [@Deepa](#):
>
> I am not able to view the Voronoi model in Linux version though

You need to experiment a bit more to investigate the issue. For example, if you take the scene from the Linux, can you visualize the missing voronoi diagram on your windows? If that’s the case it might be related to your Linux graphics settings.

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 21, 2020, 4:29am UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/18 "2020-06-21T04:29:40Z")

</div>

Thank you. The problem is after using `Extract Centerlines`, in addition to the Voronoi model, I am not able to view the segmentation volume too (this can be seen in the snapshot posted above- the eye icon next to segmentation node is open ). The segmentation volume is visible after loading the file though, prior to centerline computation. The volume disappears after hitting Apply in `Extract Centerlines`. So I think the problem may not be due to the Linux graphics settings.

@lassoan Could you please look into this?

---

<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 21, 2020, 2:09pm UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/19 "2020-06-21T14:09:38Z")

</div>

Please add a new topic to discuss this models/volume not appearing issue. Try to reproduce it without VMTK, just by loading models and adjusting transparency settings and enabling/disabling depth peeling in the 3D view.

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 21, 2020, 4:23pm UTC](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054/20 "2020-06-21T16:23:01Z")

</div>

Thanks a lot for your response. Sure , my question on `Decimatin aggressivenes` remains here and I have navigated the other question to [new thread](https://discourse.slicer.org/t/problem-in-viewing-segmentation-volume-and-voronoi-model/12144)

[Next page](https://discourse.slicer.org/t/question-on-using-decimated-model-in-vmtk-plugin/12054.md?page=2)
