Summary
To facilitate 2D (radiological) measurements in MITK in a unified way, a new class framework for representing 2D geometric figures (planar figures in the following) should be created consisting of new data, rendering (mapper) and interactor classes.
Requirements
The following planar figures should be supported:
- Ellipsoids (circles as special case)
- Rectangles (squares as special case)
- Lines
- 3-point angles
- 4-point angles
- Polygons consisting of n points (open and closed, optionally with spline interpolation)
Each planar figure will be defined by:
- Two or more control points (e.g. center and two points on curve for an ellipsoid)
- A Geometry2D object defining its position in space, scale factor, and rotation
Interactions should allow for:
- Creating and positioning a planar figure
- Changing the figure's shape, position, and size by moving its interaction points
- Rotating the figure (i.e. its geometry)
- OPT: scaling the figure by means of scaling the geometry transform
Other points to keep in mind:
- 4-Point angles consist of two lines which could be modeled by two seperate line objects
- It should be possible to group planar figures into a hierachy
Proposed solution
Fundamentals:
Measurements only make sense when something to be measured already exists (i.e., in most cases, an image). To define a fixed geometric frame for planar figures, they need to be associated with a meaningful 2D geometry object. Each mitk::PlanarFigure (see below) object will therefore explicitly receive its Geometry2D (which describes the position, orientation, and valid maximum extents of the figure in space) from another object (e.g., an image slice). Note that in principle, non-linear/curved geometries could be used as well; in the first version of implementation, however, geometries will be restricted to mitk::PlaneGeometry.
The (2D) mapper for PlanarFigure objects checks if the plane of the figure is (1) parallel to the current render plane, and (2) its bounds contain the current render plane in z-direction. Note: This means that, if the closest possible render plane (depending on the current alignment of the containing SlicedGeometry) is NOT withing the bounds of the planar figure plane, nothing is displayed. It is the responsibility of the application using PlanarFigures to ensure that a suitable PlaneGeometry is used for the PlanarFigure
Data classes to be implemented:
mitk::PlanarFigure (base interface class derived from mitk::BaseData)
SetGeometry2D() --> sets the 2D geometry defining the plane position/orientation/extents for this figure to be placed in
GetControlPoints() --> returns the 2D control points of the figure
GetPolyline() --> returns the polyline representation (mainly for rendering purposes)
- Multiple polines should be supported, e.g. to render graphical extras, such as a circular arc for representing an angle
IsOpen() --> returns true in case of non-closed figures
GetPolylineLength() --> returns length / circumference of the figure
GetArea() --> returns encapsulated area for closed figures, otherwise 0.0
mitk::PlanarLine (derived from PlanarFigure)
mitk::PlanarEllipsoid
- etc.
OPT: mitk::PlanarFigureComposite --> no graphical representation, container for one or more child mitk::PlanarFiture objects for simple grouping
Rendering classes to be implemented:
- mitk::PlanarFigureMapper2D
- Renders control points of the shape (for interaction)
- Renders polyline (open/closed) of the planar figure, according to property-controlled visual properties such as color and opacity
- OPT: Renders inside of closed planar figures
- OPT: Renders further information relevant to interaction (bounding box around planar figure or grouped planar figure, icons indicating rotation/scaling mode)
- OPT: Renders composite planar figures
- TBD: Figures will only be rendered if Geometry2D of renderer and Geometry2D of planar figure describe the same plane in space
- mitk::PlanarFigureMapper3D (analogous to 2D, optional)
Interaction classes to be implemented:
mitk::PlanarFigureInteractor
- Allow for interaction with control points (unified handling)
- Allow for selection and translation of planar figures by means of picking (will possibly be implemented in a separate picking framework for any 2D/3D objects)
- TBD...
- Create corresponding state machine
Other possible features:
- Seperate calculator class(es) for computing the histogram, sample profile, mean/SD, etc. of the part of an mitk::Image described by the planar figure
- Allow planar figures on curved (2D) geometries...
- Measurement tool: orthogonal measurements (measure one distance, and then a second one orthogonal to the first one)
- Freehand curves
Core Change Request
Because a new interactor has to be implemented, StateMachine.xml needs to be changed
