function ui_main(varargin)
% Initialize and hide the GUI as it is being constructed.
frameWidth=450;
frameHeight=450;
frame = figure('Visible','off','Position',[0,0,frameWidth,frameHeight]);
movegui(frame,'center'); % get this thing visible on smaller displays.
set(frame,'Name','NODalyze');
set(frame,'NumberTitle','off');
set(frame,'MenuBar','none');
set(frame,'Resize','on');
set(frame,'Units','normalized');
set(frame,'Color','y');
task = struct;
model = struct;
model.txtBaseDir = createLabel(frame,[0 0.97 0.8 0.03],'');
set(model.txtBaseDir,'BackgroundColor','w');
set(model.txtBaseDir,'ForegroundColor','b');
model.txtStudyID = createLabel(frame,[0.8 0.97 0.2 0.03],'');
set(model.txtStudyID,'BackgroundColor','w');
set(model.txtStudyID,'ForegroundColor','r');
TASK_HEIGHT = 1-0.13;
% PREPROCESSING
task.preprocessing = uipanel(frame,'Title','Preprocessing','Position',[0 0.0 1 TASK_HEIGHT]);
set(task.preprocessing,'BackgroundColor','w');
set(task.preprocessing,'Units','normalized');
model = createFirstStepPanel(model,task.preprocessing);
% CLASSIFICATION
task.classification = uipanel(frame,'Title','Classification','Position',[0 0.0 1 TASK_HEIGHT]);
set(task.classification,'BackgroundColor','w');
model = createSecondStepPanel(model,task.classification);
% PLOT
task.plot = uipanel(frame,'Title','Plot','Position',[0 0.0 1 TASK_HEIGHT]);
set(task.plot,'BackgroundColor','w');
model = createVisualStepPanel(model,task.plot);
% TASK SWITCH BUTTONS
task.taskSwitch = uibuttongroup(frame,'Position',[0 1-0.13 1 0.10]);
% controlls togglebuttons
set(task.taskSwitch,'BackgroundColor','w');
set(task.taskSwitch,'Units','normalized');