0001 function param = job_view_cortex_param( varargin )
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 if nargin > 0
0016 param = varargin{1};
0017 parent = gcf;
0018 job_view_cortex_param_create_figure(parent);
0019 job_view_cortex_param_set_value_to_gui( param );
0020
0021
0022
0023 waitfor( gcf, 'UserData' );
0024
0025 if strcmp( get( gcf, 'UserData' ), 'ok' )
0026 param = job_view_cortex_param_get_value_from_gui;
0027 else
0028 param = [];
0029 end
0030 delete( gcf );
0031 return;
0032 end
0033
0034
0035
0036
0037
0038
0039 switch get( gcbo, 'Type' )
0040
0041 case 'uicontrol'
0042
0043 switch get( gcbo, 'Style' )
0044
0045
0046 case 'radiobutton'
0047
0048 set( findobj( gcf, 'Tag', get( gcbo, 'Tag' ) ), 'Value', 0 );
0049 set( gcbo, 'Value', 1 );
0050
0051 switch get( gcbo, 'Tag' )
0052
0053 case 'model_type'
0054 switch get( gcbo, 'UserData' )
0055 case 'original'
0056 set( findobj( gcf, 'Tag', 'sulcus_visibility' ), 'Enable', 'off' );
0057 set( findobj( gcf, 'Tag', 'sulcus_color' ), 'Visible', 'off' );
0058 case 'inflate'
0059 set( findobj( gcf, 'Tag', 'sulcus_visibility' ), 'Enable', 'on' );
0060 if get( findobj( gcf, 'Tag', 'sulcus_visibility',...
0061 'UserData', 'visible' ), 'Value' )
0062 set( findobj( gcf, 'Tag', 'sulcus_color' ), 'Visible', 'on' );
0063 else
0064 set( findobj( gcf, 'Tag', 'sulcus_color' ), 'Visible', 'off' );
0065 end
0066 end
0067
0068 case 'sulcus_visibility'
0069 switch get( gcbo, 'UserData' )
0070 case 'visible'
0071 set( findobj( gcf, 'Tag', 'sulcus_color' ), 'Visible', 'on' );
0072 case'invisible'
0073 set( findobj( gcf, 'Tag', 'sulcus_color' ), 'Visible', 'off' );
0074 end
0075
0076 case 'paint'
0077 switch get( gcbo, 'UserData' )
0078 case 'dot'
0079 set( findobj( gcf, 'Tag', 'markersize' ), 'Enable', 'on' );
0080 case 'patch'
0081 set( findobj( gcf, 'Tag', 'markersize' ), 'Enable', 'off' );
0082 end
0083
0084 case 'act_show_highlight'
0085 switch get( gcbo, 'UserData' )
0086 case 'on'
0087 set( findobj( gcf, 'Tag', 'act_non_highlight_alpha slider' ),...
0088 'Enable', 'on' );
0089 set( findobj( gcf, 'Tag', 'act_non_highlight_alpha' ),...
0090 'Enable', 'on' );
0091 case 'off'
0092 set( findobj( gcf, 'Tag', 'act_non_highlight_alpha slider' ),...
0093 'Enable', 'off' );
0094 set( findobj( gcf, 'Tag', 'act_non_highlight_alpha' ),...
0095 'Enable', 'off' );
0096 end
0097
0098 end
0099
0100
0101 case 'slider'
0102
0103 switch get( gcbo, 'Tag' )
0104 case { 'area_alpha slider', 'act_non_highlight_alpha slider' }
0105 val = get( gcbo, 'Value' );
0106 val = round(val*100)/100.0;
0107 targetedit = findobj( gcf, 'Tag', strtok(get(gcbo,'Tag')) );
0108 if val >= 1
0109 set( targetedit, 'String', 0.99, 'UserData', 0.99 );
0110 set( gcbo, 'Value', 0.99 );
0111 elseif val == 0
0112 set( targetedit, 'String', 0.01, 'UserData', 0.01 );
0113 set( gcbo, 'Value', 0.01 );
0114 else
0115 set( targetedit, 'String', val, 'UserData', val );
0116 set( gcbo, 'Value', val );
0117 end
0118 end
0119
0120
0121 case 'edit'
0122
0123 num = str2num( get( gcbo, 'String' ) );
0124 if isempty( num ) | num <= 0
0125 set( gcbo, 'String', get( gcbo, 'UserData' ) );
0126 return;
0127 end
0128 switch get( gcbo, 'Tag' )
0129 case { 'act_min', 'act_colormap_max', 'selection_radius',...
0130 'dilation_erosion_radius' }
0131 set( gcbo, 'UserData', num );
0132 case 'selection_undo_length'
0133 if num < 1
0134 set( gcbo, 'UserData', 1, 'String', 1 );
0135 else
0136 set( gcbo, 'UserData', round(num), 'String', round(num) );
0137 end
0138 case { 'area_alpha', 'act_non_highlight_alpha' }
0139 if num < 0.01
0140 set( gcbo, 'UserData', 0.01, 'UserData', 0.01 );
0141 set( findobj( 'Tag', [get(gcbo,'Tag') ' slider'] ), 'Value', 0.01 );
0142 elseif num > 0.99
0143 set( gcbo, 'UserData', 0.99, 'String', 0.99 );
0144 set( findobj( 'Tag', [get(gcbo,'Tag') ' slider'] ), 'Value', 0.99 );
0145 else
0146 set( gcbo, 'UserData', round(num*100)/100.0,...
0147 'String', round(num*100)/100.0 );
0148 set( findobj( 'Tag', [get(gcbo,'Tag') ' slider'] ),...
0149 'Value', round(num*100)/100.0 );
0150 end
0151
0152 end
0153
0154
0155
0156 case 'pushbutton'
0157 set( gcf, 'UserData', get( gcbo, 'Tag' ) );
0158
0159 end
0160
0161
0162 case 'patch'
0163 color = get( gcbo, 'FaceColor' );
0164 title = [ get( gcbo, 'Tag' ) ' setting' ];
0165 color = uisetcolor( color, title );
0166 set( gcbo, 'FaceColor', color );
0167
0168
0169 end
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179 function H = job_view_cortex_param_create_figure(parent)
0180
0181 graycolor = [0.8 0.8 0.8];
0182 whitecolor = [1 1 1];
0183
0184 figure( 'MenuBar', 'none', 'WindowStyle', 'modal', 'Units', 'pixels',...
0185 'NumberTitle', 'off', 'Name', 'Parameter Setting',...
0186 'CloseRequestFcn', 'set( gcf, ''UserData'', ''close'' );',...
0187 'Resize', 'off',...
0188 'DefaultUicontrolBackgroundColor', graycolor,...
0189 'DefaultUicontrolFontUnits', 'pixels',...
0190 'DefaultUicontrolFontSize', 12,...
0191 'DefaultUicontrolValue', 0,...
0192 'DefaultUicontrolHorizontalAlign', 'left',...
0193 'DefaultAxesUnits', 'pixels',...
0194 'DefaultAxesVisible', 'off',...
0195 'DefaultAxesXTick', [], 'DefaultAxesYTick', [] );
0196 figpos = get( gcf, 'Position' );
0197 fig_h = 645;
0198 fig_w = 350;
0199 screensize = get( 0, 'ScreenSize' );
0200 if figpos(2) + fig_h > screensize(4)
0201 figpos(2) = screensize(4) - fig_h - 40;
0202 end
0203 set( gcf, 'Position', [ figpos(1), figpos(2), fig_w, fig_h ] );
0204
0205 label_l = 10;
0206 label_w = 145;
0207 line_h = 25;
0208 value_l = label_l+label_w+10;
0209
0210
0211 i = 1;
0212 uicontrol( 'Tag', 'LRflg label', 'HitTest', 'off',...
0213 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0214 'Style', 'text', 'String', 'Hemisphere to plot' );
0215 uicontrol( 'Tag', 'LRflg', 'UserData', 'LR',...
0216 'Position', [ value_l, fig_h-10-line_h*i, 45, 20 ],...
0217 'Style', 'radiobutton', 'String', 'LR',...
0218 'Callback', 'job_view_cortex_param;' );
0219 uicontrol( 'Tag', 'LRflg', 'UserData', 'L',...
0220 'Position', [ value_l+50, fig_h-10-line_h*i, 35, 20 ],...
0221 'Style', 'radiobutton', 'String', 'L',...
0222 'Callback', 'job_view_cortex_param;' );
0223 uicontrol( 'Tag', 'LRflg', 'UserData', 'R',...
0224 'Position', [ value_l+90, fig_h-10-line_h*i, 35, 20 ],...
0225 'Style', 'radiobutton', 'String', 'R',...
0226 'Callback', 'job_view_cortex_param;' );
0227
0228
0229 i = i + 1;
0230 uicontrol( 'Tag', 'model_type label', 'HitTest', 'off',...
0231 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0232 'Style', 'text', 'String', 'Brain model type' );
0233 uicontrol( 'Tag', 'model_type', 'UserData', 'original',...
0234 'Position', [ value_l, fig_h-10-line_h*i, 70, 20 ],...
0235 'Style', 'radiobutton', 'String', 'original',...
0236 'Callback', 'job_view_cortex_param;' );
0237 H = get(parent, 'UserData');
0238 braindata = get(H.braindata, 'UserData');
0239 if ~isempty(braindata.Vinflate)
0240 uicontrol( 'Tag', 'model_type', 'UserData', 'inflate',...
0241 'Position', [ value_l+75, fig_h-10-line_h*i, 60, 20 ],...
0242 'Style', 'radiobutton', 'String', 'inflate',...
0243 'Callback', 'job_view_cortex_param;' );
0244 end
0245
0246
0247 i = i + 1;
0248 uicontrol( 'Tag', 'sulcus_visibility label', 'HitTest', 'off',...
0249 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0250 'Style', 'text', 'String', 'Sulcus visibility' );
0251 uicontrol( 'Tag', 'sulcus_visibility', 'UserData', 'visible',...
0252 'Position', [ value_l, fig_h-10-line_h*i, 65, 20 ],...
0253 'Style', 'radiobutton', 'String', 'visible',...
0254 'Callback', 'job_view_cortex_param;' );
0255 uicontrol( 'Tag', 'sulcus_visibility', 'UserData', 'invisible',...
0256 'Position', [ value_l+70, fig_h-10-line_h*i, 75, 20 ],...
0257 'Style', 'radiobutton', 'String', 'invisible',...
0258 'Callback', 'job_view_cortex_param;' );
0259
0260
0261 i = i + 1;
0262 uicontrol( 'Tag', 'brain_color label', 'HitTest', 'off',...
0263 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0264 'Style', 'text', 'String', 'Color of brain / sulcus' );
0265 axes( 'Tag', 'brain_color', 'HitTest', 'off',...
0266 'Position', [ value_l, fig_h-10-line_h*i, 20, 20 ] );
0267 patch( 'Tag', 'brain_color',...
0268 'ButtonDownFcn', 'job_view_cortex_param;',...
0269 'XData',[0,1,1,0], 'YData',[0,0,1,1],...
0270 'Faces', [1,2,3,4], 'FaceColor',[1 1 1] );
0271 uicontrol( 'Tag', 'brain_sulcus_border label', 'HitTest', 'off',...
0272 'Position', [ value_l+25, fig_h-10-line_h*i, 10, 20 ],...
0273 'Style', 'text', 'String', '/' );
0274 axes( 'Tag', 'sulcus_color', 'HitTest', 'off',...
0275 'Position', [ value_l+45, fig_h-10-line_h*i, 20, 20 ] );
0276 patch( 'Tag', 'sulcus_color',...
0277 'ButtonDownFcn', 'job_view_cortex_param;',...
0278 'XData',[0,1,1,0], 'YData',[0,0,1,1],...
0279 'Faces', [1,2,3,4], 'FaceColor',[1 1 1] );
0280
0281
0282 i = i + 1;
0283 uicontrol( 'Tag', 'lighting label', 'HitTest', 'off',...
0284 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0285 'Style', 'text', 'String', 'Lighting' );
0286 uicontrol( 'Tag', 'lighting', 'UserData', 'on',...
0287 'Position', [ value_l, fig_h-10-line_h*i, 45, 20 ],...
0288 'Style', 'radiobutton', 'String', 'on',...
0289 'Callback', 'job_view_cortex_param;' );
0290 uicontrol( 'Tag', 'lighting', 'UserData', 'off',...
0291 'Position', [ value_l+50, fig_h-10-line_h*i, 45, 20 ],...
0292 'Style', 'radiobutton', 'String', 'off',...
0293 'Callback', 'job_view_cortex_param;' );
0294
0295
0296 i = i + 1;
0297 uicontrol( 'Tag', 'act_area_priority label', 'HitTest', 'off',...
0298 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0299 'Style', 'text', 'String', 'Act / Area priority' );
0300 uicontrol( 'Tag', 'act_area_priority', 'UserData', 'activation',...
0301 'Position', [ value_l, fig_h-10-line_h*i, 85, 20 ],...
0302 'Style', 'radiobutton', 'String', 'activation',...
0303 'Callback', 'job_view_cortex_param;' );
0304 uicontrol( 'Tag', 'act_area_priority', 'UserData', 'area',...
0305 'Position', [ value_l+90, fig_h-10-line_h*i, 55, 20 ],...
0306 'Style', 'radiobutton', 'String', 'area',...
0307 'Callback', 'job_view_cortex_param;' );
0308
0309
0310 i = i + 1;
0311 uicontrol( 'Tag', 'act_normalize label', 'HitTest', 'off',...
0312 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0313 'Style', 'text', 'String', 'Activation normalize' );
0314 uicontrol( 'Tag', 'act_normalize', 'UserData', 'no',...
0315 'Position', [ value_l, fig_h-10-line_h*i, 45, 20 ],...
0316 'Style', 'radiobutton', 'String', 'no',...
0317 'Callback', 'job_view_cortex_param;' );
0318 uicontrol( 'Tag', 'act_normalize', 'UserData', 'meshsize',...
0319 'Position', [ value_l+50, fig_h-10-line_h*i, 85, 20 ],...
0320 'Style', 'radiobutton', 'String', 'mesh size',...
0321 'Callback', 'job_view_cortex_param;' );
0322
0323
0324 i = i + 1;
0325 uicontrol( 'Tag', 'act_relative_mode label', 'HitTest', 'off',...
0326 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0327 'Style', 'text', 'String', 'Activation relative mode' );
0328 uicontrol( 'Tag', 'act_relative_mode', 'UserData', 'each',...
0329 'Position', [ value_l, fig_h-10-line_h*i, 55, 20 ],...
0330 'Style', 'radiobutton', 'String', 'each',...
0331 'Callback', 'job_view_cortex_param;' );
0332 uicontrol( 'Tag', 'act_relative_mode', 'UserData', 'all',...
0333 'Position', [ value_l+60, fig_h-10-line_h*i, 45, 20 ],...
0334 'Style', 'radiobutton', 'String', 'all',...
0335 'Callback', 'job_view_cortex_param;' );
0336
0337
0338 i = i + 1;
0339 uicontrol( 'Tag', 'act_sign_mode label', 'HitTest', 'off',...
0340 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0341 'Style', 'text', 'String', 'Act. sign mode' );
0342 uicontrol( 'Tag', 'act_sign_mode', 'UserData', 'signed',...
0343 'Position', [ value_l, fig_h-10-line_h*i, 75, 20 ],...
0344 'Style', 'radiobutton', 'String', 'signed',...
0345 'Callback', 'job_view_cortex_param;' );
0346 uicontrol( 'Tag', 'act_sign_mode', 'UserData', 'unsigned',...
0347 'Position', [ value_l+80, fig_h-10-line_h*i, 80, 20 ],...
0348 'Style', 'radiobutton', 'String', 'unsigned',...
0349 'Callback', 'job_view_cortex_param;' );
0350
0351
0352 i = i + 1;
0353 uicontrol( 'Tag', 'act_min_mode label', 'HitTest', 'off',...
0354 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0355 'Style', 'text', 'String', 'Act. minimum mode' );
0356 uicontrol( 'Tag', 'act_min_mode', 'UserData', 'absolute',...
0357 'Position', [ value_l, fig_h-10-line_h*i, 75, 20 ],...
0358 'Style', 'radiobutton', 'String', 'absolute',...
0359 'Callback', 'job_view_cortex_param;' );
0360 uicontrol( 'Tag', 'act_min_mode', 'UserData', 'relative',...
0361 'Position', [ value_l+80, fig_h-10-line_h*i, 70, 20 ],...
0362 'Style', 'radiobutton', 'String', 'relative',...
0363 'Callback', 'job_view_cortex_param;' );
0364
0365
0366 i = i + 1;
0367 uicontrol( 'Tag', 'act_min label', 'HitTest', 'off',...
0368 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0369 'Style', 'text', 'String', 'Act. minimum value' );
0370 uicontrol( 'Tag', 'act_min',...
0371 'Position', [ value_l, fig_h-10-line_h*i, 40, 20 ],...
0372 'Callback', 'job_view_cortex_param;',...
0373 'Style', 'edit', 'BackgroundColor', whitecolor,...
0374 'HorizontalAlign', 'right' );
0375
0376
0377 i = i + 1;
0378 uicontrol( 'Tag', 'act_colormap_max_mode label', 'HitTest', 'off',...
0379 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0380 'Style', 'text', 'String', 'Act. colormap max mode' );
0381 uicontrol( 'Tag', 'act_colormap_max_mode', 'UserData', 'absolute',...
0382 'Position', [ value_l, fig_h-10-line_h*i 75, 20 ],...
0383 'Style', 'radiobutton', 'String', 'absolute',...
0384 'Callback', 'job_view_cortex_param;' );
0385 uicontrol( 'Tag', 'act_colormap_max_mode', 'UserData', 'relative',...
0386 'Position', [ value_l+80, fig_h-10-line_h*i, 70, 20 ],...
0387 'Style', 'radiobutton', 'String', 'relative',...
0388 'Callback', 'job_view_cortex_param;' );
0389
0390
0391 i = i + 1;
0392 uicontrol( 'Tag', 'act_colormap_max label', 'HitTest', 'off',...
0393 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0394 'Style', 'text', 'String', 'Act. colormap max value' );
0395 uicontrol( 'Tag', 'act_colormap_max',...
0396 'Position', [ value_l, fig_h-10-line_h*i, 40, 20 ],...
0397 'Callback', 'job_view_cortex_param;',...
0398 'Style', 'edit', 'BackgroundColor', whitecolor,...
0399 'HorizontalAlign', 'right' );
0400
0401
0402 i = i + 1;
0403 uicontrol( 'Tag', 'act_colormap_type label', 'HitTest', 'off',...
0404 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0405 'Style', 'text', 'String', 'Act. colormap type' );
0406 uicontrol( 'Tag', 'act_colormap_type', 'UserData', 'hot',...
0407 'Position', [ value_l, fig_h-10-line_h*i, 45, 20 ],...
0408 'Style', 'radiobutton', 'String', 'hot',...
0409 'Callback', 'job_view_cortex_param;' );
0410 uicontrol( 'Tag', 'act_colormap_type', 'UserData', 'jet',...
0411 'Position', [ value_l+50, fig_h-10-line_h*i, 45, 20 ],...
0412 'Style', 'radiobutton', 'String', 'jet',...
0413 'Callback', 'job_view_cortex_param;' );
0414
0415
0416 i = i + 1;
0417 uicontrol( 'Tag', 'act_show_highlight label', 'HitTest', 'off',...
0418 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0419 'Style', 'text', 'String', 'Act. show highlight' );
0420 uicontrol( 'Tag', 'act_show_highlight', 'UserData', 'on',...
0421 'Position', [ value_l, fig_h-10-line_h*i, 45, 20 ],...
0422 'Style', 'radiobutton', 'String', 'on',...
0423 'Callback', 'job_view_cortex_param;' );
0424 uicontrol( 'Tag', 'act_show_highlight', 'UserData', 'off',...
0425 'Position', [ value_l+50, fig_h-10-line_h*i, 45, 20 ],...
0426 'Style', 'radiobutton', 'String', 'off',...
0427 'Callback', 'job_view_cortex_param;' );
0428
0429
0430 i = i + 1;
0431 uicontrol( 'Tag', 'act_non_highlight_alpha label', 'HitTest', 'off',...
0432 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0433 'Style', 'text', 'String', 'Act. non highlihgt trans.' );
0434 uicontrol( 'Tag', 'act_non_highlight_alpha slider',...
0435 'Position', [ value_l, fig_h-10-line_h*i, 120, 20 ],...
0436 'Callback', 'job_view_cortex_param;',...
0437 'Style', 'slider', 'Max', 1, 'Min', 0, 'SliderStep', [0.01 0.1] );
0438 uicontrol( 'Tag', 'act_non_highlight_alpha',...
0439 'Position', [ value_l+125, fig_h-10-line_h*i, 40, 20 ],...
0440 'Callback', 'job_view_cortex_param;',...
0441 'Style', 'edit', 'BackgroundColor', whitecolor,...
0442 'HorizontalAlign', 'right' );
0443
0444
0445 i = i + 1;
0446 uicontrol( 'Tag', 'area_alpha label', 'HitTest', 'off',...
0447 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0448 'Style', 'text', 'String', 'Area transparency' );
0449 uicontrol( 'Tag', 'area_alpha slider',...
0450 'Position', [ value_l, fig_h-10-line_h*i, 120, 20 ],...
0451 'Callback', 'job_view_cortex_param;',...
0452 'Style', 'slider', 'Max', 1, 'Min', 0, 'SliderStep', [0.01 0.1] );
0453 uicontrol( 'Tag', 'area_alpha',...
0454 'Position', [ value_l+125, fig_h-10-line_h*i, 40, 20 ],...
0455 'Callback', 'job_view_cortex_param;',...
0456 'Style', 'edit', 'BackgroundColor', whitecolor,...
0457 'HorizontalAlign', 'right' );
0458
0459
0460 i = i + 1;
0461 uicontrol( 'Tag', 'area_show_highlight label', 'HitTest', 'off',...
0462 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0463 'Style', 'text', 'String', 'Act. show highlight' );
0464 uicontrol( 'Tag', 'area_show_highlight', 'UserData', 'on',...
0465 'Position', [ value_l, fig_h-10-line_h*i, 45, 20 ],...
0466 'Style', 'radiobutton', 'String', 'on',...
0467 'Callback', 'job_view_cortex_param;' );
0468 uicontrol( 'Tag', 'area_show_highlight', 'UserData', 'off',...
0469 'Position', [ value_l+50, fig_h-10-line_h*i, 45, 20 ],...
0470 'Style', 'radiobutton', 'String', 'off',...
0471 'Callback', 'job_view_cortex_param;' );
0472
0473
0474 i = i + 1;
0475 uicontrol( 'Tag', 'selection_radius label', 'HitTest', 'off',...
0476 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0477 'Style', 'text', 'String', 'Selection radius' );
0478 uicontrol( 'Tag', 'selection_radius',...
0479 'Position', [ value_l, fig_h-10-line_h*i, 40, 20 ],...
0480 'Callback', 'job_view_cortex_param;',...
0481 'Style', 'edit', 'BackgroundColor', whitecolor,...
0482 'HorizontalAlign', 'right' );
0483
0484
0485 i = i + 1;
0486 uicontrol( 'Tag', 'selection_color label', 'HitTest', 'off',...
0487 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0488 'Style', 'text', 'String', 'Color of vertex selection' );
0489 axes( 'Tag', 'selection_color',...
0490 'Position', [ value_l, fig_h-10-line_h*i, 20, 20 ] );
0491 patch( 'Tag', 'selection_color',...
0492 'ButtonDownFcn', 'job_view_cortex_param;',...
0493 'XData',[0,1,1,0], 'YData',[0,0,1,1],...
0494 'Faces', [1,2,3,4], 'FaceColor',[1 1 1] );
0495
0496
0497 i = i + 1;
0498 uicontrol( 'Tag', 'selection_undo_length label', 'HitTest', 'off',...
0499 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0500 'Style', 'text', 'String', 'Selection undo length' );
0501 uicontrol( 'Tag', 'selection_undo_length',...
0502 'Position', [ value_l, fig_h-10-line_h*i, 40, 20 ],...
0503 'Callback', 'job_view_cortex_param;',...
0504 'Style', 'edit', 'BackgroundColor', whitecolor,...
0505 'HorizontalAlign', 'right' );
0506
0507
0508 i = i + 1;
0509 uicontrol( 'Tag', 'dilation_erosion_radius label', 'HitTest', 'off',...
0510 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0511 'Style', 'text', 'String', 'Dilation / Erosion radius' );
0512 uicontrol( 'Tag', 'dilation_erosion_radius',...
0513 'Position', [ value_l, fig_h-10-line_h*i, 40, 20 ],...
0514 'Callback', 'job_view_cortex_param;',...
0515 'Style', 'edit', 'BackgroundColor', whitecolor,...
0516 'HorizontalAlign', 'right' );
0517
0518
0519 i = i + 1;
0520 uicontrol( 'Tag', 'paint label', 'HitTest', 'off',...
0521 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0522 'Style', 'text', 'String', 'Painting method' );
0523 uicontrol( 'Tag', 'paint', 'UserData', 'dot',...
0524 'Position', [ value_l, fig_h-10-line_h*i, 45, 20 ],...
0525 'Style', 'radiobutton', 'String', 'dot',...
0526 'Callback', 'job_view_cortex_param;' );
0527 uicontrol( 'Tag', 'paint', 'UserData', 'patch',...
0528 'Position', [ value_l+50, fig_h-10-line_h*i, 60, 20 ],...
0529 'Style', 'radiobutton', 'String', 'patch',...
0530 'Callback', 'job_view_cortex_param;' );
0531
0532
0533 i = i + 1;
0534 uicontrol( 'Tag', 'markersize label', 'HitTest', 'off',...
0535 'Position', [ label_l, fig_h-10-line_h*i+1, label_w, 16 ],...
0536 'Style', 'text', 'String', 'Dot marker size' );
0537 uicontrol( 'Tag', 'markersize',...
0538 'Position', [ value_l, fig_h-10-line_h*i, 40, 20 ],...
0539 'Callback', 'job_view_cortex_param;',...
0540 'Style', 'edit', 'BackgroundColor', whitecolor,...
0541 'HorizontalAlign', 'right' );
0542
0543
0544 i = i + 1;
0545 uicontrol( 'Tag', 'ok',...
0546 'Position', [ fig_w-110, fig_h-10-line_h*i, 40, 20 ],...
0547 'Style', 'pushbutton', 'String', 'OK',...
0548 'HorizontalAlign', 'center',...
0549 'Callback', 'job_view_cortex_param;' );
0550
0551 uicontrol( 'Tag', 'cancel',...
0552 'Position', [ fig_w-65, fig_h-10-line_h*i, 55, 20 ],...
0553 'Style', 'pushbutton', 'String', 'Cancel',...
0554 'HorizontalAlign', 'center',...
0555 'Callback', 'job_view_cortex_param;' );
0556
0557
0558
0559
0560
0561
0562
0563 function job_view_cortex_param_set_value_to_gui( param )
0564
0565 fns = fieldnames( param );
0566
0567 for i = 1 : length( fns )
0568 fn = fns{i};
0569 val = getfield( param, fn );
0570 if isstr( val )
0571 set( findobj( gcf, 'Tag', fn, 'UserData', val ), 'Value', 1 );
0572 elseif length( val ) == 3
0573 set( findobj( gcf, 'Tag', fn, 'Type', 'patch' ), 'FaceColor', val );
0574 else
0575 set( findobj( gcf, 'Tag', fn ), 'String', val, 'UserData', val );
0576 end
0577 end
0578
0579 set( findobj( gcf, 'Tag', 'area_alpha slider' ), 'Value', param.area_alpha );
0580 set( findobj( gcf, 'Tag', 'act_non_highlight_alpha slider' ),...
0581 'Value', param.act_non_highlight_alpha );
0582
0583
0584
0585
0586
0587
0588
0589
0590 function param = job_view_cortex_param_get_value_from_gui
0591
0592 target = findobj( gcf, 'Tag', 'LRflg', 'Value', 1 );
0593 param.LRflg = get( target, 'UserData' );
0594
0595 target = findobj( gcf, 'Tag', 'model_type', 'Value', 1 );
0596 param.model_type = get( target, 'UserData' );
0597
0598 target = findobj( gcf, 'Tag', 'sulcus_visibility', 'Value', 1 );
0599 param.sulcus_visibility = get( target, 'UserData' );
0600
0601 target = findobj( gcf, 'Tag', 'brain_color', 'Type', 'patch' );
0602 param.brain_color = get( target, 'FaceColor' );
0603
0604 target = findobj( gcf, 'Tag', 'sulcus_color', 'Type', 'patch' );
0605 param.sulcus_color = get( target, 'FaceColor' );
0606
0607 target = findobj( gcf, 'Tag', 'lighting', 'Value', 1 );
0608 param.lighting = get( target, 'UserData' );
0609
0610 target = findobj( gcf, 'Tag', 'act_area_priority', 'Value', 1 );
0611 param.act_area_priority = get( target, 'UserData' );
0612
0613 target = findobj( gcf, 'Tag', 'act_relative_mode', 'Value', 1 );
0614 param.act_relative_mode = get( target, 'UserData' );
0615
0616 target = findobj( gcf, 'Tag', 'act_normalize', 'Value', 1 );
0617 param.act_normalize = get( target, 'UserData' );
0618
0619 target = findobj( gcf, 'Tag', 'act_sign_mode', 'Value', 1 );
0620 param.act_sign_mode = get( target, 'UserData' );
0621
0622 target = findobj( gcf, 'Tag', 'act_min_mode', 'Value', 1 );
0623 param.act_min_mode = get( target, 'UserData' );
0624
0625 target = findobj( gcf, 'Tag', 'act_min', 'Style', 'edit' );
0626 param.act_min = get( target, 'UserData' );
0627
0628 target = findobj( gcf, 'Tag', 'act_colormap_max_mode', 'Value', 1 );
0629 param.act_colormap_max_mode = get( target, 'UserData' );
0630
0631 target = findobj( gcf, 'Tag', 'act_colormap_max', 'Style', 'edit' );
0632 param.act_colormap_max = get( target, 'UserData' );
0633
0634 target = findobj( gcf, 'Tag', 'act_relative_mode', 'Value', 1 );
0635 param.act_relative_mode = get( target, 'UserData' );
0636
0637 target = findobj( gcf, 'Tag', 'act_colormap_type', 'Value', 1 );
0638 param.act_colormap_type = get( target, 'UserData' );
0639
0640 target = findobj( gcf, 'Tag', 'act_show_highlight', 'Value', 1 );
0641 param.act_show_highlight = get( target, 'UserData' );
0642
0643 target = findobj( gcf, 'Tag', 'act_non_highlight_alpha', 'Style', 'edit' );
0644 param.act_non_highlight_alpha = get( target, 'UserData' );
0645
0646 target = findobj( gcf, 'Tag', 'area_alpha', 'Style', 'edit' );
0647 param.area_alpha = get( target, 'UserData' );
0648
0649 target = findobj( gcf, 'Tag', 'area_show_highlight', 'Value', 1 );
0650 param.area_show_highlight = get( target, 'UserData' );
0651
0652 target = findobj( gcf, 'Tag', 'selection_radius', 'Style', 'edit' );
0653 param.selection_radius = get( target, 'UserData' );
0654
0655 target = findobj( gcf, 'Tag', 'selection_color', 'Type', 'patch' );
0656 param.selection_color = get( target, 'FaceColor' );
0657
0658 target = findobj( gcf, 'Tag', 'selection_undo_length', 'Style', 'edit' );
0659 param.selection_undo_length = get( target, 'UserData' );
0660
0661 target = findobj( gcf, 'Tag', 'dilation_erosion_radius', 'Style', 'edit' );
0662 param.dilation_erosion_radius = get( target, 'UserData' );
0663
0664 target = findobj( gcf, 'Tag', 'paint', 'Value', 1 );
0665 param.paint = get( target, 'UserData' );
0666
0667 target = findobj( gcf, 'Tag', 'markersize', 'Style', 'edit' );
0668 param.markersize = get( target, 'UserData' );
0669
0670
0671