# How to annotate/markup an image with arrows and anatomical names

**URL:** <https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588>\
**Category:** Support\
**Tags:** registration, segmentation, dicom, 3d-model\
**Created:** [January 24, 2022, 2:47am UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588 "2022-01-24T02:47:23Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [February 7, 2022, 1:16pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/21 "2022-02-07T13:16:58Z")

</div>

This is a 2D working demo of enhancing the normal fiducial markup with a connector line:

[https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/1/f1755dc1c3ac03fe0ac41599d9f72623359ddcaa.mp4](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/1/f1755dc1c3ac03fe0ac41599d9f72623359ddcaa.mp4)

It could be made optional via a checkbox in the markup widget “Display” section to have that line on or off.

---

<div class="post-metadata">

**Author:** ![Young\_Wang](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/young_wang/32/13926_2.png) [@Young\_Wang](https://discourse.slicer.org/u/Young_Wang)\
**Post date:** [February 7, 2022, 1:38pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/22 "2022-02-07T13:38:55Z")

</div>

@rbumm, Thank you so much for implementing this. I really like this feature, I think it’s both visually pleasing and functional. I also think the optional check box would be a great idea for those who are finding this feature too busy on the images. May I ask when can I find this feature in the released 3Dslicers? I was attempting to implement it but I haven’t found time to get this yet. Really appreciate your hard work.

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [February 7, 2022, 2:00pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/23 "2022-02-07T14:00:50Z")

</div>

Dear @Young_Wang , I was glad that you brought this up again and dug into the code to find the entry point for that connector line. This is only a demo - the Slicer developer team members could comment. I still have several unsolved technical details in that implementation. But I agree that a connector line option would be really helpful and they are fun to place. Technically, a pull request to [https://github.com/Slicer/Slicer](https://github.com/Slicer/Slicer) will follow, and only if the PR gets accepted this would be available in the Slicer preview release.

---

<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:** [February 7, 2022, 7:01pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/24 "2022-02-07T19:01:08Z")

</div>

Allowing display of labels at a certain distance from the control points, always shifted outwards in radial direction could be a nice and simple automatic line routing method, which could work well for many cases. So, it would be great if you could experiment with it a bit more.

There are issues, such as what to do control points that are close to the bounds of the view (the point would still be visible, but the label would be moved out of the view), or how to deal with overlap between labels, but it is hard to tell how much these impact practical usability without actually implementing and trying it.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/83011_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [February 7, 2022, 7:19pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/25 "2022-02-07T19:19:31Z")

</div>

> [@rbumm](#):
>
> Dear @Young_Wang , I was glad that you brought this up again and dug into the code to find the entry point for that connector line. This is only a demo - the Slicer developer team members could comment. I still have several unsolved technical details in that implementation. But I agree that a connector line option would be really helpful and they are fun to place. Technically, a pull request to [GitHub - Slicer/Slicer: Multi-platform, free open source software for visualization and image computing.](https://github.com/Slicer/Slicer) will follow, and only if the PR gets accepted this would be available in the Slicer preview release.

In the video, it appears you are creating each label as a separate pointList object (as opposed keeping them as control points within the object). Is that the intended use ?

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [February 7, 2022, 7:35pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/26 "2022-02-07T19:35:35Z")

</div>

No, it is intended to work also if you “place multiple control points” of one pointList. But currently, this part is not functional 🙂

---

<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:** [February 7, 2022, 11:18pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/27 "2022-02-07T23:18:42Z")

</div>

@rbumm The implementation could be something like:

- add leading line length (and other display parameters, if needed) in the [markups display node](https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Markups/MRML/vtkMRMLMarkupsDisplayNode.h)
- add an additional line actor for each control point that shifts the label and connects it to the control points in the [markups displayable manager](https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Markups/MRMLDM/vtkMRMLMarkupsDisplayableManager.cxx)

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [February 8, 2022, 12:39pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/29 "2022-02-08T12:39:00Z")

</div>

> [@lassoan](#):
>
> add an additional line actor for each control point that shifts the label and connects it to the control points in the [markups displayable manager](https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Markups/MRMLDM/vtkMRMLMarkupsDisplayableManager.cxx)

I got the demo running by adding the label line actor in [markups widget representation 2D](https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Markups/VTKWidgets/vtkSlicerMarkupsWidgetRepresentation2D.cxx) - I see other actors being added here - would not this be the right place?

---

<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:** [February 8, 2022, 2:40pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/30 "2022-02-08T14:40:04Z")

</div>

The displayable manager is responsible for displaying the widgets, but it delegates the details to VTK widgets. So, your change in 2D widget representation was correct. The same label offset approach should work for the 3D representation, too.

If we want to avoid overlapping labels between all the widgets then some coordination between widgets at the displayable manager level may be necessary (or even among all displayable managers), but first let’s see how far we can get with this simpler radial label offset strategy.

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [March 18, 2022, 7:17pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/31 "2022-03-18T19:17:13Z")

</div>

I have been working on this in recent weeks and came quite far by adding a connector line visibility checkbox and a relative line size slider. Loading and saving the line-related information and display of the line connectors in 2D and 3D view. This is under review now but expect it to be available soon.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/4/547742df90fd380bfeba15500546f9bcd22b4c9d.jpeg)

---

<div class="post-metadata">

**Author:** ![Young\_Wang](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/young_wang/32/13926_2.png) [@Young\_Wang](https://discourse.slicer.org/u/Young_Wang)\
**Post date:** [March 22, 2022, 12:42pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/32 "2022-03-22T12:42:10Z")

</div>

@rbumm this is absolutely awesome

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [April 3, 2022, 7:25pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/33 "2022-04-03T19:25:58Z")

</div>

LabelConnectorLineColor can now be set. loaded, stored

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/7/a75d9c6e8e8a1ee933ca3bd472ff7edc885418a3.jpeg)

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/83011_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [April 4, 2022, 5:21pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/34 "2022-04-04T17:21:44Z")

</div>

This is awesome. Is it still experimental or already incorporated to the preview version?

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [April 4, 2022, 7:04pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/35 "2022-04-04T19:04:15Z")

</div>

Thank you. It is not yet included in preview.

> <https://github.com/Slicer/Slicer/pull/6188#issuecomment-1087812490>
>
> Label text offsets and a connector line (as in anatomy books)  would be awesome …to have when labeling anatomical structures. 
> 
>  This is an implementation of label text connector lines for fiducial markups. 
> 
> !\[\](https://user-images.githubusercontent.com/18140094/153926721-1eb54057-fbe7-49cb-a54a-bd8c779b68a3.png)
> 
> Please see the comments for questions. Thank you.

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [August 1, 2022, 5:59pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/36 "2022-08-01T17:59:39Z")

</div>

ping @chir.set

I have been working on a similar annotation project [like yours](https://github.com/chir-set/ExtraMarkups/tree/main/Label/) earlier this year. All was started in this thread. As I suppose you are interested, we could probably revive this PR

---

<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:** [August 1, 2022, 7:06pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/37 "2022-08-01T19:06:53Z")

</div>

I see that your work is quite mature and just needs to be merged in Slicer. I hope this gets done soon, after which, mine would become moot and removed. For me, it has been a good and enriching experiment. You may of course borrow any feature you may find useful from it. Looking forward to use your implement in Slicer directly.

---

<div class="post-metadata">

**Author:** ![Young\_Wang](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/young_wang/32/13926_2.png) [@Young\_Wang](https://discourse.slicer.org/u/Young_Wang)\
**Post date:** [October 5, 2022, 11:21pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/38 "2022-10-05T23:21:15Z")

</div>

@rbumm thank you for making it possible

---

<div class="post-metadata">

**Author:** ![Piergiorgio\_Gaudioso](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/piergiorgio_gaudioso/32/68592_2.png) [@Piergiorgio\_Gaudioso](https://discourse.slicer.org/u/Piergiorgio_Gaudioso)\
**Post date:** [December 5, 2023, 1:49pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/39 "2023-12-05T13:49:09Z")

</div>

What about exporting annotations/markups/segmentation in a DICOM file integrated with an MRI image? Is it possible? Could you provide a tutorial?

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [December 5, 2023, 2:45pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/40 "2023-12-05T14:45:19Z")

</div>

Unfortunately, the annotations with connector lines have not been implemented in the Slicer source code yet.  
@chir.set has made an extension that has similar functionality, maybe you could try that …

> **[GitHub - chir-set/SlicerExtraMarkups: Custom markups for Slicer](https://github.com/chir-set/SlicerExtraMarkups)**
>
> Custom markups for Slicer. Contribute to chir-set/SlicerExtraMarkups development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Piergiorgio\_Gaudioso](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/piergiorgio_gaudioso/32/68592_2.png) [@Piergiorgio\_Gaudioso](https://discourse.slicer.org/u/Piergiorgio_Gaudioso)\
**Post date:** [December 5, 2023, 3:00pm UTC](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588/41 "2023-12-05T15:00:15Z")

</div>

THank you for the information. Is it possible to export a DICOM file with those markups?

[Previous page](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588.md?page=1)

[Next page](https://discourse.slicer.org/t/how-to-annotate-markup-an-image-with-arrows-and-anatomical-names/21588.md?page=3)
