Changeset 997 for trunk


Ignore:
Timestamp:
Feb 6, 2017, 8:05:39 PM (4 years ago)
Author:
sommeria
Message:

ActionInput? button introduced in series, use of parameter file series.xml

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r996 r997  
    14551455% --- called by RUN_Callback
    14561456%------------------------------------------------------------------------
     1457% The calculations are launched in three different ways:
     1458% RunMode='local': calculation on the local Matlab session, will prevent other actions during that time.
     1459% RunMode='background': calculation on the local computer, but in a new Matlab session (with no graphic output).
     1460% RunMode='cluster': calculations dispatched in a cluster, using a managing system, 'oar, 'sge, or 'sgb'.
     1461% In the latter case, the calculation is split in 'packets' of i index (all j indices are contained in a single packet).
     1462% This splitting is possible only if the different calculations in the series are independent. Otherwise the action
     1463% function imposes a number of processes NbSlice in input, for instance NbSlice=1 for a time series.
     1464% If NbSlice is not imposed, the splitting in packets (jobs) is determined
     1465% so that a job is optimum length AdvisedJobCPUTime), and the total job number in any case smaller
     1466% than MaxJobNumber (these parameters are defined in the file series.xml in
     1467% accordance with the management strategy for the cluster). The jobs are
     1468% dispatched in parallel into NbCore processors by the cluster managing system.
     1469
    14571470function errormsg=launch_action(handles)
    14581471errormsg=''; % default
     
    15681581        NbCore=1; % no need to split the calculation
    15691582    case 'cluster_oar'
    1570         NbCoreDefault=SeriesData.OarParam.NbCoreDefault;%proposed number of cores (for cluster)
    1571             if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled)
     1583        %proposed number of cores to reserve in the cluster
     1584        NbCoreAdvised=SeriesData.SeriesParam.OarParam.NbCoreAdvised;
     1585        NbCoreMax=SeriesData.SeriesParam.OarParam.NbCoreMax;
     1586        if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled)
    15721587            warning_string=', preferably use .sh option to save Matlab licences';
    1573             else
    1574                 warning_string='';
    1575             end
    1576             answer=inputdlg({['Number of cores (max 36)' warning_string],'extra oar options'},'oarsub parameter',1,{num2str(NbCoreDefault),''});
    1577             if isempty(answer)
    1578                                 errormsg='Action launch interrupted by user';
    1579                 return
    1580             end
    1581             NbCore=str2double(answer{1});
    1582             extra_oar=answer{2};
    1583  %       end
     1588        else
     1589            warning_string=')';
     1590        end
     1591        answer=inputdlg({['Number of cores (max ' num2str(NbCoreMax) warning_string],'extra oar options'},'oarsub parameter',1,{num2str(NbCoreAdvised),''});
     1592        if isempty(answer)
     1593            errormsg='Action launch interrupted by user';
     1594            return
     1595        end
     1596        NbCore=str2double(answer{1});
     1597        extra_oar=answer{2};
    15841598    case {'cluster_pbs', 'cluster_sge', 'cluster_qstat_unknown'}
    15851599        if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled)
     
    17221736switch RunMode
    17231737    case {'cluster_oar','cluster_pbs','cluster_sge','cluster_qstat_unknown'}
     1738        JobNumberMax=SeriesData.SeriesParam.OarParam.JobNumberMax;
     1739        JobCPUTimeAdvised=SeriesData.SeriesParam.OarParam.JobCPUTimeAdvised;
    17241740        if isempty(Param.IndexRange.NbSlice)% if NbSlice is not defined
    1725             BlockLength= ceil(20/(CPUTime*nbfield_j)); % short iterations are grouped such that the minimum time of a process is 20 min.
    1726             BlockLength=max(BlockLength,ceil(numel(ref_i)/500)); % possibly increase the BlockLength to have less than 500 jobs
     1741            BlockLength= ceil(JobCPUTimeAdvised/(CPUTime*nbfield_j)); % iterations are grouped in sets with length BlockLength  such that the typical CPU time of a job is MinJobNumber.
     1742            BlockLength=max(BlockLength,ceil(numel(ref_i)/JobNumberMax)); % possibly increase the BlockLength to have less than MaxJobNumber jobs
    17271743            NbProcess=ceil(numel(ref_i)/BlockLength) ; % nbre of processes sent to oar
    17281744        else
    17291745            NbProcess=Param.IndexRange.NbSlice; % the parameter NbSlice sets the nbre of run processes
    1730             NbCore=min(NbCore,NbProcess); % reduces the number of cores if it exceeds the number of processes
    1731         end
     1746        end
     1747        NbCore=min(NbCore,NbProcess); % reduces the number of cores if it exceeds the number of processes
    17321748    otherwise
    17331749        if ~isempty(Param.IndexRange.NbSlice)
     
    18581874    filelog_global=fullfile(OutputDir,'0_LOG',filelog_global);
    18591875
    1860     for iprocess=1:NbProcess
    1861        
    1862         %create the executable file
    1863        
     1876    for iprocess=1:NbProcess   
     1877        %create the executable file       
    18641878        batch_file_list{iprocess}=fullfile(OutputDir,'0_EXE',regexprep(extxml{iprocess},'.xml$',ExeExt));
    18651879       
    18661880        % set the log file name
    1867         filelog{iprocess}=fullfile(OutputDir,'0_LOG',regexprep(extxml{iprocess},'.xml$','.log'));
    1868        
     1881        filelog{iprocess}=fullfile(OutputDir,'0_LOG',regexprep(extxml{iprocess},'.xml$','.log'));     
    18691882    end
    18701883end
     
    20012014        % shorter than the wall time: in the time interval 'checkpoint' (WallTimeOneJob) before the end of the allowed duration,
    20022015        %  the oar job restarts when an individual job ends.
    2003         JobTime=CPUTime*BlockLength*nbfield_j; % estimated time for one individual job (in minutes)
     2016        WallTimeMax=SeriesData.SeriesParam.OarParam.WallTimeMax;
     2017        JobTime=CPUTime*BlockLength*nbfield_j; % estimated CPU time for one individual job (in minutes)
    20042018        % wall time (in hours ) for each oar job, allowing 10 individual jobs, but limited to 23 h:
    2005         WallTimeTotal=min(23,4*JobTime/60);
     2019        WallTimeTotal=min(WallTimeMax,4*JobTime/60);
    20062020        %disp(['WallTimeTotal: ' num2str(WallTimeTotal) ' hours'])
    20072021        % estimated time of an individual job (in min), with a margin of error
     
    23142328%% Activate the Action fct to adapt the configuration of the GUI series and bring specific parameters in SeriesData
    23152329Param=read_GUI_series(handles); % read the parameters from the GUI series
     2330Param.Action.RUN=0;
    23162331ParamOut=h_fun(Param); % run the selected Action function to get the relevant input
    23172332
     
    25272542    set(handles.NbSlice_title,'Visible','off')
    25282543end
    2529 if isnumeric(ParamOut.NbSlice)
     2544if isfield(ParamOut,'NbSlice') && isnumeric(ParamOut.NbSlice)
    25302545    set(handles.num_NbSlice,'String',num2str(ParamOut.NbSlice))
    25312546    set(handles.num_NbSlice,'Enable','off'); % NbSlice set by the activation of the Action function
  • trunk/src/series.xml.default

    r996 r997  
    33   <DiskQuotaCmd>quota -s -g -A</DiskQuotaCmd>
    44<OarParam>
    5    <NbCoreDefault>16</NbCoreDefault><!--proposed default number of parallel cores for a job -->
    6    <MinEstimatedCPUTime unit="minute">20</MinEstimatedCPUTime><!--used to group the iterations into jobs of sufficient CPU time-->
    7    <MaxJobNumber>500</MaxJobNumber><!--maximum number of jobs allowed (will group the iterations to fit in)-->
    8    <JobStatCmd>oarstat |grep N=UVmat</JobStatCmd>   
     5  <NbCoreAdvised>16</NbCoreAdvised><!--proposed default number of parallel cores attributed for the computations -->
     6  <NbCoreMax>36</NbCoreMax><!--maximum number of cores allowed for the computations -->
     7  <JobCPUTimeAdvised unit="minute">20</JobCPUTimeAdvised><!--used to group the iterations into jobs of sufficient CPU time-->
     8  <JobNumberMax>500</JobNumberMax><!--maximum number of jobs allowed (will group the iterations to fit in)-->
     9  <WallTimeMax unit="hour">23</WallTimeMax> <!--maximum allowed time for a job --> 
     10  <JobStatCmd>oarstat |grep N=UVmat</JobStatCmd> <!--command to know the number of active and waiting job launches--> 
    911</OarParam>
    1012<SgeParam>
  • trunk/src/series/check_data_files.m

    r984 r997  
    5252function ParamOut=check_data_files(Param)
    5353
     54ParamOut=[];
    5455%% input preparation mode (no RUN)
    5556if isstruct(Param) && isequal(Param.Action.RUN,0)
  • trunk/src/series/civ_series.m

    r996 r997  
    224224   
    225225    %% check the first image pair
    226     try
     226%     try
    227227        if Param.ActionInput.CheckCiv1% Civ1 is performed
    228             first_ima=1;
    229             ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ1(1),[],j1_series_Civ1(1));
    230             if checkrun
    231                 if ~exist(ImageName_A,'file')
    232                 disp_uvmat('ERROR',['first input image ' ImageName_A ' does not exist'],checkrun)
    233                 return
    234                 end
    235             else
    236 %                 for ifile=1:numel(i1_series_Civ1)
    237 %                     if
    238             end
    239             [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A);
    240             FileType_A=FileInfo_A.FileType;
    241             if strcmp(FileInfo_A.FileType,'netcdf')
    242                 FieldName_A=Param.InputFields.FieldName;
    243                 [DataIn,tild,tild,errormsg]=nc2struct(ImageName_A,{FieldName_A});
    244                 par_civ1.ImageA=DataIn.(FieldName_A);
    245             else
    246                 [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileType_A,VideoObject_A,FrameIndex_A_Civ1(1));
    247             end
    248             ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ1(1),[],j2_series_Civ1(1));
    249             if ~exist(ImageName_B,'file')
    250                 disp_uvmat('ERROR',['first input image ' ImageName_B ' does not exist'],checkrun)
    251                 return
    252             end
    253             [FileInfo_B,VideoObject_B]=get_file_info(ImageName_B);
    254             FileType_B=FileInfo_B.FileType;
    255             if strcmp(FileInfo_B.FileType,'netcdf')
    256                 FieldName_B=Param.InputFields.FieldName;
    257                 [DataIn,tild,tild,errormsg]=nc2struct(ImageName_B,{FieldName_B});
    258                 par_civ1.ImageB=DataIn.(FieldName_B);
    259             else
    260                 [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ1(1));
    261             end
     228%             ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ1(1),[],j1_series_Civ1(1));
     229%             [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A);
     230%             FileType_A=FileInfo_A.FileType;
     231%             if strcmp(FileInfo_A.FileType,'netcdf')
     232%                 FieldName_A=Param.InputFields.FieldName;
     233%                 [DataIn,tild,tild,errormsg]=nc2struct(ImageName_A,{FieldName_A});
     234%                 par_civ1.ImageA=DataIn.(FieldName_A);
     235%             else
     236%                 [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileType_A,VideoObject_A,FrameIndex_A_Civ1(1));
     237%             end
     238%             ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ1(1),[],j2_series_Civ1(1));
     239%             if ~exist(ImageName_B,'file')
     240%                 disp_uvmat('ERROR',['first input image ' ImageName_B ' does not exist'],checkrun)
     241%                 return
     242%             end
     243%             [FileInfo_B,VideoObject_B]=get_file_info(ImageName_B);
     244%             FileType_B=FileInfo_B.FileType;
     245%             if strcmp(FileInfo_B.FileType,'netcdf')
     246%                 FieldName_B=Param.InputFields.FieldName;
     247%                 [DataIn,tild,tild,errormsg]=nc2struct(ImageName_B,{FieldName_B});
     248%                 par_civ1.ImageB=DataIn.(FieldName_B);
     249%             else
     250%                 [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ1(1));
     251%             end
    262252            NbField=numel(i1_series_Civ1);
    263253        elseif Param.ActionInput.CheckCiv2 % Civ2 is performed without Civ1
    264             ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ2(1),[],j1_series_Civ2(1));
    265             if ~exist(ImageName_A,'file')
    266                 disp_uvmat('ERROR',['first input image ' ImageName_A ' does not exist'],checkrun)
    267                 return
    268             end
    269             [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A);
    270             FileType_A=FileInfo_A.FileType;
    271             [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileInfo_A.FileType,VideoObject_A,FrameIndex_A_Civ2(1));
    272             ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ2(1),[],j2_series_Civ2(1));
    273             if ~exist(ImageName_B,'file')
    274                 disp_uvmat('ERROR',['first input image ' ImageName_B ' does not exist'],checkrun)
    275                 return
    276             end
    277             [FileInfo_B,VideoObject_B]=get_file_info(ImageName_B);
    278             FileType_B=FileInfo_B.FileType;
    279             [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ2(1));
     254%             ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ2(1),[],j1_series_Civ2(1));
     255%             if ~exist(ImageName_A,'file')
     256%                 disp_uvmat('ERROR',['first input image ' ImageName_A ' does not exist'],checkrun)
     257%                 return
     258%             end
     259%             [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A);
     260%             FileType_A=FileInfo_A.FileType;
     261%             [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileInfo_A.FileType,VideoObject_A,FrameIndex_A_Civ2(1));
     262%             ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ2(1),[],j2_series_Civ2(1));
     263%             if ~exist(ImageName_B,'file')
     264%                 disp_uvmat('ERROR',['first input image ' ImageName_B ' does not exist'],checkrun)
     265%                 return
     266%             end
     267%             [FileInfo_B,VideoObject_B]=get_file_info(ImageName_B);
     268%             FileType_B=FileInfo_B.FileType;
     269%             [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ2(1));
    280270            NbField=numel(i1_series_Civ2);
    281271        else
    282272            NbField=numel(i1_series_Civ1);% no image used (only fix or patch) TO CHECK
    283273        end
    284     catch ME
    285         if ~isempty(ME.message)
    286             disp_uvmat('ERROR', ['error reading input image: ' ME.message],checkrun)
    287             return
    288         end
    289     end
     274%     catch ME
     275%         if ~isempty(ME.message)
     276%             disp_uvmat('ERROR', ['error reading input image: ' ME.message],checkrun)
     277%             return
     278%         end
     279%     end
    290280   
    291281   
     
    326316        end
    327317    end
    328     if isempty(Time) && ~isempty(find(strcmp(FileType_A,{'mmreader','video','cine_phantom'})))% case of video input
    329         Time=zeros(FileInfo_A.NumberOfFrames+1,2);
    330         Time(:,2)=(0:1/FileInfo_A.FrameRate:(FileInfo_A.NumberOfFrames)/FileInfo_A.FrameRate)';
    331         TimeSource='video';
    332         ColorType='truecolor';
    333     end
    334     if isempty(Time)% Time = index i +0.001 index j by default
    335         %MinIndex_i=min(i1_series_Civ1);
    336         MaxIndex_i=max(i2_series_Civ1);
    337         %MinIndex_j=min(j1_series_Civ1);
    338         MaxIndex_j=max(j2_series_Civ1);
    339         Time=(1:MaxIndex_i)'*ones(1,MaxIndex_j);
    340         Time=Time+0.001*ones(MaxIndex_i,1)*(1:MaxIndex_j);
    341         Time=[zeros(1,MaxIndex_j);Time];% insert a first line of zeros
    342         Time=[zeros(MaxIndex_i+1,1) Time];% insert a first column of zeros
    343     end
    344    
    345     if length(FileInfo_A) >1 %case of image with multiple frames
    346         nbfield=length(FileInfo_A);
    347         nbfield_j=1;
    348     end
     318   
     319
    349320end
    350321
    351322%%%%% MAIN LOOP %%%%%%
    352323maskname='';% initiate the mask name
    353 tic;
     324FileType_A='';
     325FileType_B='';
    354326CheckOverwrite=1;%default
    355327if isfield(Param,'CheckOverwrite')
     
    357329end
    358330for ifield=1:NbField
     331    tic
    359332    if ~isempty(RUNHandle)% update the waitbar in interactive mode with GUI series  (checkrun=1)
    360333        update_waitbar(WaitbarHandle,ifield/NbField)
     
    382355            end
    383356        end
    384         ncfile_out=ncfile;% by default 
     357        ncfile_out=ncfile;% by default
    385358        if isfield (Param.ActionInput,'Civ2')
    386359            i1_civ2=i1_series_Civ2(ifield);
     
    412385    if isfield (Param.ActionInput,'Civ1')
    413386        if CheckInputFile
    414         disp('civ1 started')
     387            disp('civ1 started')
    415388        end
    416389        par_civ1=Param.ActionInput.Civ1;
     
    418391            try
    419392                ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ1(ifield),[],j1_series_Civ1(ifield));
    420                 if strcmp(FileInfo_A.FileType,'netcdf')% case of input images in format netcdf
     393                if strcmp(FileExt_A,'.nc')% case of input images in format netcdf
    421394                    FieldName_A=Param.InputFields.FieldName;
    422395                    [DataIn,tild,tild,errormsg]=nc2struct(ImageName_A,{FieldName_A});
    423396                    par_civ1.ImageA=DataIn.(FieldName_A);
    424397                else % usual image formats for image A
     398                    if isempty(FileType_A)
     399                        [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A);
     400                        FileType_A=FileInfo_A.FileType;
     401                        if isempty(Time) && ~isempty(find(strcmp(FileType_A,{'mmreader','video','cine_phantom'})))% case of video input
     402                            Time=zeros(FileInfo_A.NumberOfFrames+1,2);
     403                            Time(:,2)=(0:1/FileInfo_A.FrameRate:(FileInfo_A.NumberOfFrames)/FileInfo_A.FrameRate)';
     404                            TimeSource='video';
     405                            ColorType='truecolor';
     406                        end
     407                        if ~isempty(FileType_A) && isempty(Time)% Time = index i +0.001 index j by default
     408                            MaxIndex_i=max(i2_series_Civ1);
     409                            MaxIndex_j=max(j2_series_Civ1);
     410                            Time=(1:MaxIndex_i)'*ones(1,MaxIndex_j);
     411                            Time=Time+0.001*ones(MaxIndex_i,1)*(1:MaxIndex_j);
     412                            Time=[zeros(1,MaxIndex_j);Time];% insert a first line of zeros
     413                            Time=[zeros(MaxIndex_i+1,1) Time];% insert a first column of zeros
     414                        end
     415                    end
     416                    if ~exist(ImageName_A,'file')
     417                        disp([ImageName_A ' missing'])
     418                        continue
     419                    end
    425420                    [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileType_A,VideoObject_A,FrameIndex_A_Civ1(ifield));
    426421                end
    427422                ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ1(ifield),[],j2_series_Civ1(ifield));
    428                 if strcmp(FileInfo_B.FileType,'netcdf') % case of input images in format netcdf
     423                if strcmp(FileExt_B,'.nc') % case of input images in format netcdf
    429424                    FieldName_B=Param.InputFields.FieldName;
    430425                    [DataIn,tild,tild,errormsg]=nc2struct(ImageName_B,{FieldName_B});
    431426                    par_civ1.ImageB=DataIn.(FieldName_B);
    432427                else % usual image formats for image B
     428                    if isempty(FileType_B)
     429                        [FileInfo_B,VideoObject_B]=get_file_info(ImageName_B);
     430                        FileType_B=FileInfo_B.FileType;
     431                    end
     432                    if ~exist(ImageName_B,'file')
     433                        disp([ImageName_B ' missing'])
     434                        continue
     435                    end
    433436                    [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ1(ifield));
    434437                end
     
    465468                Data.Civ1_Dt=1;% Time interval is 1, to yield displacement instead of velocity=displacement/Dt at reading
    466469            else
    467             Data.Civ1_Time=(Time(i2+1,j2+1)+Time(i1+1,j1+1))/2;% the Time is the Time at the middle of the image pair
    468             Data.Civ1_Dt=Time(i2+1,j2+1)-Time(i1+1,j1+1);
     470                Data.Civ1_Time=(Time(i2+1,j2+1)+Time(i1+1,j1+1))/2;% the Time is the Time at the middle of the image pair
     471                Data.Civ1_Dt=Time(i2+1,j2+1)-Time(i1+1,j1+1);
    469472            end
    470473            for ilist=1:length(list_param)
     
    555558    %% Fix1
    556559    if isfield (Param.ActionInput,'Fix1')
    557          disp('fix1 started')
     560        disp('fix1 started')
    558561        if ~isfield (Param.ActionInput,'Civ1')% if we use existing Civ1, remove previous data beyond Civ1
    559562            Fix1_attr=find(strcmp('Fix1',Data.ListGlobalAttribute));
     
    630633            par_civ2.ImageA=[];
    631634            par_civ2.ImageB=[];
    632 %             i1_civ2=i1_series_Civ2(ifield);
    633 %             i2_civ2=i1_civ2;
    634 %             if ~isempty(i2_series_Civ2)
    635 %                 i2_civ2=i2_series_Civ2(ifield);
    636 %             end
    637 %             j1_civ2=1;
    638 %             if ~isempty(j1_series_Civ2)
    639 %                 j1_civ2=j1_series_Civ2(ifield);
    640 %             end
    641 %             j2_civ2=i1_civ2;
    642 %             if ~isempty(j2_series_Civ2)
    643 %                 j2_civ2=j2_series_Civ2(ifield);
    644 %             end
     635            %             i1_civ2=i1_series_Civ2(ifield);
     636            %             i2_civ2=i1_civ2;
     637            %             if ~isempty(i2_series_Civ2)
     638            %                 i2_civ2=i2_series_Civ2(ifield);
     639            %             end
     640            %             j1_civ2=1;
     641            %             if ~isempty(j1_series_Civ2)
     642            %                 j1_civ2=j1_series_Civ2(ifield);
     643            %             end
     644            %             j2_civ2=i1_civ2;
     645            %             if ~isempty(j2_series_Civ2)
     646            %                 j2_civ2=j2_series_Civ2(ifield);
     647            %             end
    645648            ImageName_A_Civ2=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_civ2,[],j1_civ2);
    646649           
     
    656659                [par_civ2.ImageB,VideoObject_B] = read_image(ImageName_B_Civ2,FileType_B,VideoObject_B,FrameIndex_B_Civ2(ifield));
    657660            end
    658 %             if strcmp(Param.ActionInput.ListCompareMode,'PIV')
    659 %                 ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1,i2,j1,j2);
    660 %             else % displacement
    661 %                 ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i2,[],j2);
    662 %             end
     661            %             if strcmp(Param.ActionInput.ListCompareMode,'PIV')
     662            %                 ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1,i2,j1,j2);
     663            %             else % displacement
     664            %                 ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i2,[],j2);
     665            %             end
    663666            par_civ2.ImageWidth=FileInfo_A.Width;
    664667            par_civ2.ImageHeight=FileInfo_A.Height;
     
    784787            Data.Civ2_ImageA=ImageName_A;
    785788            Data.Civ2_ImageB=ImageName_B;
    786              if strcmp(Param.ActionInput.ListCompareMode,'displacement')
     789            if strcmp(Param.ActionInput.ListCompareMode,'displacement')
    787790                Data.Civ2_Time=Time(i2_civ2+1,j2_civ2+1);% the Time is the Time of the secodn image
    788791                Data.Civ2_Dt=1;% Time interval is 1, to yield displacement instead of velocity=displacement/Dt at reading
    789              else
    790             Data.Civ2_Time=(Time(i2_civ2+1,j2_civ2+1)+Time(i1_civ2+1,j1_civ2+1))/2;
    791             Data.Civ2_Dt=Civ2_Dt;
    792              end
     792            else
     793                Data.Civ2_Time=(Time(i2_civ2+1,j2_civ2+1)+Time(i1_civ2+1,j1_civ2+1))/2;
     794                Data.Civ2_Dt=Civ2_Dt;
     795            end
    793796        end
    794797        for ilist=1:length(list_param)
     
    822825                disp_uvmat('ERROR',errormsg,checkrun)
    823826                return
    824             end         
     827            end
    825828        elseif isfield(Param,'Civ2_X')% use Civ2 data as input in Param (test mode)
    826829            Data.ListGlobalAttribute={};
     
    893896        Data.VarAttribute{nbvar+6}.Role='vector_x';
    894897        Data.VarAttribute{nbvar+7}.Role='vector_y';
    895         Data.Civ2_U_smooth=Data.Civ2_U; 
    896         Data.Civ2_V_smooth=Data.Civ2_V; 
     898        Data.Civ2_U_smooth=Data.Civ2_U;
     899        Data.Civ2_V_smooth=Data.Civ2_V;
    897900        if isfield(Data,'Civ2_FF')
    898901            ind_good=find(Data.Civ2_FF==0);
     
    10341037    end
    10351038    check_undefined=(par_civ.Mask<200 & par_civ.Mask>=20 );
    1036 %     par_civ.ImageA(check_undefined)=0;% put image A to zero (i.e. the min image value) in the undefined  area
    1037 %     par_civ.ImageB(check_undefined)=0;% put image B to zero (i.e. the min image value) in the undefined  area
     1039    %     par_civ.ImageA(check_undefined)=0;% put image A to zero (i.e. the min image value) in the undefined  area
     1040    %     par_civ.ImageB(check_undefined)=0;% put image B to zero (i.e. the min image value) in the undefined  area
    10381041end
    10391042
  • trunk/src/xml2struct.m

    r978 r997  
    6464    end
    6565else
     66    try
    6667    ss=convert(t);%transform the xmltree object into a Matlab structure.
    6768    s=convert_string(ss);
     69    catch ME
     70        errormsg=ME.message;
     71    end
    6872end
    6973
Note: See TracChangeset for help on using the changeset viewer.