2D Window & Polygon Drawing Structure
2D Windows
The 2D Windows in IRIS are modules
that implement 2D display and interaction with both the medical volumetric
data & the segmentation data. 3 instances of this 2D Window are created
as members of our GUI.
The items drawn in the 2D Window are:
- Medical image slice
- Segmentation slice (transparent overlay)
- Polygon contour, when outlining a region to segment
- Crosshairs
The 2D Window contains its own handler
for input events, and varies the effect of user input according to the
toolbar modes of the program. To some extent all the 2D windows are linked,
because certain actions in one window must be communicated to other windows.
To accomplish this, each 2D window keeps a pointer to the GUI that contains
it, and asks the GUI to post information to the other 2D Windows when necessary.
If the current toolbar mode is
"crosshairs mode", one may place or drag the 3D crosshairs to a new position
over the medical image/segmentation slice using mouse input. Since the
crosshairs position coincides with the slice viewed in each of the 2D Windows,
the GUI is told to inform the other windows to redraw.
If the current toolbar mode is
"navigation mode", the mouse controls the zooming and panning factors for
all the items drawn in only the active window
If the current toolbar mode is
"3D draw mode", the 2D Window does not allow any type of user interaction
If the current toolbar mode is
"polygon mode", one may use the mouse to draw or edit a polygon.
The polygon is used to outline
a region that the user wishes to segment and apply a particular label to.
Since we have restricted drawing to one window at a time, there is a "drawing
lock" contained in the global state which each window must get before responding
to any input events in polygon mode.
A Polygon Drawing object is a member
of each 2D Window that services the polygon segmentation function of the
2D Window. It maintains the polygon vertex data, and contains its own routines
to perform drawing and handle user input (simply forwarded to it by the
2D Window – other user-input data is available from Fltk’s static member
functions).
Additionally, when a user clicks
the "Accept Button" of the GUI to accept the polygon contour being edited
as a segmentation region to label, the Polygon Drawing object rasterizes
the polygon outline and returns the rasterization to the 2D Window. The
2D window uses this rasterization to inform the Voxel Data Set which voxels
of the segmentation data have been labeled.
Original by Eric
|