# MarkupsLine not showing length measurement?

**URL:** <https://discourse.slicer.org/t/markupsline-not-showing-length-measurement/27365>\
**Category:** Support\
**Created:** [January 19, 2023, 7:13pm UTC](https://discourse.slicer.org/t/markupsline-not-showing-length-measurement/27365 "2023-01-19T19:13:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [January 19, 2023, 7:13pm UTC](https://discourse.slicer.org/t/markupsline-not-showing-length-measurement/27365/1 "2023-01-19T19:13:01Z")

</div>

In previous versions of Slicer, the length measurement was shown on the 3D view, but for some reason it doesn’t seem to be working for me now. I have a MarkupsLine node with two control points, but the length measurement is not being calculated

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/e/4e7ff09236a0edbd959fd6749894618ebd222a9a.png)  
Any suggestions? Or is there a different way I need to trigger this? Obviously it’s trivial to do the calculation myself, but previously this “just worked” in Slicer, so this seems like a bug.

I’m using Slicer 5.2.1. I just verified that opening a new Slicer instance and a single volume and adding a single MarkupsLine still shows this behavior (meaning it’s probably not caused by something weird I did in my current Slicer session). I also copied and pasted this section from [https://github.com/Slicer/Slicer/blob/a5f75351073ef62fd6198d9480d86c0009d70f9b/Modules/Loadable/Markups/Testing/Python/MarkupsMeasurementsTest.py](https://github.com/Slicer/Slicer/blob/a5f75351073ef62fd6198d9480d86c0009d70f9b/Modules/Loadable/Markups/Testing/Python/MarkupsMeasurementsTest.py)

> markupsNode = slicer.mrmlScene.AddNewNodeByClass(‘vtkMRMLMarkupsLineNode’)  
> length = 34.12  
> direction = np.array([0.3, -0.4, 0.8])  
> pos1 = np.array([20, -12.4, 3.8])  
> pos2 = pos1 + direction / np.linalg.norm(direction) \* length  
> markupsNode.AddControlPoint(vtk.vtkVector3d(pos1))  
> markupsNode.AddControlPoint(vtk.vtkVector3d(pos2))
> 
> measurement = markupsNode.GetMeasurement(“length”)  
> if abs(measurement.GetValue() - length) \> 1e-4:  
> raise Exception("Unexpected length value: " + str(measurement.GetValue()))

This gives the error “Unexpected length value: 0.0”, so I think that means that this test should not have passed, and also it is not just my code or behavior which is leading to this.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [January 19, 2023, 7:59pm UTC](https://discourse.slicer.org/t/markupsline-not-showing-length-measurement/27365/2 "2023-01-19T19:59:59Z")

</div>

> [@mikebind](#):
>
> I just verified that opening a new Slicer instance and a single volume and adding a single MarkupsLine still shows this behavior (meaning it’s probably not caused by something weird I did in my current Slicer session).

I have tried to replicate on my Windows machine, but I am observing that Slicer 5.2.1 is working appropriately by showing the line measurement. I also do not have any extensions installed. If you uninstall any extensions and re-install Slicer 5.2.1 fresh, do you have the same issues?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/8/c8136240b98444871a96116bd9ccdca839cf5e7e.jpeg)

I have also tried programmatically, but I’m still seeing correct behavior

```python
import SampleData
SampleData.SampleDataLogic().downloadMRHead()

markupsNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLMarkupsLineNode')
markupsNode.AddControlPoint(0,0,0)
markupsNode.AddControlPoint(10,10,10)

```

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/3/43b3f0143984ac690121f04a4aa5d97a5adc0d2e.png)

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [January 20, 2023, 5:48pm UTC](https://discourse.slicer.org/t/markupsline-not-showing-length-measurement/27365/3 "2023-01-20T17:48:22Z")

</div>

Thanks for checking. I will try without extensions when I get a chance.
