 Timestamp:
 Oct 8, 2014, 8:27:12 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/series/civ_series.m
r810 r819 21 21 % .Patch2: 22 22 % ncfile: name of a netcdf file to be created for the result (extension .nc) 23 24 %=======================================================================25 % Copyright 20082014, LEGI UMR 5519 / CNRS UJF GINP, Grenoble, France26 % http://www.legi.grenobleinp.fr27 % Joel.Sommeria  Joel.Sommeria (A) legi.cnrs.fr28 23 % 29 % This file is part of the toolbox UVMAT. 30 % 24 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 25 % Copyright 20112014, LEGI / CNRS UJF GINP, Joel.Sommeria@legi.grenobleinp.fr 26 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 27 % This is part of the toolbox UVMAT. 28 % 31 29 % UVMAT is free software; you can redistribute it and/or modify 32 % it under the terms of the GNU General Public License as published 33 % by the Free Software Foundation; either version 2 of the license,34 % or(at your option) any later version.35 % 30 % it under the terms of the GNU General Public License as published by 31 % the Free Software Foundation; either version 2 of the License, or 32 % (at your option) any later version. 33 % 36 34 % UVMAT is distributed in the hope that it will be useful, 37 35 % but WITHOUT ANY WARRANTY; without even the implied warranty of 38 36 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 39 % GNU General Public License ( see LICENSE.txt) for more details.40 % =======================================================================37 % GNU General Public License (open UVMAT/COPYING.txt) for more details. 38 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 41 39 42 40 function [Data,errormsg,result_conv]= civ_series(Param) … … 80 78 if ischar(Param) 81 79 Param=xml2struct(Param);% read Param as input file (batch case) 80 Param.InputTable{1} 81 Param.InputTable{2} 82 Param.InputTable{3} 82 83 checkrun=0; 83 84 end … … 228 229 [DataIn,tild,tild,errormsg]=nc2struct(ImageName_A,{FieldName_A}); 229 230 par_civ1.ImageA=DataIn.(FieldName_A); 230 else 231 [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileType_A,VideoObject_A,FrameIndex_A_Civ1(1));231 else 232 [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileType_A,VideoObject_A,FrameIndex_A_Civ1(1)); 232 233 end 233 234 ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ1(1),[],j2_series_Civ1(1)); … … 240 241 if strcmp(FileInfo_B.FileType,'netcdf') 241 242 FieldName_B=Param.InputFields.FieldName; 242 243 244 else 245 [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ1(1));243 [DataIn,tild,tild,errormsg]=nc2struct(ImageName_B,{FieldName_B}); 244 par_civ1.ImageB=DataIn.(FieldName_B); 245 else 246 [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ1(1)); 246 247 end 247 248 NbField=numel(i1_series_Civ1); … … 531 532 par_civ2.ImageB=[]; 532 533 % if ~isfield(Param.Civ1,'ImageA') 533 ImageName_A_Civ2=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ2(ifield),[],j1_series_Civ2(ifield)); 534 i1=i1_series_Civ2(ifield); 535 i2=i1; 536 if ~isempty(i2_series_Civ2) 537 i2=i2_series_Civ2(ifield); 538 end 539 j1=1; 540 if ~isempty(j1_series_Civ2) 541 j1=j1_series_Civ2(ifield); 542 end 543 j2=j1; 544 if ~isempty(j2_series_Civ2) 545 j2=j2_series_Civ2(ifield); 546 end 547 ImageName_A_Civ2=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1,[],j1); 534 548 535 549 if strcmp(ImageName_A_Civ2,ImageName_A) && isequal(FrameIndex_A_Civ1(ifield),FrameIndex_A_Civ2(ifield)) … … 538 552 [par_civ2.ImageA,VideoObject_A] = read_image(ImageName_A_Civ2,FileType_A,VideoObject_A,FrameIndex_A_Civ2(ifield)); 539 553 end 540 ImageName_B_Civ2=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2 _series_Civ2(ifield),[],j2_series_Civ2(ifield));554 ImageName_B_Civ2=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2,[],j2); 541 555 if strcmp(ImageName_B_Civ2,ImageName_B) && isequal(FrameIndex_B_Civ1(ifield),FrameIndex_B_Civ2) 542 556 par_civ2.ImageB=par_civ1.ImageB; … … 545 559 end 546 560 547 ncfile=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1 _series_Civ2(ifield),i2_series_Civ2(ifield),...548 j1 _series_Civ2(ifield),j2_series_Civ2(ifield));561 ncfile=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1,i2,... 562 j1,j2); 549 563 par_civ2.ImageWidth=FileInfo_A.Width; 550 564 par_civ2.ImageHeight=FileInfo_A.Height; … … 601 615 par_civ2.SearchBoxSize(1)=2*ibx2+9;% search ara +4 pixels around the guess 602 616 par_civ2.SearchBoxSize(2)=2*iby2+9; 603 i1=i1_series_Civ2(ifield);604 i2=i1;605 if ~isempty(i2_series_Civ2)606 i2=i2_series_Civ2(ifield);607 end608 j1=1;609 if ~isempty(j1_series_Civ2)610 j1=j1_series_Civ2(ifield);611 end612 j2=j1;613 if ~isempty(j2_series_Civ1)614 j2=j2_series_Civ2(ifield);615 end617 % i1=i1_series_Civ2(ifield); 618 % i2=i1; 619 % if ~isempty(i2_series_Civ2) 620 % i2=i2_series_Civ2(ifield); 621 % end 622 % j1=1; 623 % if ~isempty(j1_series_Civ2) 624 % j1=j1_series_Civ2(ifield); 625 % end 626 % j2=j1; 627 % if ~isempty(j2_series_Civ1) 628 % j2=j2_series_Civ2(ifield); 629 % end 616 630 Civ2_Dt=time(i2+1,j2+1)time(i1+1,j1+1); 617 631 par_civ2.SearchBoxShift=(Civ2_Dt/Data.Civ1_Dt)*[Shiftx(nbval>=1)./nbval(nbval>=1) Shifty(nbval>=1)./nbval(nbval>=1)]; … … 1088 1102 i1_series=i_series;% set of first image indexes 1089 1103 i2_series=i_series; 1090 j1_series= ones(size(i_series));% set of first image numbers1091 j2_series= ones(size(i_series));1104 j1_series=j_series;%ones(size(i_series));% set of first image numbers 1105 j2_series=j_series;%ones(size(i_series)); 1092 1106 r=regexp(str_civ,'^\D(?<ind>[ij])=(  )(?<num1>\d+)\(?<num2>\d+)','names'); 1093 1107 if ~isempty(r) … … 1118 1132 end 1119 1133 end 1120 if strcmp (mode,'Di') 1121 i1_series=i_seriesind1;% set of first image numbers 1122 i2_series=i_series+ind2; 1123 check_bounds=i1_series<MinIndex_i  i2_series>MaxIndex_i; 1124 if isempty(j_series) 1125 NomTypeNc='_12'; 1126 else 1127 j1_series=j_series; 1128 j2_series=j_series; 1129 NomTypeNc='_12_1'; 1130 end 1131 elseif strcmp (mode,'Dj') 1132 j1_series=j_seriesind1; 1133 j2_series=j_series+ind2; 1134 check_bounds=j1_series<MinIndex_j  j2_series>MaxIndex_j; 1135 NomTypeNc='_1_12'; 1136 else %bursts 1137 i1_series=i_series(1,:);% do not sweep the j index 1138 i2_series=i_series(1,:); 1139 j1_series=ind1*ones(1,size(i_series,2));% j index is fixed by pair choice 1140 j2_series=ind2*ones(1,size(i_series,2)); 1141 check_bounds=zeros(size(i1_series));% no limitations due to minmax indices 1142 end 1143 1144 1145 1146 1134 switch mode 1135 case 'Di' 1136 i1_series=i_seriesind1;% set of first image numbers 1137 i2_series=i_series+ind2; 1138 check_bounds=i1_series<MinIndex_i  i2_series>MaxIndex_i; 1139 if isempty(j_series) 1140 NomTypeNc='_12'; 1141 else 1142 j1_series=j_series; 1143 j2_series=j_series; 1144 NomTypeNc='_12_1'; 1145 end 1146 case 'Dj' 1147 j1_series=j_seriesind1; 1148 j2_series=j_series+ind2; 1149 check_bounds=j1_series<MinIndex_j  j2_series>MaxIndex_j; 1150 NomTypeNc='_1_12'; 1151 otherwise %bursts 1152 i1_series=i_series(1,:);% do not sweep the j index 1153 i2_series=i_series(1,:); 1154 j1_series=ind1*ones(1,size(i_series,2));% j index is fixed by pair choice 1155 j2_series=ind2*ones(1,size(i_series,2)); 1156 check_bounds=zeros(size(i1_series));% no limitations due to minmax indices 1157 end 1158 1159 1160 1161
Note: See TracChangeset
for help on using the changeset viewer.