# Loading Annotation Ruler as Markups Line

**URL:** <https://discourse.slicer.org/t/loading-annotation-ruler-as-markups-line/21426>\
**Category:** Support\
**Tags:** markups\
**Created:** [January 12, 2022, 8:49pm UTC](https://discourse.slicer.org/t/loading-annotation-ruler-as-markups-line/21426 "2022-01-12T20:49:13Z")\
**Posts on this page:** 2\
**Page:** 1

<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 12, 2022, 8:49pm UTC](https://discourse.slicer.org/t/loading-annotation-ruler-as-markups-line/21426/1 "2022-01-12T20:49:13Z")

</div>

If I have a bunch of annotation ruler node objects saved to disk as .acsv files, what is the correct way to load these into Slicer as Markups Line node objects? I would like to use the improved display node capabilities of the Markups Line node.

Using the Add Data dialog, I changed the description from “Annotation” to “Markups”, but then I just get an error on load.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/8/a86e45a820e79da490225f769ac19518acdc23f5.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/4/6485d3ba511ae6f00e001a2b2e1a97287a434a15.png)

```auto
[ERROR][VTK] 12.01.2022 15:48:44 [vtkSlicerMarkupsLogic (000002B87EDA8550)] (D:\D\P\Slicer-0\Modules\Loadable\Markups\Logic\vtkSlicerMarkupsLogic.cxx:875) - vtkSlicerMarkupsLogic::LoadMarkups failed: unrecognized file extension in C:/Users/JamesButler/Downloads/C_1.acsv

```

---

<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 13, 2022, 5:23pm UTC](https://discourse.slicer.org/t/loading-annotation-ruler-as-markups-line/21426/2 "2022-01-13T17:23:46Z")

</div>

Through python code I’ll load the Annotation Ruler, get the positions of the 2 points, remove the Annotation Ruler, add a Markups Line, add 2 points with the same positions as the old object.

```python
ruler_path = r"C:\Users\JamesButler\Downloads\C_1.acsv"
old_ruler_node = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLAnnotationRulerNode')
storage_node = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLAnnotationRulerStorageNode')
storage_node.SetFileName(ruler_path)
success = storage_node.ReadData(old_ruler_node)
pos1 = [0, 0, 0]
pos2 = [0, 0, 0]
old_ruler_node.GetPosition1(pos1)
old_ruler_node.GetPosition2(pos2)
slicer.mrmlScene.RemoveNode(old_ruler_node)
ruler_node = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLMarkupsLineNode')
ruler_node.AddControlPoint(vtk.vtkVector3d(pos1))
ruler_node.AddControlPoint(vtk.vtkVector3d(pos2))

```
