Changeset 594
- Timestamp:
- Mar 26, 2013, 9:56:10 PM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ_matlab.m
r591 r594 105 105 Data.VarAttribute{5}.Role='warnflag'; 106 106 107 if 'PIV volume'107 if strcmp(Param.ListCompareMode, 'PIV volume') 108 108 Data.ListVarName=[Data.ListVarName 'Civ1_Z']; 109 109 Data.Civ1_X=[];Data.Civ1_Y=[];Data.Civ1_Z=[]; -
trunk/src/mouse_down.m
r575 r594 384 384 if isequal(get(h_edit_append,'Value'),1) && ~isempty(haxes) 385 385 h_ListCoord=hh_geometry_calib.ListCoord; %findobj(h_geometry_calib,'Tag','ListCoord'); 386 coord_value=get(hhuvmat. transform_fct,'Value');% set uvmat to pixel coordinates, run it again if not386 coord_value=get(hhuvmat.TransformName,'Value');% set uvmat to pixel coordinates, run it again if not 387 387 if ~(isequal(coord_value,1)||isequal(coord_value,3)); %active only with no transform or px (no phys) 388 set(hhuvmat. transform_fct,'Value',1)389 uvmat(' transform_fct_Callback',hObject,eventdata,hhuvmat); %file input with xml reading in uvmat388 set(hhuvmat.TransformName,'Value',1) 389 uvmat('TransformName_Callback',hObject,eventdata,hhuvmat); %file input with xml reading in uvmat 390 390 set(hhuvmat.CheckFixedLimits,'Value',0)% put FixedLimits option to 'off' 391 391 set(hhuvmat.CheckFixedLimits,'BackgroundColor',[0.7 0.7 0.7]) -
trunk/src/read_civdata.m
r582 r594 96 96 Field.SubDomain=Field.Patch1_SubDomain; 97 97 Field.ListGlobalAttribute=[Field.ListGlobalAttribute {'SubDomain'}]; 98 end 98 end 99 if isfield(Field,'Civ1_Dt') 99 100 Field.Dt=Field.Civ1_Dt; 101 end 102 if isfield(Field,'Civ1_Time') 100 103 Field.Time=Field.Civ1_Time; 104 end 101 105 case{'civ2','filter2'} 102 106 if isfield(Field,'Patch2_SubDomain') … … 104 108 Field.ListGlobalAttribute=[Field.ListGlobalAttribute {'SubDomain'}]; 105 109 end 110 if isfield(Field,'Civ2_Dt') 106 111 Field.Dt=Field.Civ2_Dt; 112 end 113 if isfield(Field,'Civ2_Time') 107 114 Field.Time=Field.Civ2_Time; 115 end 108 116 end 109 117 Field.ListGlobalAttribute=[Field.ListGlobalAttribute {'Dt','Time'}]; -
trunk/src/series.m
r591 r594 186 186 187 187 %% Adjust the GUI according to the binaries available in PARAM.xml 188 path_uvmat=fileparts(which('uvmat')); %path to civ189 addpath (path_uvmat) ; %add the path to civ, (useful in case of change of working directory after civ has been s opened in the working directory)190 errormsg=[];%default error message191 xmlfile='PARAM.xml';192 if exist(xmlfile,'file')193 try194 t=xmltree(xmlfile);195 sparam=convert(t);196 catch ME197 errormsg={' Unable to read the file PARAM.xml defining the binaries:';ME.message};198 end199 else200 errormsg=[xmlfile ' not found: path to binaries undefined'];201 end202 if ~isempty(errormsg)203 msgbox_uvmat('WARNING',errormsg);204 end205 test_batch=0;%default: ,no batch mode available206 if isfield(sparam,'BatchParam') && isfield(sparam.BatchParam,'BatchMode')207 test_batch=strcmp(sparam.BatchParam.BatchMode,'sge'); %sge is currently the only implemented batch mod208 end209 RUNVal=get(handles.RunMode,'Value');210 if test_batch==0211 if RUNVal>2212 set(handles.RunMode,'Value',1)213 end214 set(handles.RunMode,'String',{'local';'background'})215 else216 set(handles.RunMode,'String',{'local';'background';'cluster'})217 end188 % path_uvmat=fileparts(which('uvmat')); %path to civ 189 % addpath (path_uvmat) ; %add the path to civ, (useful in case of change of working directory after civ has been s opened in the working directory) 190 % errormsg=[];%default error message 191 % xmlfile='PARAM.xml'; 192 % if exist(xmlfile,'file') 193 % try 194 % t=xmltree(xmlfile); 195 % sparam=convert(t); 196 % catch ME 197 % errormsg={' Unable to read the file PARAM.xml defining the binaries:';ME.message}; 198 % end 199 % else 200 % errormsg=[xmlfile ' not found: path to binaries undefined']; 201 % end 202 % if ~isempty(errormsg) 203 % msgbox_uvmat('WARNING',errormsg); 204 % end 205 % test_batch=0;%default: ,no batch mode available 206 % if isfield(sparam,'BatchParam') && isfield(sparam.BatchParam,'BatchMode') 207 % test_batch=strcmp(sparam.BatchParam.BatchMode,'sge'); %sge is currently the only implemented batch mod 208 % end 209 % RUNVal=get(handles.RunMode,'Value'); 210 % if test_batch==0 211 % if RUNVal>2 212 % set(handles.RunMode,'Value',1) 213 % end 214 % set(handles.RunMode,'String',{'local';'background'}) 215 % else 216 % set(handles.RunMode,'String',{'local';'background';'cluster'}) 217 % end 218 218 219 219 %% introduce the input file name(s) if defined from input Param … … 1308 1308 set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784]) 1309 1309 drawnow 1310 [ h_fun,Series,filexml,errormsg]=prepare_jobs(handles);1310 [Series,filexml,errormsg]=prepare_jobs(handles); 1311 1311 if ~isempty(errormsg) 1312 1312 msgbox_uvmat('ERROR',errormsg) … … 1320 1320 ActionList=get(handles.ActionName,'String'); 1321 1321 ActionName=ActionList{get(handles.ActionName,'Value')}; 1322 1322 path_series=fileparts(which('series')); 1323 1324 % create the Action fct handle if RunMode option = 'local' 1325 if strcmp(RunMode,'local') 1326 if ~isequal(ActionPath,path_series) 1327 eval(['spath=which(''' ActionName ''');']) %spath = current path of the selected function ACTION 1328 if ~exist(ActionPath,'dir') 1329 msgbox_uvmat('ERROR',['The prescribed function path ' ActionPath ' does not exist']); 1330 return 1331 end 1332 if ~isequal(spath,ActionPath) 1333 addpath(ActionPath)% add the prescribed path if not the current one 1334 end 1335 end 1336 eval(['h_fun=@' ActionName ';'])%create a function handle for ACTION 1337 if ~isequal(ActionPath,path_series) 1338 rmpath(ActionPath)% add the prescribed path if not the current one 1339 end 1340 end 1341 1342 %% Get RunTime code from the file PARAM.xml (needed to run compiled functions) 1343 errormsg='';%default error message 1344 xmlfile=fullfile(path_series,'PARAM.xml'); 1345 test_batch=0;%default: ,no batch mode available 1346 if ~exist(xmlfile,'file') 1347 [success,message]=copyfile(fullfile(path_series,'PARAM.xml.default'),xmlfile); 1348 end 1349 RunTime=''; 1350 if strcmp(ActionExt,'.sh') 1351 if exist(xmlfile,'file') 1352 s=xml2struct(xmlfile); 1353 if strcmp(RunMode,'cluster') && isfield(s,'BatchParam') 1354 if isfield(s.BatchParam,'RunTime') 1355 RunTime=s.BatchParam.RunTime; 1356 end 1357 if isfield(s.BatchParam,'NbCore') 1358 NbCore=s.BatchParam.NbCore; 1359 end 1360 elseif (strcmp(RunMode,'background')||strcmp(RunMode,'local')) && isfield(s,'RunParam') 1361 if isfield(s.RunParam,'RunTime') 1362 RunTime=s.RunParam.RunTime; 1363 end 1364 if isfield(s.RunParam,'NbCore') 1365 NbCore=s.RunParam.NbCore; 1366 end 1367 end 1368 end 1369 if isempty(RunTime) && strcmp(RunMode,'cluster') 1370 msgbox_uvmat('ERROR','RunTime name not found in PARAM.xml, compiled version .sh cannot run on cluster') 1371 return 1372 end 1373 Series.RunTime=RunTime; 1374 end 1375 1323 1376 %% set nbre of processes 1324 if isfield(Series,'NbSlice')&&~isempty(Series.NbSlice) 1325 NbProcess=Series.NbSlice; 1326 else 1377 if ~isfield(Series,'NbSlice') 1378 Series.NbSlice=[]; 1379 end 1380 if isempty(Series.NbSlice) 1327 1381 switch RunMode 1328 1382 case {'local','background'} … … 1338 1392 end 1339 1393 NbProcess=NbCore;% choose one process per core 1340 end 1394 else 1395 NbProcess=Series.NbSlice;% the nbre of run processes is equal to the number of slices 1396 end 1397 1398 %% read index ranges 1399 first_i=1; 1400 last_i=1; 1401 incr_i=1; 1402 first_j=1; 1403 last_j=1; 1404 incr_j=1; 1405 if isfield(Series.IndexRange,'first_i') 1406 first_i=Series.IndexRange.first_i; 1407 incr_i=Series.IndexRange.incr_i; 1408 last_i=Series.IndexRange.last_i; 1409 end 1410 if isfield(Series.IndexRange,'first_j') 1411 first_j=Series.IndexRange.first_j; 1412 last_j=Series.IndexRange.last_j; 1413 end 1414 if last_i < first_i || last_j < first_j , msgbox_uvmat('ERROR','last field number must be larger than the first one'),... 1415 set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return 1416 else 1417 BlockLength=ceil(numel(first_i:incr_i:last_i)/NbProcess); 1418 end 1419 1420 %% main processing 1341 1421 for iprocess=1:NbProcess% TOD0 1342 1422 % split the input files … … 1346 1426 switch RunMode 1347 1427 case 'local' 1348 switch ActionExt 1349 case '.m' 1350 for iprocess=1:NbProcess 1351 if ~isempty(filexml) 1352 t=struct2xml(Series); 1353 t=set(t,1,'name','Series'); 1354 save(t,filexml); 1355 end 1356 Series.RUNHandle=handles.RUN; 1357 Series.WaitbarHandle=handles.Waitbar; 1358 Series=h_fun(Series); 1428 Series.RUNHandle=handles.RUN; 1429 Series.WaitbarHandle=handles.Waitbar; 1430 for iprocess=1:NbProcess 1431 if isempty(Series.NbSlice) 1432 Series.IndexRange.first_i=first_i+(iprocess-1)*BlockLength; 1433 Series.IndexRange.last_i=first_i+(iprocess)*BlockLength-1; 1434 else 1435 Series.IndexRange.first_i= first_i+iprocess-1; 1436 Series.IndexRange.incr_i=incr_i*Series.NbSlice; 1437 end 1438 if ~isempty(filexml) 1439 t=struct2xml(Series); 1440 t=set(t,1,'name','Series'); 1441 if isequal(Series.IndexRange.last_i,Series.IndexRange.first_i) 1442 term_i=num2str(Series.IndexRange.first_i); 1443 else 1444 term_i=[num2str(Series.IndexRange.first_i) '-' num2str(Series.IndexRange.last_i)]; 1359 1445 end 1360 case '.sh' 1361 for iprocess=1:NbProcess 1362 CivmBin=fullfile(ActionPath,[ActionName '.sh']); %path to the source directory of uvmat 1446 if isequal(Series.IndexRange.last_j,Series.IndexRange.first_j) 1447 term_j=num2str(Series.IndexRange.first_j); 1448 else 1449 term_j=[num2str(Series.IndexRange.first_j) '-' num2str(Series.IndexRange.last_j)]; 1450 end 1451 save(t,[filexml '_' term_i '_' term_j '.xml']); 1452 end 1453 switch ActionExt 1454 case '.m' 1455 h_fun(Series); 1456 case '.sh' 1363 1457 switch computer 1364 case {'PCWIN','PCWIN64'} 1458 case {'PCWIN','PCWIN64'} %Windows system 1365 1459 filename=regexprep(filename,'\\','\\\\');% add '\' so that '\' are left as characters 1366 1460 % TODO launch command in DOS 1367 case {'GLNX86','GLNXA64','MACI64'} 1368 cmd=['#!/bin/bash \n '... 1369 '#$ -cwd \n '... 1370 'hostname && date \n '... 1371 'umask 002 \n'... 1372 CivmBin ' ' Param.xml.RunTime ' ' regexprep(filename,'(.+)([/\\])(.+$)','$1$20_XML$2$3.xml') ' ' Param.OutputFile '.nc'];%allow writting access to created files for user group 1461 case {'GLNX86','GLNXA64','MACI64'}%Linux system 1462 % cmd=['#!/bin/bash \n '... 1463 % '#$ -cwd \n '... 1464 % 'hostname && date \n '... 1465 % 'umask 002 \n'... 1466 % fullfile(ActionPath,[ActionName '.sh']) ' ' Series.RunTime ' ' filexml '_' term_i '_' term_j '.xml'];%allow writting access to created files for user group 1467 system([fullfile(ActionPath,[ActionName '.sh']) ' ' Series.RunTime ' ' filexml '_' term_i '_' term_j '.xml']); 1373 1468 end 1374 1469 end 1375 1470 end 1376 1471 case 'background' … … 1384 1479 t=set(t,1,'name','Series'); 1385 1480 save(t,filexml); 1386 path_uvmat=fileparts(which('uvmat'));1387 1481 1388 1482 filename_bat=regexprep(filexml,'.xml$','.bat');% create executable file to run program in background … … 1401 1495 '. /etc/sysprofile \n'... 1402 1496 'matlab -nodisplay -nosplash -nojvm -logfile ''' filelog ''' <<END_MATLAB \n'... 1403 'addpath(''' path_ uvmat'''); \n'...1497 'addpath(''' path_series '''); \n'... 1404 1498 'addpath(''' Series.Action.ActionPath '''); \n'... 1405 1499 '' Series.Action.ActionName '( ''' filexml '''); \n'... … … 1413 1507 case {'PCWIN','PCWIN64'} 1414 1508 text_matlabscript=['matlab -automation -logfile ' regexprep(filelog,'\\','\\\\')... 1415 ' -r "addpath(''' regexprep(path_ uvmat,'\\','\\\\') ''');'...1509 ' -r "addpath(''' regexprep(path_series,'\\','\\\\') ''');'... 1416 1510 'addpath(''' regexprep(Series.Action.ActionPath,'\\','\\\\') ''');'... 1417 1511 '' Series.Action.ActionName '( ''' regexprep(filexml,'\\','\\\\') ''');exit"']; … … 1577 1671 % --- Main launch command, called by RUN and BATCH 1578 1672 1579 function [ h_fun,Series,filexml,errormsg]=prepare_jobs(handles,run)1673 function [Series,filexml,errormsg]=prepare_jobs(handles) 1580 1674 %INPUT: 1581 1675 % handles: handles of graphic objects on the GUI series … … 1584 1678 1585 1679 %------------------------------------------------------------------------ 1586 h_fun=[];1587 1680 filexml=''; 1588 1681 errormsg=''; 1589 if ~exist('run','var') 1590 run=1; 1591 end 1682 1592 1683 %% Read parameters from series 1593 1684 Series=read_GUI(handles.series); … … 1596 1687 end 1597 1688 1598 %% read index ranges1599 first_i=1;1600 last_i=1;1601 incr_i=1;1602 first_j=1;1603 last_j=1;1604 incr_j=1;1605 if isfield(Series.IndexRange,'first_i')1606 first_i=Series.IndexRange.first_i;1607 incr_i=Series.IndexRange.incr_i;1608 last_i=Series.IndexRange.last_i;1609 end1610 if isfield(Series.IndexRange,'first_j')1611 first_j=Series.IndexRange.first_j;1612 incr_j=Series.IndexRange.incr_j;1613 last_j=Series.IndexRange.last_j;1614 end1615 1616 %% read input file parameters and set menus1617 menu_coord_state=get(handles.TransformName,'Visible');1618 if isequal(menu_coord_state,'on')1619 menu_index=get(handles.TransformName,'Value');1620 transform_list=get(handles.TransformName,'UserData');1621 Series.FieldTransform.TransformHandle=transform_list{menu_index};% transform function handles1622 end1623 1624 if last_i < first_i || last_j < first_j , msgbox_uvmat('ERROR','last field number must be larger than the first one'),...1625 set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end;1626 1689 1627 1690 %% projection object 1628 if isfield(Series,'CheckObject')1629 if Series.CheckObject1630 hset_object=findobj(allchild(0),'tag','set_object');1631 Series.ProjObject=read_GUI(hset_object);1632 CheckObject_Callback([], [], handles)1633 end1634 else1635 Series.CheckObject=0;1636 end1691 % if isfield(Series,'CheckObject') 1692 % if Series.CheckObject 1693 % hset_object=findobj(allchild(0),'tag','set_object'); 1694 % Series.ProjObject=read_GUI(hset_object); 1695 % CheckObject_Callback([], [], handles) 1696 % end 1697 % else 1698 % Series.CheckObject=0; 1699 % end 1637 1700 1638 1701 %% get_field GUI … … 1644 1707 end 1645 1708 1646 if ~run1647 return1648 end1649 1650 1709 %% defining the ActionName function handle 1651 list_action=get(handles.ActionName,'String');% list menu action1652 index=get(handles.ActionName,'Value');1653 action= list_action{index}; % selected string1654 % Series.hseries=handles.series; % handles to the series GUI1655 path_series=which('series');1656 ActionPathList=get(handles.ActionName,'UserData');1657 ActionPath=ActionPathList{index}; %path stored for the function ACTION1658 if ~isequal(ActionPath,path_series)1659 eval(['spath=which(''' action ''');']) %spath = current path of the selected function ACTION1660 if ~exist(ActionPath,'dir')1661 errormsg=['The prescribed function path ' ActionPath ' does not exist'];1662 return1663 end1664 if ~isequal(spath,ActionPath)1665 addpath(ActionPath)% add the prescribed path if not the current one1666 end1667 end1668 eval(['h_fun=@' action ';'])%create a function handle for ACTION1669 if ~isequal(ActionPath,path_series)1670 rmpath(ActionPath)% add the prescribed path if not the current one1671 end1710 % list_action=get(handles.ActionName,'String');% list menu action 1711 % index=get(handles.ActionName,'Value'); 1712 % action= list_action{index}; % selected string 1713 % %Series.hseries=handles.series; % handles to the series GUI 1714 % path_series=which('series'); 1715 % ActionPathList=get(handles.ActionName,'UserData'); 1716 % ActionPath=ActionPathList{index}; %path stored for the function ACTION 1717 % if ~isequal(ActionPath,path_series) 1718 % eval(['spath=which(''' action ''');']) %spath = current path of the selected function ACTION 1719 % if ~exist(ActionPath,'dir') 1720 % errormsg=['The prescribed function path ' ActionPath ' does not exist']; 1721 % return 1722 % end 1723 % if ~isequal(spath,ActionPath) 1724 % addpath(ActionPath)% add the prescribed path if not the current one 1725 % end 1726 % end 1727 % eval(['h_fun=@' action ';'])%create a function handle for ACTION 1728 % if ~isequal(ActionPath,path_series) 1729 % rmpath(ActionPath)% add the prescribed path if not the current one 1730 % end 1672 1731 1673 1732 %% create the output data directory and write in it the xml file from the GUI config … … 1712 1771 end 1713 1772 end 1714 filexml=fullfile(OutputDir, [Series.InputTable{1,3} '.xml']);% name of the parameter xml file set in this directory1773 filexml=fullfile(OutputDir,Series.InputTable{1,3});% name of the parameter xml file set in this directory 1715 1774 end 1716 1775 %removes redondant information … … 1816 1875 1817 1876 %% check the current ActionPath to the selected function 1818 PathName=ActionPathList{ActionIndex};%current recorded path1819 set(handles.ActionPath,'String', PathName); %show the path to the senlected function1877 ActionPath=ActionPathList{ActionIndex};%current recorded path 1878 set(handles.ActionPath,'String',ActionPath); %show the path to the senlected function 1820 1879 1821 1880 %% reinitialise the waitbar … … 1829 1888 set(handles.Mask,'Visible','off') 1830 1889 1831 %% run the current action function to prepare the input GUI 1832 [h_fun,Series,tild,errormsg]=prepare_jobs(handles); 1890 %% create the function handle for Action 1891 path_series=which('series'); 1892 if ~isequal(ActionPath,path_series) 1893 eval(['spath=which(''' ActionName ''');']) %spath = current path of the selected function ACTION 1894 if ~exist(ActionPath,'dir') 1895 errormsg=['The prescribed function path ' ActionPath ' does not exist']; 1896 return 1897 end 1898 if ~isequal(spath,ActionPath) 1899 addpath(ActionPath)% add the prescribed path if not the current one 1900 end 1901 end 1902 eval(['h_fun=@' ActionName ';'])%create a function handle for ACTION 1903 if ~isequal(ActionPath,path_series) 1904 rmpath(ActionPath)% add the prescribed path if not the current one 1905 end 1906 1907 %% prepare the input param 1908 [Series,tild,errormsg]=prepare_jobs(handles); 1833 1909 if ~isempty(errormsg) 1834 1910 msgbox_uvmat('ERROR',errormsg) … … 1877 1953 end 1878 1954 end 1955 else 1956 % check index ranges 1957 first_i=1;last_i=1;first_j=1;last_j=1; 1958 if isfield(Series.IndexRange,'first_i') 1959 first_i=Series.IndexRange.first_i; 1960 last_i=Series.IndexRange.last_i; 1961 end 1962 if isfield(Series.IndexRange,'first_j') 1963 first_j=Series.IndexRange.first_j; 1964 last_j=Series.IndexRange.last_j; 1965 end 1966 if last_i < first_i || last_j < first_j , msgbox_uvmat('ERROR','last field number must be larger than the first one'),... 1967 set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end; 1879 1968 end 1880 1969 … … 2248 2337 function MenuExportConfig_Callback(hObject, eventdata, handles) 2249 2338 global Series 2250 [tild,Series,errormsg]=prepare_jobs(handles ,0);2339 [tild,Series,errormsg]=prepare_jobs(handles); 2251 2340 % Series=read_GUI(handles.series); 2252 2341 … … 2492 2581 ActionName=ActionList{get(handles.ActionName,'Value')}; 2493 2582 if strcmp(ActionExt,'.sh') 2494 ActionFullName=fullfile(get(handles.ActionPath,'String'),[ActionName ActionExt]);2583 ActionFullName=fullfile(get(handles.ActionPath,'String'),[ActionName '.sh']); 2495 2584 if ~exist(ActionFullName,'file') 2496 2585 answer=msgbox_uvmat('INPUT_Y-N','compiled version has not been created: compile now?'); … … 2502 2591 end 2503 2592 end 2593 currentdir=pwd; 2594 cd(get(handles.ActionPath,'String')) 2595 sh_file=dir([ActionName '.sh']); 2596 m_file=dir([ActionName '.m']); 2597 if isfield(m_file,'datenum') && m_file.datenum>sh_file.datenum 2598 set(handles.ActionExt,'BackgroundColor',[1 1 0]) 2599 answer=msgbox_uvmat('INPUT_Y-N',[ActionName '.sh needs to be updated: recompile now?']); 2600 if strcmp(answer,'Yes') 2601 compile(ActionName) 2602 end 2603 set(handles.ActionExt,'BackgroundColor',[1 1 1]) 2604 end 2605 cd(currentdir) 2504 2606 end 2505 2607 -
trunk/src/series/aver_stat.m
r592 r594 62 62 63 63 %%%%%%%%%%%% STANDARD PART %%%%%%%%%%%% 64 ParamOut=[]; 64 65 %% read input parameters from an xml file if input is a file name (batch mode) 65 66 checkrun=1; -
trunk/src/series/check_data_files.m
r592 r594 34 34 function ParamOut=check_data_files(Param) 35 35 36 % %% set the input elements needed on the GUI series when the action is selected in the menu ActionName37 % if ~exist('Param','var') % case with no input parameter38 % ParamOut={'NbViewMax';'';...% max nbre of input file series (default='' , no limitation)39 % 'AllowInputSort';'off';...% allow alphabetic sorting of the list of input files (options 'off'/'on', 'off' by default)40 % 'NbSlice';'on'; ...%nbre of slices ('off' by default)41 % 'VelType';'off';...% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default)42 % 'FieldName';'off';...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)43 % 'FieldTransform'; 'off';...%can use a transform function44 % 'ProjObject';'off';...%can use projection object(option 'off'/'on',45 % 'Mask';'off';...%can use mask option (option 'off'/'on', 'off' by default)46 % 'OutputDirExt';'';...%set the output dir extension47 % ''};48 % return49 % end50 36 %% input preparation mode (no RUN) 51 37 if isstruct(Param) && isequal(Param.Action.RUN,0) 52 ParamOut.AllowInputSort='off'; ...% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)53 ParamOut.WholeIndexRange='off'; ...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)54 ParamOut.NbSlice='on'; ...%nbre of slices ('off' by default)55 ParamOut.VelType='off'; ...% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default)56 ParamOut.FieldName='off'; ...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)57 ParamOut.FieldTransform = 'off'; ...%can use a transform function58 ParamOut.ProjObject='off'; ...%can use projection object(option 'off'/'on',59 ParamOut.Mask='off'; ...%can use mask option (option 'off'/'on', 'off' by default)38 ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default) 39 ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default) 40 ParamOut.NbSlice='on';%nbre of slices ('off' by default) 41 ParamOut.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default) 42 ParamOut.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default) 43 ParamOut.FieldTransform = 'off';%can use a transform function 44 ParamOut.ProjObject='off';%can use projection object(option 'off'/'on', 45 ParamOut.Mask='off';%can use mask option (option 'off'/'on', 'off' by default) 60 46 ParamOut.OutputDirExt='';%set the output dir extension (blank=no output dir) 61 47 return 62 48 end 63 49 %%%%%%%%%%%% STANDARD PART %%%%%%%%%%%% 64 %% select different modes, RUN, parameter input, BATCH 65 % BATCH case: read the xml file for batch case 50 51 %% read input parameters from an xml file if input is a file name (batch mode) 52 checkrun=1; 66 53 if ischar(Param) 67 Param=xml2struct(Param); 68 checkrun=0; 69 % RUN case: parameters introduced as the input structure Param 70 else 71 if isfield(Param,'Specific')&& strcmp(Param.Specific,'?') 72 checkrun=1;% will only search interactive input parameters (preparation of BATCH mode) 73 else 74 checkrun=2; % indicate the RUN option is used 75 end 76 hseries=guidata(Param.hseries);%handles of the GUI series 54 Param=xml2struct(Param);% read Param as input file (batch case) 55 checkrun=0; 77 56 end 78 ParamOut=Param; %default output 79 %OutputDir=[Param.OutputSubDir Param.OutputDirExt];NO OUTPUT FILE 80 57 81 58 %% root input file(s) and type 82 59 RootPath=Param.InputTable(:,1); … … 126 103 Tabchar{4}=FileInfo.ImageType; 127 104 Tabchar{5}=[' compression' FileInfo.VideoCompression]; 128 Tabchar{6}=[ 'quality ' num2str(FileInfo.Quality)]; 105 Tabchar{6}=[ 'quality ' num2str(FileInfo.Quality)]; 129 106 else 130 107 Tabchar={}; … … 135 112 datnum=zeros(1,nbfield_j); 136 113 for ifile=1:nbfield_i 137 stopstate=get(hseries.RUN,'BusyAction'); 114 if checkrun 115 stopstate=get(Param.RUNHandle,'BusyAction'); 116 update_waitbar(Param.WaitbarHandle,ifile/nbfield_i) 117 else 118 stopstate='queue'; 119 end 138 120 if isequal(stopstate,'queue')% enable STOP command 139 update_waitbar(hseries.Waitbar,ifile/nbfield_i)140 121 file=filecell{iview,index_slice(ifile)}; 141 122 [Path,Name,ext]=fileparts(file); … … 148 129 datnum(ifile)=datfile.datenum; 149 130 filefound(ifile)={datfile.name}; 150 end 131 end 151 132 lastfield=''; 152 133 [FileType{iview},FileInfo,Object]=get_file_type(file); 153 134 if strcmp(FileType{iview},'civx')||strcmp(FileType{iview},'civdata') 154 135 if isfield(FileInfo,'CivStage') 155 liststage={'civ1','fix1','patch1','civ2','fix2','patch2'};156 lastfield=liststage{FileInfo.CivStage};136 liststage={'civ1','fix1','patch1','civ2','fix2','patch2'}; 137 lastfield=liststage{FileInfo.CivStage}; 157 138 end 158 139 end 159 lastfield=[FileType{iview} ', ' lastfield]; 140 lastfield=[FileType{iview} ', ' lastfield]; 160 141 end 161 142 Tabchar(1,i_slice)={['slice #' num2str(i_slice)]}; … … 168 149 message=['no set of ' num2str(NbSlice) ' (NbSlices) files found']; 169 150 else 170 151 message='no file found'; 171 152 end 172 153 else … … 177 158 message={['oldest modification: ' filefound{ind} ' : ' datestr(first)];... 178 159 ['latest modification: ' filefound{indlast} ' : ' datestr(last)]}; 179 end 160 end 180 161 if ~isempty(Tabchar) 181 Tabchar=reshape(Tabchar,NbSlice*(nbfield_i+1),1);162 Tabchar=reshape(Tabchar,NbSlice*(nbfield_i+1),1); 182 163 end 183 164 end
Note: See TracChangeset
for help on using the changeset viewer.