Skip to content

Modernize the Draw & Measure tools: new tools, tool profiles, plugin registry and clearer display #920

Description

@nroduit

The measurement tools had not changed since Weasis 2.5: a fixed palette, no way for a plugin to add a tool without editing the core, a presentation XML without version, one yellow line on every kind of image and the same number of decimals for a ratio, an area and a Hounsfield value. This change reworks them while keeping every archived measurement readable.

New and improved tools

  • Bidirectional (RECIST-style): long axis with its perpendicular short axis, both lengths and their ratio (Bidirectional ruler/measurement tool for oncology response assessments #749).
  • Cardiothoracic ratio: two strokes (heart borders, inner rib margins), widths measured across a midline that can be tilted for a rotated patient; reports CTR with two decimals, the widths and the midline-to-border distances, and warns on an AP view (The cardiothoracic ratio (CTR) Function #257).
  • Circle: drawn in one gesture from its centre; a simple click drops a circle of a preset radius for a quick reading of pixel values (Click-and-drag to draw ellipse (and rectangle) to measure #782). New option to draw upright rectangles and ellipses by a plain drag (Shift for the oblique shape).
  • Freehand trace, closed into a region when released on its start; hold Shift for a magnetic trace that follows the edges seen at the current window/level. Polyline closes the same way; both convert between open and closed from the context menu.
  • Arrow, ruler and freehand pencil drawings. Shift keeps lines horizontal or vertical. The line also reports its horizontal and vertical extent; pixel statistics gain Sum.
  • Intensity profile of any selected line or polyline in the panel; pointing at the curve reads the value and the distance, and marks the pixel on the image.
  • Calibration is an action of the line: context menu, Ctrl/Cmd held while drawing, or the Calibrate… button under the table. Restore original brings back the calibration of the DICOM file or of the Presentation State.
  • In the MPR, a measurement stays attached to its position in the patient: it reappears on its plane and leaves marks where it crosses the other planes.

Tool profiles

  • A profile chooses the tools of the two palettes and their order, the defaults of new graphics, the pixel statistics and the labels shown on the image. Automatic picks the profile from the modality: cross-sectional (CT, MR, PT, NM), radiography (CR, DX, RF, XA), ultrasound, or the default with every tool.
  • Profiles are laid over the user's settings: what a profile does not state shows the user's choice again, and a profile never replaces the saved preferences.
  • User profiles are edited in Preferences > Draw & Measure > Tool profiles, imported and exported as JSON; a site can ship its own with weasis.measure.profiles.config.

Display

  • Lines are drawn over a dark outline and the default colour is cyan instead of yellow, so they stay visible on bone, air, bright radiographs and colour maps (a colour already chosen is kept; saved graphics keep theirs). The outline is written as the standard OUTLINED shadow style in a GSPS.
  • Decimals are automatic: a length is shown one digit finer than the pixel size, Hounsfield values without decimals, ratios with two, other values by significant digits; a fixed number can still be forced. Copying a value or the table always gives full precision (The cardiothoracic ratio (CTR) Function #257: a CTR of 0.48 was labelled 0.5).
  • Every tool has its own keyboard shortcut in the shortcut preferences, plugin tools included; new defaults E (ellipse), O (circle), X (bidirectional) (Add keyboard shortcuts for measurements #856). Y selects the polyline.
  • The Draw & Measure panel adapts to its width (palette columns, options and table), shows where the pixel size comes from and the slice thickness under the values, and hosts tool-specific panels. Icons redrawn in one visual language.

For plugin developers

  • Concepts are described in weasis-core/docs/Measurement-Tools.md.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions