Tickmarks on markups line

查了这里才知道,没有vtkMRMLMarkupsRulerNode,我想加入ruler的效果,该怎么实现呢?

In Slicer: vtkMRMLMarkupsNode Class Reference, I found out that there is no “vtkMRMLMarkupsRulerNode”, I want to add the effect of “Ruler”(Line with tick marks), how can I achieve it?

As far as I know there are no tick marks on the Markups lines like there were on Annotation rulers. It would be a nice feature for both straight lines and curves to have configurable tick marks at regular intervals in world space.

@jumbojing you could add a feature request to the bugtracker about adding tickmarks to markups line. If the issue gets enough upvotes (:+1:) then we’ll implement it. If it is urgent for you then you can try to implement it yourself or find a student or software developer with C++ and VTK programming experience who contribute this enhancement.

The idea of adding tickmarks has come up again here, as we are getting closer to the phase-out of the deprecated annotation ruler and ROI.

Adding tickmarks to markup lines would not be hard, but I’m not sure yet if this is the best fulfillment of the user requirements, or if this is just motivated by limitations (limited display settings, no vertical line, line not movable) of the current view ruler:

image

All, who are interested in showing tickmarks for markupines, please describe your workflows: how would you make use of tickmarks and how it would work (would you subdivide the lines to a fix number of sections, or tickmarks positions would be at predefined physical distances, etc).

Showing tick marks for distance measurement is not common in medical image analysis software. If you know of any software that displays tickmarks for distance measurement lines then it would be useful if you could provide screenshots and explain how those software work.

Tickmarks on Markups Line nodes would be to mimic the styling of the Slice viewer ruler. There are ticks marks on that ruler for a reason so therefore should be supported for the line node as well. If you think tickmarks on a ruler is not necessary, you must think the tickmarks on the Slice viewer are also not necessary. Would you have plans to remove these?

The tick mark positions would at minimum be set like the Slice viewer ruler which is determined by the scale. Since a line node is usually fully in view, having the tick interval set by the length of the line makes sense. A line node that is 50mm>length>25mm would have a tick interval of 10mm. A line node that is 25mm>length>10mm would have a major tick interval of 5mm with minor tick interval of 1mm.

Screenshots can be acquired of the slice view and sometimes you can place a ruler node with the tickmarks to be seen in the screenshot to give better detail than the Slice viewer ruler.

I agree with @jamesobutler that tick marks on markups lines in slice views would be useful in cases where the bottom ruler is not as helpful. For example a diagonal measurement in the middle of a view.

But it’s especially important in 3D views, where you may want several lines at different orientations and distances from the camera and you don’t wan to be in parallel projection mode to turn on the ruler (which still may be harder to interpret than a line directly on the anatomy of interest).

Thanks for the additional information.

Use cases

It seems that we have a few quite distinct use cases:

  1. Displaying size reference. Have a single object in the view that helps assessing sizes and distances.
  2. Measure distances and size of objects. Trivial in both 2D and 3D, using a linear measurement tool.
  3. Providing visual cues for sizes and distance in 3D, between specific objects or along specific trajectories.

Implementation

  1. Displaying size reference in slice views it is trivial - using the “view ruler”. The view ruler is like a scale bar on a map. It is useful if you can read different distances from it, that’s why it often has tickmarks in most software. Tickmarks are well defined because the ruler always shows a “round” distance value (5, 10, 50, 100, …). We can improve it for sure. For example adding an option for displaying a vertical one would make a lot of sense.

In 3D views, it is more tricky due to foreshortening and potentially using perspective projection. Some applications show 3 axes or a box with tickmarks or lines, but I don’t think they are really effective. For parallel projection the horizontal/vertical bars are sufficient and for perspective projection nothing really helps. I think it is simply too hard to estimate sizes and distances from a single view in perspective projection mode, with some static size reference objects.

  1. The current markups line implementation fulfills this need quite well.

  2. Providing visual distance and size cues between specific obejcts etc. in 3D is hard. Displaying a reference object in 3D that has multiple size markings (such as a ruler object with tickmarks or needle object with depth markers) works quite well. However, simple static rulers are not sufficient for this, as you need to dynamically align the reference object position and direction. For this, you need a specialized module anyway, for example the Breach Warning module in SlicerIGT extension:

The module used annotation rulers to display the line and the tickmarks were handy, but the appearance of rulers were very poor (2D line, no occluded opacity support, disks as tickmarks were ugly, etc.). Adding nice tickmarks to markup lines would be one solution, but since we need to use a special module anyway, we could get a better, more specialized, more optimized solution with less effort overall.


It would be important to know if there are any other use cases, because that would help with deciding on implementations, especially for use case 3.

I can’t comment on 3D view usage as my group use it as 2D slice view stuff only. Placing line node points is difficult in 3D view and then also hard to navigate and see in the 2D slice views. Sometimes yes we might rotate slice intersections and place the points for the line node in a slice view but then it gets difficult to see both endpoints after resetting slice orientations. Anyways…mostly a 2D visual for my group. Really for our ultrasound data we only use 3D view for volume rendering and visualizing the shape of a segmentation.

It is OK. I don’t know about any obvious limitations. By default the point is placed on the visible surface. You can then choose to move the point in the view plane or move it on the surface.

A simple left click jumps all the slice views on the clicked position. Recent Preview Release allows you to click on a line and jump to the nearest point; or click on a point and jump to the previous or next point.

We could add an action (view context menu action and/or double-click or something like that) to fit the slice view(s) to the object.