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:

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:

POSTCONDITIONS:

void ApplyInOut_button_Callback()
DESCRIPTION:
Callback for the Apply button in the Thresholding dialog.

PRECONDITIONS:
POSTCONDITIONS:
void ApplyInOutPreprocessing()
DESCRIPTION:
Performs the thresholding preprocessing

PRECONDITIONS:
POSTCONDITIONS:
void ApplyPlusInOut_button_Callback()
DESCRIPTION:
Callback for the Zero button in the Thresholding dialog.

PRECONDITIONS:
POSTCONDITIONS:

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:
POSTCONDITIONS:

void ApplyEdge_button_Callback()
DESCRIPTION:
Callback for the OK button in the Edge detection preprocessing dialog.

PRECONDITIONS:
POSTCONDITIONS:

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

PRECONDITIONS:

POSTCONDITIONS:

void RemoveBubble_button_Callback()
DESCRIPTION:
callback to remove a bubble; removes a highlighted bubble from Active Bubbles browser
 
PRECONDITIONS:
POSTCONDITIONS:

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:

POSTCONDITIONS:

void Radius_slider_Callback()
DESCRIPTION:
callback to set the radius of a bubble highlighted in the Active Bubbles browser
PRECONDITIONS:
Snake GUI is active

POSTCONDITIONS:

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:

POSTCONDITIONS:

void CancelSegmentButton_Callback_s()
DESCRIPTION:
callback for canceling a snake segmentation

PRECONDITIONS:
none

POSTCONDITIONS:

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:

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:

int getNumberOfBubbles()
DESCRIPTION:
returns the number of bubbles contained in the Active Bubbles browser
 
PRECONDITIONS:
Snake GUI is active

POSTCONDITIONS:

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:

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:
POSTCONDITIONS:

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:
POSTCONDITIONS:

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