# VMTK centreline and metrics

**URL:** <https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203>\
**Category:** Support\
**Created:** [June 24, 2020, 3:40pm UTC](https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203 "2020-06-24T15:40:07Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [June 24, 2020, 3:40pm UTC](https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203/1 "2020-06-24T15:40:07Z")

</div>

This is a feature request concerning VMTK centerline and its metrics.

GLOBAL METRICS

The below image shows a sigle centerline of a pathological artery. It is not clear where is located the measured radius.

 ![SceneView](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/1/7159d7d21efdcd05ea6b697662736aa840e10ab3.jpeg)

I wish the table data gives the minimum and the maximum radius too, between the two enpoints. At best, a graph of the measured radius at every millimeter would be helpful.

TARGETED METRICS

The image below shows a cross-section of a normal artery, where the radius is the same in every direction. In the pathological artery, the lumen morphology varies considerably.

 ![ArteryLumen](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/3/b38f3cdb511fd5f855ae2ddd51d2973ac7207cae.png)

I wish that we can click on any point of the centreline, and get the minimum and maximum radius at the chosen point in some way. At best, a plane perpendicular to the centreline could be drawn in the segment, and remains visible with its metrics shown in the view, or in a separate table.

CLINICAL RELEVANCE

We usually care of vessel diameter, not radius. The conversion is straightforward, but has yet to be done. An additional column showing diameters would be welcome.

Hoping that these requests get considered.

Best regards.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [June 28, 2020, 9:14pm UTC](https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203/2 "2020-06-28T21:14:16Z")

</div>

I pushed a [module](https://github.com/chir-set/CenterLineMetrics) that plots average diameters of a CMTK centerline. It’s templated over [LineProfile](https://github.com/PerkLab/SlicerSandbox/tree/master/LineProfile) module.

Comments of Slicer’s gurus are welcome.

Regards.

---

<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:** [July 1, 2020, 1:22am UTC](https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203/3 "2020-07-01T01:22:55Z")

</div>

The module looks nice! It could be added to SlicerVMTK extension.

I would just recommend to fix/improve two things:

1. The distance computation along the centerline. Currently, you project the centerline to a selected axis, but instead we should use distance along centerline. This distance should be fairly easy to compute (sum of Euclidean distances between points), but I am sure it can be already computed by VMTK (as far as I understand, this is called the “abscissa” and computed by filters like vmtkBranchMetrics).

2. Use the latest scripted module template in Extension Wizard module in latest Slicer Preview Release (that is downloaded July 1, 2020 or later), as it is greatly improved. Most importantly, the GUI is created in Qt Designer instead of manual scripting.

Once these are addressed, it would be great if you could submit a pull request to [SlicerVMTK extension](https://github.com/vmtk/SlicerExtension-VMTK) that adds this new module.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [July 1, 2020, 6:38am UTC](https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203/4 "2020-07-01T06:38:48Z")

</div>

> [@lassoan](#):
>
> but instead we should use distance along centerline

True; would be closer to interventional reality. I’ll have a closer look as to what VMTK offers… within my technical limits. Thanks for the hints.

> [@lassoan](#):
>
> a selected axis

This has just been adressed, any of the RAS axis can be selected.

> [@lassoan](#):
>
> Use the latest scripted module template

Does it mean ‘do rewrite the GUI’ ?

---

<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:** [July 1, 2020, 1:00pm UTC](https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203/5 "2020-07-01T13:00:20Z")

</div>

> [@chir.set](#):
>
> Does it mean ‘do rewrite the GUI’ ?

It means that you don’t need any code for creating the GUI, but use QtDesigner. It allows you to create your user interface by drag-and-dropping widgets and setting its properties.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [July 2, 2020, 7:29pm UTC](https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203/6 "2020-07-02T19:29:46Z")

</div>

> [@lassoan](#):
>
> we should use distance along centerline

Fixed.

> [@lassoan](#):
>
> the GUI is created in Qt Designer

But there’s only a QVTKWidget if system VTK is installed, not the like of qMRMLNodeComboBox.

---

<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:** [July 2, 2020, 7:37pm UTC](https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203/7 "2020-07-02T19:37:44Z")

</div>

To see all the Slicer and CTK widgets, launch Qt designer by clicking on “Edit UI” button in the module’s “Reload & Test section”.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [July 3, 2020, 6:54am UTC](https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203/8 "2020-07-03T06:54:47Z")

</div>

> [@lassoan](#):
>
> launch Qt designer by clicking on “Edit UI” button

I get ‘designer-real missing’ message. This is home built Slicer, and designer-real is missing in the SuperBuild tree. This file does exist in factory packages. What config switch do I have to use to get it built ? 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:** [July 3, 2020, 7:01pm UTC](https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203/9 "2020-07-03T19:01:01Z")

</div>

Qt designer can be launched correctly in the build tree on Windows, but maybe there are issues on Linux or Mac. You can also try launching it using `./Slicer --designer`. It would be great if you could investigate the issue and maybe even come up with a fix.

In the meantime, you can download and use an official Slicer build to run Qt Designer.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [July 3, 2020, 7:50pm UTC](https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203/10 "2020-07-03T19:50:29Z")

</div>

I’m using as a workaround :

> ./Slicer --launch konsole  
> "# In the new terminal  
> designer-qt5

Then I have all CTK, VTK, MRML widgets.

Will investigate when possible. First, I’ll rebase the module on a .ui file.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [July 7, 2020, 2:23pm UTC](https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203/11 "2020-07-07T14:23:15Z")

</div>

> [@lassoan](#):
>
> the GUI is created in Qt Designer instead of manual scripting.

I updated the GUI part of the module on Qt Designer. If you deem it worthwhile, I’ll delve into the pull request.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [July 14, 2020, 2:25pm UTC](https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203/12 "2020-07-14T14:25:56Z")

</div>

> [@chir.set](#):
>
> a plane perpendicular to the centreline

Not exactly what I thought of but quite near, this [module](https://github.com/chir-set/PathReformat) can move a 2D view perpendicular to a centerline. What puzzles me is the amount of rotation in the 2D view when the path is convoluted. We won’t have these rotations with Curve Planar Reformat.

Just saying, might be useful.

N.B : it has nothing to do with metrics.

---

<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:** [May 9, 2022, 1:52pm UTC](https://discourse.slicer.org/t/vmtk-centreline-and-metrics/12203/13 "2022-05-09T13:52:41Z")

</div>

> [@chir.set](#):
>
> this [module](https://github.com/chir-set/PathReformat) can move a 2D view perpendicular to a centerline

The module is available in VMTK extension now, it is called `Cross-Section Analysis`. See its [documentation](https://github.com/vmtk/SlicerExtension-VMTK/blob/master/Docs/CrossSectionAnalysis.md)) for some more information.
