The 3D Window component of IRIS is essentially a module which implements all the functionality for display and interaction with 3D image segmentations. When the IRIS tool starts, a single instance of the Window3D class is created and initialized.
The major componets of the 3D Window are :
When the 3D Window detects a button click event, the Window3D class communicates with the Global State to determine the current toolbar mode. Currently, there are five possible toolbar modes: crosshairs mode, navigation mode, polygon mode, point-line mode, and cut-planes mode.
If the current toolbar mode is "crosshairs mode", the 3D Window allows only Crosshairs Position Placement user interaction.
If the current toolbar mode is "navigation mode", the 3D Window allows only Navigation user interaction.
If the current toolbar mode is "paint 3D mode", the 3D Window allows only 3D Image Segmentation user interaction - spray and cut planes.
If the current toolbar mode is
"polygon mode", the 3D Window allows only polygon creation/editing user
interaction.
Crosshairs Position Placement
In this mode of interaction, when
the left mouse button is clicked, the 3D Window attempts to place the 3D
crosshairs at the location on the Mesh Object where the user clicked.
When a left mouse click event is received, the 3D Window determines the
world space viewing ray which corresponds to the screen space position
of where the click was received. The 3D Window then passes this viewing
ray to the Voxel Data Structure. The Voxel Data Structure determines
the first voxel (if any) intersected by the viewing ray which is labeled.
The (x,y,z) position of this sample is returned to the 3D Window.
Finally, the 3D Window notifies the Global State of the new crosshairs
position and tells the GUI to update all the windows with the new crosshairs
position information.
Navigation
In this mode of interaction, the 3D Window performs different actions depending on which button click event is detected.
While in "Pan submode", when a mouse motion event is received the displayed 3D segmentation pans. Motion in the horizontal direction pans the segmentation horizontally; motion in the vertical direction pans the segmentation vertically.
While in "Zoom submode", when a
mouse motion event is received the displayed 3D segmentation zooms. Upward
motion enlarges the segmentation; downward motion shrinks the segmentation.
Display
When the GUI determines that the
3D Window needs to be re-displayed, it sends a request to the 3D Window.
Upon a request from the GUI, the 3D Window renders the Mesh Object, then
draws the crosshairs and any voxels which were labelled during 3D Image
Segmentation mode.
3D Paint/Edit Mode (Spray & Cut Planes)
In this mode of interaction, the user is allowed to modify the segmentation labeling in the Voxel Data Structure. When the left mouse button is held down and a drag event is received, the 3D Window determines the world space viewing ray which corresponds to the screen space position of where the event was received. The 3D Window then passes this viewing ray to the Voxel Data Structure. The Voxel Data Structure determines the first voxel (if any) intersected by the viewing ray which is labeled. The (x,y,z) position of this sample is returned to the 3D Window where it is retained in a list of samples. When a user clicks the "Accept Button" of the GUI, the voxels which have been labelled are passed to the Voxel Data Structure.
New additions
The display of the samples was disabled because of updated GLUT library conflicts with NT, so the samples display was modified to keep the cross-platform capabilities of the spray painting. Also, the "Reset View" button can be clicked to erase the samples if the changes are not accepted by the user.
When a right click is detected
in this mode, the appropriate cut planes point is set (or ignored if 2
points have already been defined). Once these 2 points have been
set and the plane is considered valid, the plane is drawn in the 3D window.
The user may change modes, however no changes are made to the segmentation
data until the user clicks on the "Accept View" or the "Reset View" button.