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

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

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

2 Likes

@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.

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 will follow, and only if the PR gets accepted this would be available in the Slicer preview release.

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.

1 Like

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 ?

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

@rbumm The implementation could be something like:

  • add leading line length (and other display parameters, if needed) in the markups display node
  • 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
1 Like

I got the demo running by adding the label line actor in markups widget representation 2D - I see other actors being added here - would not this be the right place?

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.

1 Like

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.

4 Likes

@rbumm this is absolutely awesome

LabelConnectorLineColor can now be set. loaded, stored

2 Likes

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

Thank you. It is not yet included in preview.

ping @chir.set

I have been working on a similar annotation project like yours earlier this year. All was started in this thread. As I suppose you are interested, we could probably revive this PR

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.

1 Like

@rbumm thank you for making it possible

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

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 …

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