Skip to content

Added Edge Annotation functionality to vtkCornerAnnotation

Ethan Brodsky requested to merge ethanb/vtk:EdgeAnnotations into master

The vtkCornerAnnotation class provides extremely useful functionality for adding 2D text overlay annotations to the corners a rendering, but does not support adding the such overlays centered along the edges of the rendering, which is very commonly used for medical imaging annotation (A/P S/I R/L). This enhancement adds support for edge annotations (at the TopEdge, BottomEdge, LeftEdge, and RightEdge annotation positions) to the previously existing corner positions, allowing any combination of edge and corner annotations, with no changes to existing code that uses the corner annotation functionality. I also cleaned up some confusing layout calculation code that is common to all types of annotation (though it still could use more refactoring).

The example has been updated to test both types of overlays, requiring a change to the baseline output.

It is worth considering renaming the entire class to vtkEdgeAnnotation, as that would more generally characterize its functionality (as corners are parts of edges, but edges are not parts of corners), but this would require modification to all third-party code using this class and may not be desirable.

Merge request reports