GUI_impl Member Functions
GUI_impl()
DESCRIPTION:
Constructor. calls GUI constructor. calls init
PRECONDITIONS:
none
POSTCONDITIONS:
IRIS window is ready to be shown
void init()
DESCRIPTION:
Initializes everything so the IRIS window can be shown. This method is
essentially the same as IRIS2000, but we added a couple initializations of
snake window stuff.
PRECONDITIONS:
basically assumes it's going to be called in the constructor.
POSTCONDITIONS:
the IRIS window can now be shown
void show_iris()
DESCRIPTION:
Hides the IRIS windows and opens the Snake window
PRECONDITIONS:
IRIS window is opened
POSTCONDITIONS:
- IRIS window is hidden
- Snake window is visible
void show_snake()
DESCRIPTION:
hides the iris window and shows the snake window
PRECONDITIONS:
none
POSTCONDITIONS:
the IRIS window is hidden and the snake window is shown
void ResetROIButton_Callback()
DESCRIPTION:
Resets the region of interest to contain the entire volume (full_data)
PRECONDITIONS:
none
POSTCONDITIONS:
global state region of interest is set to entire full_data volume
void ShowROICheck_Callback()
DESCRIPTION:
Callback for the checkbox that shows or hides the region of interest in the
2D windows
PRECONDITIONS:
none
POSTCONDITIONS:
2D windows are redrawn, showing the region of interest if box is checked
void StartSnakeButton_Callback()
DESCRIPTION:
Callback for the snake button. This function takes care of initializing
the global variable roi_data, sets vox_data to point to roi_data, sets up
the snake window and calls show_snake().
PRECONDITIONS:
global_state must have a valid ROI
POSTCONDITIONS:
snake window is displayed, IRIS is hidden
void OkayInOut_button_Callback()
DESCRIPTION:
Callback for the OK button in the Thresholding dialog.
PRECONDITIONS:
- Snake UI is active
- Thresholding (InOut snake) dialog is active
POSTCONDITIONS:
- roi_data contains preprocessed data suitable
for the InOut snake algorithm to run on
- preprocessed data is displayed in 2D windows
of snake GUI
- Thresholding dialog is hidden
void ApplyInOut_button_Callback()
DESCRIPTION:
Callback for the Apply button in the Thresholding dialog.
PRECONDITIONS:
- Snake UI is active
- Thresholding (InOut snake) dialog is active
POSTCONDITIONS:
- roi_data contains preprocessed data suitable
for the InOut snake algorithm to run on
- preprocessed data is displayed in 2D windows
of snake GUI
void ApplyInOutPreprocessing()
DESCRIPTION:
Performs the thresholding preprocessing
PRECONDITIONS:
- Snake UI is active
- Thresholding (InOut snake) dialog is active
POSTCONDITIONS:
- roi_data contains preprocessed data suitable
for the InOut snake algorithm to run on
- preprocessed data is displayed in 2D windows
of snake GUI
void ApplyPlusInOut_button_Callback()
DESCRIPTION:
Callback for the Zero button in the Thresholding dialog.
PRECONDITIONS:
- Snake UI is active
- Thresholding (InOut snake) dialog is active
POSTCONDITIONS:
- roi_data contains preprocessed data suitable
for the InOut snake algorithm to run on
- preprocessed data is displayed in 2D windows
of snake GUI
- seg data is replaced by zero level visualization
void CloseInOut_button_Callback()
DESCRIPTION:
Callback for In/Out dialog Close button
PRECONDITIONS:
InOut dialog is visible
POSTCONDITIONS:
InOut dialog disappears
void OkayEdge_button_Callback()
DESCRIPTION:
Callback for the OK button in the Edge detection preprocessing dialog.
PRECONDITIONS:
- Snake UI is active
- Edge detection (Edge snake) dialog is active
POSTCONDITIONS:
- roi_data contains preprocessed data suitable
for the Edge snake algorithm to run on
- preprocessed data is displayed in 2D windows
of snake GUI
- Edge detection dialog is hidden
void ApplyEdge_button_Callback()
DESCRIPTION:
Callback for the OK button in the Edge detection preprocessing dialog.
PRECONDITIONS:
- Snake UI is active
- Edge detection (Edge snake) dialog is active
POSTCONDITIONS:
- roi_data contains preprocessed data suitable
for the Edge snake algorithm to run on
- preprocessed data is displayed in 2D windows
of snake GUI
void CloseEdge_button_Callback()
DESCRIPTION:
callback for Edge dialog Close button
PRECONDITIONS:
Edge dialog is visible
POSTCONDITIONS:
Edge dialog disappears
void Preprocess_button_Callback()
DESCRIPTION: Callback for showing the dialog box for preprocessing
the grey data. Depending on the type of snake chosen either the dialog
for thresholding or edge detection is displayed.
PRECONDITIONS:
main snake window is initialized and active
POSTCONDITIONS:
preprocessing dialog appears on screen
void AddBubble_button_Callback()
DESCRIPTION:
callback to set bubbles for snake initialization
- sets a bubble at the current crosshairs position
with the radius equal to the current value on the radius slider
- adds the bubble to the Active Bubbles browser
PRECONDITIONS:
- Snake GUI is active
- Crosshairs position is within allowed boundaries
POSTCONDITIONS:
- all previously set bubbles as well as the new
bubble are displayed in 2d windows
- Active Bubbles browser contains all previously
set bubbles as well as the new bubble and their parameters are displayed
in the browser
void RemoveBubble_button_Callback()
DESCRIPTION:
callback to remove a bubble; removes a highlighted bubble from Active Bubbles
browser
PRECONDITIONS:
- Snake GUI is active
- Active Bubbles browser contains at least one
bubble
POSTCONDITIONS:
- highlighted bubble has been removed from Active
Bubbles browser and is no longer displayed in 2d windows
- Active Bubbles browser contains all remaining
bubbles and their parameters are displayed in the browser
- all remaining bubbles are displayed in 2d windows
void ActiveBubbles_browser_Callback()
DESCRIPTION:
callback to browse through the bubbles in the Active Bubbles browser
highlights a line clicked in the browser window and sets the radius slider
to the value of the highlighted bubble's radius
PRECONDITIONS:
- Snake GUI is active
- Active Bubbles browser contains at least one
bubble
POSTCONDITIONS:
- the line clicked in the browser window is highlighted
- value of highlighted_bubble integer variable
is set to the number of the line highlighted in the browser window
- radius slider value is reset to the value of
the highlighted bubble's radius
void Radius_slider_Callback()
DESCRIPTION:
callback to set the radius of a bubble highlighted in the Active Bubbles
browser
- sets the radius of the highlighted bubble to
the current value of the radius slider
- only displays the current value of the radius
slider if no bubble is highlighted or if the Active Bubbles browser is empty
PRECONDITIONS:
Snake GUI is active
POSTCONDITIONS:
- current value of the radius slider is displayed
- radius of the highlighted bubble is set to
the current value of the radius slider
- visualisation of the highlighted bubble in
2d windows changes its radius correspondingly
- all remaining bubbles are left unchanged
void ApplySnakeParamsButton_Callback()
DESCRIPTION:
callback to set snake parameters
PRECONDITIONS:
POSTCONDITIONS:
if the snake exists, it's parameters have been set
void SnakeParamsButton_Callback()
DESCRIPTION
Opens the snake params dialog, allowing the user to modify snake params
void ParamsSchlegelButton_Callback()
DESCRIPTION
Sets the snake params dialog to Schlegel values
void ParamsSapiroButton_Callback()
DESCRIPTION
Sets the snake params dialog to Sapiro values
void ParamsTurelloButton_Callback()
DESCRIPTION
Sets the snake params dialog to Turello values
void ParamsUserDefButton_Callback()
DESCRIPTION
Allows user to modify snake params
void ParamsClampToggle_Callback()
DESCRIPTION
Activates the ground slider based on the clamp toggle in the snake params
void AcceptSegmentButton_Callback_s()
DESCRIPTION:
callback for accepting a snake segmentation
PRECONDITIONS:
- roi_data is valid
- roi_data.snakeImageData is initialized
POSTCONDITIONS:
- roi_data.snakeImageData has been merged with
full_data.segImageData
- roi_data is deleted
- IRIS window is shown
void CancelSegmentButton_Callback_s()
DESCRIPTION:
callback for canceling a snake segmentation
PRECONDITIONS:
none
POSTCONDITIONS:
- snake window is hidden, IRIS is shown
- roi_data is deleted
void ResetScrollbars_s()
DESCRIPTION:
Sync the scrollbars with the current cursor position. Snake window version
of ResetScrollbars
void UpdatePositionDisplay_s(int id)
DESCRIPTION:
snake window version of UpdatePositionDisplay
set the textbox display of slice number for 2d window id
void RedrawWindows_s()
DESCRIPTION:
redraw all snake windows
void UpdateImageProbe_s()
DESCRIPTION:
snake window version of UpdateImageProbe
update the intensity and label outputs to reflect values at the current
cursor position
void ContinuousUpdateCheckbox_Callback()
DESCRIPTION:
disables or enables the UpdateMesh button in snake win depending on the
state of the checkbox
void PositionSliderCallback_s(int id)
DESCRIPTION:
callback for moving the 2d window sliders
snake window version of PositionSliderCallback
void InOutSnakeButton_Callback()
DESCRIPTION:
Switches to InOut snake mode
PRECONDITIONS:
Snake UI is active
POSTCONDITIONS:
all current preprocessed data is invalidated
void EdgeSnakeButton_Callback()
DESCRIPTION:
Switches to Edge snake mode
PRECONDITIONS:
Snake UI is active
POSTCONDITIONS:
all current preprocessed data is invalidated
void AcceptInitializationButton_Callback()
DESCRIPTION:
callback for accepting the snake initialization. The active bubbles
are voxelized. roi_data.segImageData and snakeInitImageData are initialized
and synchronized. The bubble voxels are put into snakeInitImageData.
If the grey data has been preprocessed, and some type of initialization is
present in snakeInitImageData (either a bubble or pre-existing segmentation
data from segImageData), the snake can now be run.
PRECONDITIONS:
snake window is up and running
POSTCONDITIONS:
global_state.GetSnakeActive is true
void RestartInitializationButton_Callback()
DESCRIPTION:
callback for restarting the snake initialization. Any current snake
state is forgotten, the snake controls are disabled, the segmentation shown
in the 2D windows reverts back to the segImageData, and the bubbles
are shown again. The initialization widgets (bubbles, preproc) are
enabled
PRECONDITIONS:
none
POSTCONDITIONS:
global_state.GetSnakeActive is false
void RewindButton_Callback()
DESCRIPTION:
callback for the snake "vcr" rewind button. Restarts the snake at
the same state as when AcceptInitialization button was pressed
void StopButton_Callback()
DESCRIPTION:
simply sets a flag so that the play button knows to stop
void PlayButton_Callback()
DESCRIPTION:
continuously steps the snake until snake_running flag is unset
void StepButton_Callback()
DESCRIPTION:
runs the snake for one step.
PRECONDITIONS:
none
POSTCONDITIONS:
- 2D displays are updated according to the current
snake state
- if updatecontinuously checkbox is checked,
3D display is updated
void StepSizeChoice_Callback()
DESCRIPTION:
callback for choice box of how many snake iterations to run per "step"
PRECONDITIONS:
none
POSTCONDITIONS:
snake_stepsize is set
Bubble* getBubbles()
DESCRIPTION:
returns a pointer to an array of Bubble objects contained in the Active
Bubbles browser
PRECONDITIONS:
Snake GUI is active
POSTCONDITIONS:
- a pointer to an array of Bubble objects contained
in the Active Bubbles browser is returned
- returns NULL if Active Bubbles browser is empty
int getNumberOfBubbles()
DESCRIPTION:
returns the number of bubbles contained in the Active Bubbles browser
PRECONDITIONS:
Snake GUI is active
POSTCONDITIONS:
- the number of bubbles in the Active Bubbles
browser is returned
- returns zero if the browser is empty
void LoadPreprocSelectCallback()
DESCRIPTION:
Pops up a dialog to choose a preprocessed data file
PRECONDITIONS:
LoadPreproc_win is active
POSTCONDITION:
header information is filled in in the dialog
void SelectPreprocFileCallback()
DESCRIPTION:
Fills the header information in the Load Preprocessed data dialog
PRECONDITIONS:
the filename field contains a valid filename
POSTCONDITIONS:
header information is filled in
void LoadPreprocessedDataCallback()
DESCRIPTION:
Implements action performed when user presses OK in the Load Preprocessed
data dialog
PRECONDITIONS:
none
POSTCONDITIONS:
preprocessed data in roi_data is valid
void SavePreprocessedData_Callback()
DESCRIPTION: Callback for saving preprocessed data menu entry.
PRECONDITIONS:
POSTCONDITIONS:
- Save Preprocessed Data dialog is visible
void OkaySavePreproc_button_Callback()
DESCRIPTION: Implements callback for Okay button
in the Save Preprocessed dialog box
PRECONDITIONS:
none
POSTCONDITIONS:
If a valid filename was supplied then the
preprocessed data set is saved to the specified file
void OriginalRadio_Callback()
DESCRIPTION:
callback of the radio button for selecting the grey data for display
void PreprocessedRadio_Callback()
DESCRIPTION:
callback of the radio button for selecting the preprocessed data for display
void shutdown()
DESCRIPTION:
close both windows so FL::run returns, and program exits
PRECONDITIONS:
none
POSTCONDITIONS:
program will exit
void DoInOutPreprocessing()
DESCRIPTION:
Takes thresholding parameters out of thresholding (InOut) dialog, runs
preprocessing algorithm and puts the resulting preprocessed data into roi_data.
PRECONDITIONS:
- Snake GUI is active
- Thresholding dialog elements hold proper
parameters
POSTCONDITIONS:
- roi_data contains preprocessed data suitable
for running the InOut snake algorithm
- radio buttons for selecting type of data
(original/preprocessed) to view in 2D windows are activated
void DoEdgePreprocessing()
DESCRIPTION:
Takes edge detection parameters out of edge detection dialog, runs preprocessing
algorithm and puts the resulting preprocessed data into roi_data.
PRECONDITIONS:
- Snake GUI is active
- Edge detection dialog elements hold proper
parameters
POSTCONDITIONS:
- roi_data contains preprocessed data suitable
for running the Edge snake algorithm
- radio buttons for selecting type of data
(original/preprocessed) to view in 2D windows are activated
void UpdateIterationOutput()
DESCRIPTION:
updates snake iteration output field
void SyncIRISToSnake()
DESCRIPTION:
some GUI state is shared between the windows, like contrast/brightness
settings, toolbar mode.
these functions sync the two
void SyncSnakeToIRIS()
DESCRIPTION:
some GUI state is shared between the windows, like contrast/brightness
settings, toolbar mode.
these functions sync the two
void TweakROI(Coord3i &pt1, Coord3i &pt2)
DESCRIPTION:
this function fiddles with the ROI points so that pt1 has the smaller
coordinates (upper left), and pt2 has the larger coordinates (lower right).
Some methods depend on this being true for simplicity.
int RunSnake(int numsteps)
DESCRIPTION
Runs the snake, and updates the GUI
PARAMETERS
numsteps = input, number of iterations to run the snake
PRECONDITIONS
snake must be ready to run
POSTCONDITIONS
snake is run the specified number of steps
RETURNS
1 if running is successful, 0 if an error occurred