Changeset 456 for trunk/src/series.m
- Timestamp:
- Jun 17, 2012, 10:50:20 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r453 r456 539 539 MinIndex=get(handles.MinIndex,'Data');%retrieve the min indices in the table MinIndex 540 540 MaxIndex=get(handles.MaxIndex,'Data');%retrieve the max indices in the table MaxIndex 541 i_sum=sum(sum(i1_series,2),3); 541 i_sum=sum(sum(i1_series,2),3);%sum of i1_series on the last index 542 542 MaxIndex_i=max(find(i_sum>0))-1; 543 MinIndex_i=min(find(i_sum>0))-1; 544 j_sum=sum(sum(i1_series,1),3); 543 if isequal(i1_series(1),0) 544 MinIndex_i=0; 545 else 546 MinIndex_i=min(find(i_sum>0))-1; 547 end 548 j_sum=sum(sum(j1_series,1),3); 545 549 MaxIndex_j=max(find(j_sum>0))-1; 546 550 MinIndex_j=min(find(j_sum>0))-1; … … 650 654 651 655 %% update time table 656 if ~isempty(time) 652 657 TimeTable=get(handles.TimeTable,'Data'); 653 658 if isempty(MinIndex_j) 659 if MinIndex_i>0 654 660 TimeTable{iview,1}=time(MinIndex_i); 661 end 655 662 TimeTable{iview,2}=time(first_i); 656 663 TimeTable{iview,3}=time(last_i); 657 664 TimeTable{iview,4}=time(MaxIndex_i); 658 665 elseif ~isempty(time) 666 if MinIndex_i>0 659 667 TimeTable{iview,1}=time(MinIndex_i,MinIndex_j); 668 end 660 669 TimeTable{iview,2}=time(first_i,first_j); 661 670 TimeTable{iview,3}=time(last_i,last_j); … … 663 672 end 664 673 set(handles.TimeTable,'Data',TimeTable) 674 end 665 675 666 676 %% number of slices … … 1108 1118 else 1109 1119 enable_i(handles,'On') 1110 enable_j(handles,'On') 1120 if isempty(j1_series) 1121 enable_j(handles,'Off') 1122 else 1123 enable_j(handles,'On') 1124 end 1111 1125 end 1112 1126 fill_ListPair(handles,i1_series,i2_series,j1_series,j2_series,time) … … 1259 1273 set(handles.RUN, 'Enable','Off') 1260 1274 set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784]) 1275 drawnow 1261 1276 [h_fun,Series,filexml,errormsg]=prepare_jobs(handles); 1262 1277 if ~isempty(errormsg) 1263 1278 msgbox_uvmat('ERROR',errormsg) 1264 1279 else 1265 Series.Specific=h_fun(Series,0); 1280 %Series.Specific=h_fun(Series); 1281 Series=h_fun(Series); 1266 1282 t=struct2xml(Series); 1267 1283 t=set(t,1,'name','Series'); 1268 1284 save(t,filexml); 1269 h_fun(Series);1285 % h_fun(Series); 1270 1286 end 1271 1287 set(handles.RUN, 'Enable','On') … … 1293 1309 end 1294 1310 % update the xml file after interactive input with the function 1295 Series.Specific=h_fun( Series,0);1311 Series.Specific=h_fun('input?'); 1296 1312 t=struct2xml(Series); 1297 1313 t=set(t,1,'name','Series'); … … 1305 1321 return 1306 1322 end 1307 fctpath=get(handles.ActionPath,'String');1323 path_fct=get(handles.ActionPath,'String'); 1308 1324 text_matlabscript=[... 1309 1325 '#!/bin/bash \n'... … … 1311 1327 'matlab -nodisplay -nosplash -nojvm <<END_MATLAB \n'... 1312 1328 'cd(''' path_series '''); \n'... 1313 'addpath(''' fctpath'''); \n'...1329 'addpath(''' path_fct '''); \n'... 1314 1330 '' Series.Action '( ''' filename_xml '''); \n'... 1315 1331 'exit \n'... … … 1318 1334 fclose(fid); 1319 1335 if isunix 1320 system(['chmod +x ' filename_bat]); 1336 system(['chmod +x ' filename_bat]);% set the file to executable 1337 system(['. ' filename_bat]);%execute fct 1321 1338 end 1322 1339 set(handles.BATCH, 'Enable','On') 1323 1340 set(handles.BATCH,'BackgroundColor',[1 0 0]) 1341 1324 1342 %------------------------------------------------------------------------ 1325 1343 % --- Executes on button press in BIN. … … 1333 1351 1334 1352 %------------------------------------------------------------------------ 1335 % --- Main lau ch command, called by RUN and BATCH1353 % --- Main launch command, called by RUN and BATCH 1336 1354 function [h_fun,Series,filexml,errormsg]=prepare_jobs(handles) 1337 1355 %------------------------------------------------------------------------ 1356 filexml=''; 1338 1357 errormsg=''; 1339 1358 %% Read parameters from series … … 1343 1362 end 1344 1363 1345 %% read root name and field type1364 %% read index ranges 1346 1365 first_i=1; 1347 1366 last_i=1; … … 1463 1482 end 1464 1483 filexml=fullfile(Series.OutputDir,[Series.InputTable{1,3} '.xml']);% name of the parameter xml file set in this directory 1465 t=struct2xml(Series);1466 t=set(t,1,'name','Series');1467 save(t,filexml);1484 % t=struct2xml(Series); 1485 % t=set(t,1,'name','Series'); 1486 % save(t,filexml); 1468 1487 end 1469 1488 … … 1573 1592 InputText=textscan(fid,'%s',1,'delimiter','\n'); 1574 1593 fclose(fid) 1575 set(handles.ActionName,'ToolTipString',InputText{1}{1}) 1594 set(handles.ActionName,'ToolTipString',InputText{1}{1})% put the first line of the selected function as tooltip help 1576 1595 end 1577 1596 if ~isequal(path_series,PathName) … … 1617 1636 SeriesData.AllowInputSort=1; 1618 1637 set(handles.series,'UserData',SeriesData) 1619 end 1638 end 1639 case 'WholeIndexRange' 1640 if isequal(lower(varargout{ilist+1}),'on')% sort the input table by alphabetical order of the SubDir 1641 MinIndex=get(handles.MinIndex,'Data'); 1642 MaxIndex=get(handles.MaxIndex,'Data'); 1643 if ~isempty(MinIndex) 1644 set(handles.num_first_i,'String',num2str(MinIndex{1})) 1645 set(handles.num_last_i,'String',num2str(MaxIndex{1})) 1646 set(handles.num_incr_i,'String','1') 1647 if size(MinIndex,2)>=2 1648 set(handles.num_first_j,'String',num2str(MinIndex{1,2})) 1649 set(handles.num_last_j,'String',num2str(MaxIndex{1,2})) 1650 set(handles.num_incr_j,'String','1') 1651 end 1652 end 1653 end 1620 1654 case 'NbSlice' %hidden by default 1621 1655 if isequal(lower(varargout{ilist+1}),'on')
Note: See TracChangeset
for help on using the changeset viewer.