Changeset 1009
- Timestamp:
- Jul 22, 2017, 7:20:02 PM (7 years ago)
- Location:
- trunk/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/find_field_cells.m
r977 r1009 75 75 for ilist=1:numel(Data.ListVarName) 76 76 if ~isfield(Data,Data.ListVarName{ilist}) 77 check_var=0;% dimensions of data defined, data not needed for this function77 check_var=0;% dimensions of array defined, but the corresponding array is not given 78 78 break 79 79 end 80 80 end 81 if ~check_var && ~(isfield(Data,'ListDimName')&& isfield(Data,'DimValue')&&isequal(numel(Data.ListDimName),numel(Data.DimValue)))82 errormsg=['missing variable or values of dimensions' Data.ListVarName{ilist}];83 return84 end81 % if ~check_var && ~(isfield(Data,'ListDimName')&& isfield(Data,'DimValue')&& isequal(numel(Data.ListDimName),numel(Data.DimValue))) 82 % errormsg=['missing dimension values']; 83 % return 84 % end 85 85 86 86 -
trunk/src/find_file_series.m
r977 r1009 11 11 % NomType: nomenclature type corrected after checking the first file (problem of 0 before the number string) 12 12 % FileInfo: structure containing info on the input files (assumed identical on the whole series) 13 14 15 16 17 18 19 13 % FileInfo.FileType: type of file, = 14 % = 'image', usual image as recognised by Matlab 15 % = 'multimage', image series stored in a single file 16 % = 'civx', netcdf file with civx convention 17 % = 'civdata', civ data with new convention 18 % = 'netcdf' other netcdf files 19 % = 'video': movie recognised by VideoReader (e;g. avi) 20 20 % MovieObject: video object (=[] otherwise 21 21 % i1_input,i2_input,j1_input,j2_input: indices of the input file, or of the first file in the series if the input file does not exist … … 23 23 %INPUT 24 24 % FilePath: path to the directory to be scanned 25 % fileinput: name (without path) of the input file sample 25 % fileinput: name (without path) of the input file sample 26 26 % checkxml: =1(default) take into account xml file existence to possibly include indexes in RootFile 27 27 % =0: do not take into account xml file existence … … 53 53 54 54 %% check for particular file types: images, movies, civ data 55 checkfileindexing=0;56 55 if isfield(FileInfo,'FileIndexing') && strcmp(FileInfo.FileIndexing,'on') 57 56 [RootPath,SubDir,RootFile,i1_input,i2_input,j1_input,j2_input,FileExt,NomType]=fileparts_uvmat(fullfileinput); 58 if ~isempty(regexp(SubDir,'^level\d+$')) && exist([RootPath '.xml'],'file')59 NomType='level';60 end57 % if ~isempty(regexp(SubDir,'^level\d+$')) && exist([RootPath '.xml'],'file') 58 % NomType='level'; 59 % end 61 60 i1_series=zeros(1,1,1); 62 61 i2_series=zeros(1,1,1); … … 75 74 return 76 75 end 76 checkfileindexing=0; 77 77 end 78 78 if ~exist(FilePath,'dir') … … 173 173 end 174 174 end 175 if strcmp(NomType,'level') 176 star_string=[RootFile '*' FileExt]; 177 detect_string=['^' RootFile '(?<i1>\d+)' FileExt '$'];%string used in regexp to detect file indices 178 wd=pwd;%current working directory 179 cd (FilePath)% move to the local dir to save time in the operation dir. 180 dirpair=dir(star_string);% look for relevant files in the file directory 181 cd(wd)% back to the working directory 182 nbpair=numel(dirpair); 183 i1_series=zeros(1,nbpair); 184 if nbpair==0% no detected file 185 RootFile=''; 186 end 187 % scan the list of relevant files, extract the indices 188 for ifile=1:nbpair 189 rr=regexp(dirpair(ifile).name,detect_string,'names'); 190 if ~isempty(rr) 191 i1_series(ifile)=str2num(rr.i1); 192 end 193 end 194 % look for the list of subfolders level# 195 cd (RootPath)% move to the local dir to save time in the operation dir. 196 dirpair=dir('level*');% look for relevant subfolders named with leve# 197 cd(wd) 198 [RootPath,SubDir]=fileparts(RootPath); 199 nbpair=numel(dirpair); 200 jfile=0; 201 for ifile=1:nbpair 202 rr=regexp(dirpair(ifile).name,'^level(?<i1>\d+)$','names'); 203 if ~isempty(rr) 204 jfile=jfile+1; 205 j1_series(jfile)=str2num(rr.i1); 206 end 207 end 208 [j1_series,i1_series]=meshgrid(j1_series,i1_series); 209 % i1_series=reshape(i1_series,1,[]); 210 % j1_series=reshape(j1_series,1,[]); 175 % if strcmp(NomType,'level') 176 % star_string=[RootFile '*' FileExt]; 177 % detect_string=['^' RootFile '(?<i1>\d+)' FileExt '$'];%string used in regexp to detect file indices 178 % wd=pwd;%current working directory 179 % cd (FilePath)% move to the local dir to save time in the operation dir. 180 % dirpair=dir(star_string);% look for relevant files in the file directory 181 % cd(wd)% back to the working directory 182 % nbpair=numel(dirpair); 183 % i1_series=zeros(1,nbpair); 184 % if nbpair==0% no detected file 185 % RootFile=''; 186 % end 187 % % scan the list of relevant files, extract the indices 188 % for ifile=1:nbpair 189 % rr=regexp(dirpair(ifile).name,detect_string,'names'); 190 % if ~isempty(rr) 191 % i1_series(ifile)=str2num(rr.i1); 192 % end 193 % end 194 % % look for the list of subfolders level# 195 % cd (RootPath)% move to the local dir to save time in the operation dir. 196 % dirpair=dir('level*');% look for relevant subfolders named with leve# 197 % cd(wd) 198 % [RootPath,SubDir]=fileparts(RootPath); 199 % nbpair=numel(dirpair); 200 % jfile=0; 201 % for ifile=1:nbpair 202 % rr=regexp(dirpair(ifile).name,'^level(?<i1>\d+)$','names'); 203 % if ~isempty(rr) 204 % jfile=jfile+1; 205 % j1_series(jfile)=str2num(rr.i1); 206 % end 207 % end 208 % [j1_series,i1_series]=meshgrid(j1_series,i1_series); 209 % else 210 detect_string=['^' RootFile sep1 i1_str i2_str sep2 j1_str j2_str FileExt '$'];%string used in regexp to detect file indices 211 %find the string used to extract the relevant files with the command dir 212 star_string=[RootFile sep1 i1_star i2_star sep2 j1_star j2_star FileExt]; 213 wd=pwd;%current working directory 214 cd (FilePath)% move to the local dir to save time in the operation dir. 215 dirpair=dir(star_string);% look for relevant files in the file directory 216 cd(wd) 217 nbpair=numel(dirpair); 218 ref_i_list=zeros(1,nbpair); 219 ref_j_list=zeros(1,nbpair); 220 if nbpair==0% no detected file 221 RootFile=''; 222 end 223 % scan the list of relevant files, extract the indices 224 for ifile=1:nbpair 225 rr=regexp(dirpair(ifile).name,detect_string,'names'); 226 if ~isempty(rr) 227 i1=str2num(rr.i1); 228 i2=str2num(regexprep(rr.i2,'^-','')); 229 j1=stra2num(regexprep(rr.j1,'^_','')); 230 j2=stra2num(regexprep(rr.j2,'^-','')); 231 ref_i=i1; 232 if isempty(i2_input) 233 if ~isempty(i2)% invalid file name if i2 does not exist in the input file 234 break 235 end 236 else 237 ref_i=floor((i1+i2)/2); 238 end 239 ref_j=1; 240 if isempty(j1_input) 241 if ~isempty(j1)% invalid file name if j1 does not exist in the input file 242 break 243 end 244 else %j1_input is not empty 245 if isempty(j1)% the detected name does not fit with the input 246 break 247 else 248 ref_j=j1; 249 if isempty(j2_input) 250 if ~isempty(j2)% invalid file name if j2 does not exist in the input file 251 break 252 end 253 else 254 ref_j=floor((j1+j2)/2); 255 end 256 end 257 end 258 % update the detected index series 259 if ~isempty(ref_i)&&~isempty(ref_j) 260 ref_i_list(ifile)=ref_i; 261 ref_j_list(ifile)=ref_j; 262 nb_pairs=0; 263 if ~isempty(i2_input)|| ~isempty(j2_input) %deals with pairs 264 if size(i1_series,1)>=ref_i+1 && size(i1_series,2)>=ref_j+1 265 nb_pairs=numel(find(i1_series(ref_i+1,ref_j+1,:)~=0)); 266 end 267 end 268 if i1==0 269 i1=-1;% set index 0 to -1 to distinguish from the absent index (set to 0) 270 end 271 if j1==0 272 j1=-1;% set index 0 to -1 to distinguish from the absent index (set to 0) 273 end 274 i1_series(ref_i+1,ref_j+1,nb_pairs+1)=i1; 275 if ~isempty(i2_input) 276 i2_series(ref_i+1,ref_j+1,nb_pairs+1)=i2; 277 end 278 if ~isempty(j1_input) 279 j1_series(ref_i+1,ref_j+1,nb_pairs+1)=j1; 280 end 281 if ~isempty(j2_input) 282 j1_series(ref_i+1,ref_j+1,nb_pairs+1)=j1; 283 j2_series(ref_i+1,ref_j+1,nb_pairs+1)=j2; 284 end 285 end 286 end 287 end 288 % look for the numerical string of the first files to update the NomType (take into account the 0 before the number) 289 max_j=max(ref_j_list); 290 if isempty(max_j) 291 ref_ij=ref_i_list; 211 292 else 212 detect_string=['^' RootFile sep1 i1_str i2_str sep2 j1_str j2_str FileExt '$'];%string used in regexp to detect file indices 213 %find the string used to extract the relevant files with the command dir 214 star_string=[RootFile sep1 i1_star i2_star sep2 j1_star j2_star FileExt]; 215 wd=pwd;%current working directory 216 cd (FilePath)% move to the local dir to save time in the operation dir. 217 dirpair=dir(star_string);% look for relevant files in the file directory 218 cd(wd) 219 nbpair=numel(dirpair); 220 ref_i_list=zeros(1,nbpair); 221 ref_j_list=zeros(1,nbpair); 222 if nbpair==0% no detected file 223 RootFile=''; 224 end 225 % scan the list of relevant files, extract the indices 226 for ifile=1:nbpair 227 rr=regexp(dirpair(ifile).name,detect_string,'names'); 228 if ~isempty(rr) 229 i1=str2num(rr.i1); 230 i2=str2num(regexprep(rr.i2,'^-','')); 231 j1=stra2num(regexprep(rr.j1,'^_','')); 232 j2=stra2num(regexprep(rr.j2,'^-','')); 233 ref_i=i1; 234 if isempty(i2_input) 235 if ~isempty(i2)% invalid file name if i2 does not exist in the input file 236 break 237 end 238 else 239 ref_i=floor((i1+i2)/2); 240 end 241 ref_j=1; 242 if isempty(j1_input) 243 if ~isempty(j1)% invalid file name if j1 does not exist in the input file 244 break 245 end 246 else %j1_input is not empty 247 if isempty(j1)% the detected name does not fit with the input 248 break 249 else 250 ref_j=j1; 251 if isempty(j2_input) 252 if ~isempty(j2)% invalid file name if j2 does not exist in the input file 253 break 254 end 255 else 256 ref_j=floor((j1+j2)/2); 257 end 258 end 259 end 260 % update the detected index series 261 if ~isempty(ref_i)&&~isempty(ref_j) 262 ref_i_list(ifile)=ref_i; 263 ref_j_list(ifile)=ref_j; 264 nb_pairs=0; 265 if ~isempty(i2_input)|| ~isempty(j2_input) %deals with pairs 266 if size(i1_series,1)>=ref_i+1 && size(i1_series,2)>=ref_j+1 267 nb_pairs=numel(find(i1_series(ref_i+1,ref_j+1,:)~=0)); 268 end 269 end 270 if i1==0 271 i1=-1;% set index 0 to -1 to distinguish from the absent index (set to 0) 272 end 273 if j1==0 274 j1=-1;% set index 0 to -1 to distinguish from the absent index (set to 0) 275 end 276 i1_series(ref_i+1,ref_j+1,nb_pairs+1)=i1; 277 if ~isempty(i2_input) 278 i2_series(ref_i+1,ref_j+1,nb_pairs+1)=i2; 279 end 280 if ~isempty(j1_input) 281 j1_series(ref_i+1,ref_j+1,nb_pairs+1)=j1; 282 end 283 if ~isempty(j2_input) 284 j1_series(ref_i+1,ref_j+1,nb_pairs+1)=j1; 285 j2_series(ref_i+1,ref_j+1,nb_pairs+1)=j2; 286 end 287 end 288 end 289 end 290 % look for the numerical string of the first files to update the NomType (take into account the 0 before the number) 291 max_j=max(ref_j_list); 292 if isempty(max_j) 293 ref_ij=ref_i_list; 294 else 295 ref_ij=ref_i_list*max_j+ref_j_list; % ordered by index i, then by j for a given i. 296 end 297 ind_select=find(ref_ij>0); 298 299 if ~isempty(ind_select) 300 [tild,ifile_min]=min(ref_ij(ind_select)); 301 [tild,tild,tild,tild,tild,tild,tild,tild,NomType]=fileparts_uvmat(dirpair(ind_select(ifile_min)).name);% update the representation of indices (number of 0 before the number) 302 NomType=regexprep(NomType,['^' NomTypePref],''); 303 %% update the file type if the input file does not exist (pb of 0001) 304 if isempty(FileInfo.FileType) 305 [FileInfo,MovieObject]=get_file_info(fullfile(FilePath,dirpair(ifile_min).name)); 306 end 307 end 308 end 309 end 310 311 %% set to empty array the irrelevant index series 312 if isequal(i1_series,0), i1_series=[]; end 313 if isequal(i2_series,0), i2_series=[]; end 314 if isequal(j1_series,0), j1_series=[]; end 315 if isequal(j2_series,0), j2_series=[]; end 293 ref_ij=ref_i_list*max_j+ref_j_list; % ordered by index i, then by j for a given i. 294 end 295 ind_select=find(ref_ij>0); 296 297 if ~isempty(ind_select) 298 [tild,ifile_min]=min(ref_ij(ind_select)); 299 [tild,tild,tild,tild,tild,tild,tild,tild,NomType]=fileparts_uvmat(dirpair(ind_select(ifile_min)).name);% update the representation of indices (number of 0 before the number) 300 NomType=regexprep(NomType,['^' NomTypePref],''); 301 %% update the file type if the input file does not exist (pb of 0001) 302 if isempty(FileInfo.FileType) 303 [FileInfo,MovieObject]=get_file_info(fullfile(FilePath,dirpair(ifile_min).name)); 304 end 305 end 306 % end 307 end 308 309 %% set to empty array the irrelevant index series 310 if isequal(i1_series,0), i1_series=[]; end 311 if isequal(i2_series,0), i2_series=[]; end 312 if isequal(j1_series,0), j1_series=[]; end 313 if isequal(j2_series,0), j2_series=[]; end 314 315 %% case of isolated input file, not member of an indexed series 316 if isempty(i1_series) 317 [PathDir,RootFile]=fileparts(fullfileinput); 318 [RootPath,SubDir,DirExt]=fileparts(PathDir); 319 SubDir=[SubDir DirExt];% include part after . in the name (considered as a file extension) 320 NomType='*'; 321 i2_series=[];j1_series=[];j2_series=[]; 322 % i1_input=1;i2_input=[];j1_input=[];j2_input=[]; 323 if ~exist(fullfileinput,'file') 324 RootFile=''; 325 return 326 end 327 end 316 328 end 317 329 % %% detect rdvision format … … 332 344 else % if there is a file index, j denotes the frame index while i denotes the file index 333 345 if ~isempty(regexp(NomType,'ab$', 'once'))% recognized as a pair 334 RootFile=fullfile_uvmat('','',RootFile,'',NomType,i1_input,i2_input,j1_input,j2_input);% restitute the root name without the detected indices 346 RootFile=fullfile_uvmat('','',RootFile,'',NomType,i1_input,i2_input,j1_input,j2_input);% restitute the root name without the detected indices 335 347 i1_series=zeros(FileInfo.NumberOfFrames+1,2);% first column =0 336 348 i1_series(:,2)=(0:FileInfo.NumberOfFrames)'; % second column=frame index -1 … … 388 400 end 389 401 end 390 i1_series=permute(i1_series,[3 2 1]);% permute dimensions 402 i1_series=permute(i1_series,[3 2 1]);% permute dimensions 391 403 i2_series=permute(i2_series,[3 2 1]);% permute dimensions 392 j1_series=permute(j1_series,[3 2 1]);% permute dimensions 404 j1_series=permute(j1_series,[3 2 1]);% permute dimensions 393 405 j2_series=permute(j2_series,[3 2 1]);% permute dimensions -
trunk/src/geometry_calib.m
r1008 r1009 220 220 221 221 %% Apply calibration 222 [GeometryCalib,index, Z_plane]=calibrate(Coord,CalibFcn,Intrinsic);% apply calibration222 [GeometryCalib,index,ind_removed,Z_plane]=calibrate(Coord,CalibFcn,Intrinsic);% apply calibration 223 223 224 224 %% record the coordinate unit … … 238 238 answer=msgbox_uvmat('INPUT_Y-N',{'store calibration data';... 239 239 ['Error rms (along x,y)=' num2str(GeometryCalib.ErrorRms) ' pixels'];... 240 ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']}); 240 ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']; 241 [num2str(numel(ind_removed)) ' points removed']}); 241 242 if strcmp(answer,'Yes') %store the calibration data 242 243 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration … … 334 335 335 336 %% Apply calibration 336 [GeometryCalib,index, Z_plane]=calibrate(Coord,CalibFcn,Intrinsic);% apply calibration337 [GeometryCalib,index,ind_removed,Z_plane]=calibrate(Coord,CalibFcn,Intrinsic);% apply calibration 337 338 338 339 … … 353 354 answer=msgbox_uvmat('INPUT_Y-N',{'store calibration data';... 354 355 ['Error rms (along x,y)=' num2str(GeometryCalib.ErrorRms) ' pixels'];... 355 ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']}); 356 ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels'];... 357 [num2str(numel(ind_removed)) ' points removed']}); 356 358 if strcmp(answer,'Yes') %store the calibration data 357 359 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration … … 395 397 %------------------------------------------------------------------------ 396 398 % --- activate calibration and store parameters in ouputfile . 397 function [GeometryCalib,ind ex,Z_plane]=calibrate(Coord,CalibFcn,Intrinsic)399 function [GeometryCalib,ind_max,ind_removed,Z_plane]=calibrate(Coord,CalibFcn,Intrinsic) 398 400 %------------------------------------------------------------------------ 399 401 400 402 index=[]; 401 403 GeometryCalib=[]; 402 404 % apply the calibration, whose type is selected in handles.calib_type 403 405 if ~isempty(Coord) 404 406 GeometryCalib=feval(CalibFcn,Coord,Intrinsic); 405 407 else 406 GeometryCalib=[];407 408 msgbox_uvmat('ERROR','No calibration points, abort') 408 409 end … … 411 412 end 412 413 Z_plane=[]; 413 if ~isempty(Coord) 414 %check error 414 415 % estimate calibration error rms and max 416 X=Coord(:,1); 417 Y=Coord(:,2); 418 Z=Coord(:,3); 419 x_ima=Coord(:,4); 420 y_ima=Coord(:,5); 421 [Xpoints,Ypoints]=px_XYZ(GeometryCalib,X,Y,Z); 422 GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima))); 423 GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima))); 424 [ErrorMax(1),index(1)]=max(abs(Xpoints-x_ima)); 425 [ErrorMax(2),index(2)]=max(abs(Ypoints-y_ima)); 426 [tild,ind_dim]=max(ErrorMax); 427 ind_max=index(ind_dim); % mark the index with maximum deviation 428 429 % detect bad calibration points, marked by indices ind_bad, if the 430 % difference of actual image coordinates and those given by calibration is 431 % greater than 2 pixels and greater than 4 rms. 432 check_x=abs(Xpoints-x_ima)>max(2,3*GeometryCalib.ErrorRms(1)); 433 check_y=abs(Ypoints-y_ima)>max(2,3*GeometryCalib.ErrorRms(2)); 434 ind_removed=find(check_x | check_y) 435 % repeat calibration without the excluded points: 436 if ~isempty(ind_removed) 437 Coord(ind_removed,:)=[]; 438 GeometryCalib=feval(CalibFcn,Coord,Intrinsic); 415 439 X=Coord(:,1); 416 440 Y=Coord(:,2); … … 420 444 [Xpoints,Ypoints]=px_XYZ(GeometryCalib,X,Y,Z); 421 445 GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima))); 422 [GeometryCalib.ErrorMax(1),index(1)]=max(abs(Xpoints-x_ima));423 446 GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima))); 424 [GeometryCalib.ErrorMax(2),index(2)]=max(abs(Ypoints-y_ima)); 425 [tild,ind_dim]=max(GeometryCalib.ErrorMax); 426 index=index(ind_dim); 427 %set the Z position of the reference plane used for calibration 428 if isequal(max(Z),min(Z))%Z constant 429 Z_plane=Z(1); 430 GeometryCalib.NbSlice=1; 431 GeometryCalib.SliceCoord=[0 0 Z_plane]; 432 end 447 end 448 GeometryCalib.ErrorMax=ErrorMax; 449 %set the Z position of the reference plane used for calibration 450 if isequal(max(Z),min(Z))%Z constant 451 Z_plane=Z(1); 452 GeometryCalib.NbSlice=1; 453 GeometryCalib.SliceCoord=[0 0 Z_plane]; 433 454 end 434 455 -
trunk/src/get_field.m
r977 r1009 15 15 % INPUT: 16 16 % FileName: name (including path) of the netcdf file to open 17 % ParmIn: structure containing parameters for preselecting menus: 18 % .Title: set the title of the GUI get_field 19 % .SwitchVarIndexTime='file index','variable' or 'matrix index': select the default option for 'time' 20 % .TimeAttrName: preselect the name of a global attribute for time 21 % .SeriesInput=1 if get_field is called by the GUI series,=0 otherwise (plot options provided in the latter case) 22 % .Coord_x,.Coord_y,.Coord_z, names of the variables used as the three coordinates 23 % .scalar : set the default choise of the scale variable 24 % .vector_x, .vector_y : set the default choise for the variables used for the x and y vector components 17 25 18 26 %======================================================================= … … 85 93 end 86 94 if ~exist('ParamIn','var') 87 ParamIn =[];95 ParamIn.Coord_z=''; 88 96 end 89 97 … … 151 159 time_index=find(~cellfun('isempty',regexp(Field.Display.ListGlobalAttribute,'Time')),1);% look for global attribute containing name 'Time' 152 160 end 153 if ~isempty(time_index) 161 if isempty(time_index) 162 set(handles.SwitchVarIndexTime,'Value',1); 163 else 154 164 set(handles.SwitchVarIndexTime,'Value',2); 155 165 set(handles.TimeName,'UserData',time_index) 156 else157 set(handles.SwitchVarIndexTime,'Value',1);158 166 end 159 167 set(handles.SwitchVarIndexTime,'String',ListSwitchVarIndexTime) … … 230 238 CoordIndex=CellInfo{imax}.CoordIndex; 231 239 if numel(CoordIndex)==2 240 if isfield(ParamIn,'Coord_x')&& isfield(ParamIn,'Coord_y') 241 YName=ParamIn.Coord_y; 242 XName=ParamIn.Coord_x; 243 else 232 244 YName=Field.ListVarName{CoordIndex(1)}; 233 245 XName=Field.ListVarName{CoordIndex(2)}; 246 end 234 247 ListCoord=get(handles.Coord_x,'String'); 235 248 XIndex=find(strcmp(XName,ListCoord)); … … 259 272 260 273 %% set z coordinate menu if relevant 261 if Field.MaxDim>=3 && prod(Field.DimValue)<10^8 ; % 3D field (with memory content smaller than 400 Mo)274 if Field.MaxDim>=3 && prod(Field.DimValue)<10^8 && ~isempty(ParamIn.Coord_z); % 3D field (with memory content smaller than 400 Mo) 262 275 set(handles.Check3D,'Value',1) 263 276 else -
trunk/src/get_file_info.m
r1007 r1009 6 6 % FileInfo: structure containing info on the file (case of images or video), in particular 7 7 % .FileType: type of file, needed as input of read_field.m 8 % .FileIndexing='on' for data files (when series of indexed files are expected) 8 9 % .Height: image height in pixels 9 10 % .Width: image width in pixels -
trunk/src/mouse_motion.m
r977 r1009 129 129 if isfield(FigData,tagaxes) 130 130 Field=FigData.(tagaxes); % the current field is sought as substructure of FigData with key tagaxes 131 131 132 if isfield(Field,'ListVarName') 132 133 [CellInfo,NbDimArray]=find_field_cells(Field);%analyse the physical fields contained in Field -
trunk/src/proj_field.m
r1002 r1009 730 730 if strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_x'); 731 731 ivar_U=nbvar+ivar; 732 elseif strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_y'); TriScatteredInterp732 elseif strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_y'); 733 733 ivar_V=nbvar+ivar; 734 734 end … … 738 738 elseif isequal(ProjMode,'interp_lin') %filtering %linear interpolation: 739 739 if ~check_abscissa 740 XName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)}; 741 ProjData.ListVarName=[ProjData.ListVarName {XName}];TriScatteredInterp 740 %XName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)}; 741 XName='X'; 742 ProjData.ListVarName=[ProjData.ListVarName {XName}]; 742 743 ProjData.VarDimName=[ProjData.VarDimName {XName}]; 743 744 nbvar=numel(ProjData.ListVarName); -
trunk/src/series.m
r1008 r1009 642 642 RootFile=''; 643 643 else %scan the input folder 644 InputTable{iview,3}(1)=[]; 644 645 [RootPath,~,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=... 645 646 find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]); -
trunk/src/series/stereo_civ.m
r985 r1009 453 453 Data.Civ1_FF(ind_good)=FFres; 454 454 Data.CivStage=3; 455 456 457 458 459 % 460 % % get z from u and v (displacements) 461 % 462 % tempXmid=Rangx(1)+(Rangx(2)-Rangx(1))*(Data.Civ1_X-0.5)/(Npx-1);%temporary coordinate (velocity taken at the point middle from imgae 1 and 2) 463 % tempYmid=Rangy(1)+(Rangy(2)-Rangy(1))*(Data.Civ1_Y-0.5)/(Npy-1);%temporary coordinate (velocity taken at the point middle from imgae 1 and 2) 464 % tempUphys=Data.Civ1_U_smooth*(Rangx(2)-Rangx(1))/(Npx-1); 465 % tempVphys=Data.Civ1_V_smooth*(Rangy(2)-Rangy(1))/(Npy-1); 466 % [tempZphys,tempXphys,tempYphys,tempCiv3_E]=shift2z(tempXmid,tempYmid,tempUphys,tempVphys,XmlData); %Data.Xphys and Data.Xphys are real coordinate (geometric correction more accurate than xtemp/ytemp) 467 % temp=find(Data.Civ1_FF~=0); 468 % tempXmid(temp)=[]; 469 % tempYmid(temp)=[]; 470 % tempZphys(temp)=[]; 471 % 455 472 456 end 473 457 … … 651 635 par_civ3.ImageA=par_civ1.ImageA; 652 636 par_civ3.ImageB=par_civ1.ImageB; 653 % if ~isfield(Param.Civ1,'ImageA')654 % i1=i1_series_Civ3(ifield);655 % i2=i1;656 % if ~isempty(i2_series_Civ3)657 % i2=i2_series_Civ3(ifield);658 % end659 % j1=1;660 % if ~isempty(j1_series_Civ3)661 % j1=j1_series_Civ3(ifield);662 % end663 % j2=j1;664 % if ~isempty(j2_series_Civ3)665 % j2=j2_series_Civ3(ifield);666 % end667 637 par_civ3.ImageWidth=size(par_civ3.ImageA,2); 668 638 par_civ3.ImageHeight=size(par_civ3.ImageA,1); … … 844 814 % else 845 815 % store only phys data 846 Data_light.ListVarName={'Xphys','Yphys','Zphys','Civ3_C','Xmid','Ymid','Uphys','Vphys','Error'}; 847 Data_light.VarDimName={'nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3'}; 848 temp=find(Data.Civ3_FF==0); 849 Data_light.Zphys=Data.Zphys(temp); 850 Data_light.Yphys=Data.Yphys(temp); 851 Data_light.Xphys=Data.Xphys(temp); 852 Data_light.Civ3_C=Data.Civ3_C(temp); 853 Data_light.Xmid=Data.Xmid(temp); 854 Data_light.Ymid=Data.Ymid(temp); 855 Data_light.Uphys=Data.Uphys(temp); 856 Data_light.Vphys=Data.Vphys(temp); 857 Data_light.Error=Data.Error(temp); 816 % Data_light.ListVarName={'Xphys','Yphys','Zphys','Civ3_C','Xmid','Ymid','Uphys','Vphys','Error'}; 817 % Data_light.VarDimName={'nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3'}; 818 Data_light.ListVarName={'Xphys','Yphys','Zphys','Civ3_C','DX','DY','Error'}; 819 Data_light.VarDimName={'nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3','nb_vec_3'}; 820 Data_light.VarAttribute{1}.Role='coord_x'; 821 Data_light.VarAttribute{2}.Role='coord_y'; 822 Data_light.VarAttribute{3}.Role='scalar'; 823 Data_light.VarAttribute{5}.Role='vector_x'; 824 Data_light.VarAttribute{6}.Role='vector_y'; 825 ind_good=find(Data.Civ3_FF==0); 826 Data_light.Zphys=Data.Zphys(ind_good); 827 Data_light.Yphys=Data.Yphys(ind_good); 828 Data_light.Xphys=Data.Xphys(ind_good); 829 Data_light.Civ3_C=Data.Civ3_C(ind_good); 830 % Data_light.Xmid=Data.Xmid(ind_good); 831 % Data_light.Ymid=Data.Ymid(ind_good); 832 Data_light.DX=Data.Uphys(ind_good); 833 Data_light.DY=Data.Vphys(ind_good); 834 Data_light.Error=Data.Error(ind_good); 858 835 if exist('ncfile2','var') 859 836 errormsg=struct2nc(ncfile2,Data_light); -
trunk/src/uvmat.m
r1002 r1009 1748 1748 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]); 1749 1749 errormsg=''; 1750 if isempty( i1_series)1750 if isempty(RootFile) 1751 1751 fileinput=uigetfile_uvmat('pick an input file',fullfile(RootPath,SubDir)); 1752 1752 hh=dir(fileinput); … … 3819 3819 end 3820 3820 3821 %% introduce default projection objects in 3D 3822 for imap=1:numel(IndexObj) 3823 iobj=IndexObj(imap); 3824 if numel(UvData.ProjObject)<iobj 3825 break 3826 end 3827 if UvData.Field.NbDim==3 3828 UvData.ProjObject{iobj}.NbDim=3;%test for 3D objects 3829 if ~isfield(UvData.ProjObject{iobj},'RangeZ') 3830 UvData.ProjObject{iobj}.RangeZ=UvData.Field.CoordMesh;%main plotting plane 3831 end 3832 if iobj==1 && ~(isfield(UvData.ProjObject{iobj},'Coord') && size(UvData.ProjObject{iobj}.Coord,2)>=3 && UvData.ProjObject{iobj}.Coord(1,3)<UvData.Field.ZMax && UvData.ProjObject{iobj}.Coord(1,3)>UvData.Field.ZMin) 3833 UvData.ProjObject{iobj}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen 3834 end 3835 end 3836 end 3837 3838 set(handles.uvmat,'UserData',UvData) 3839 3821 3840 %% loop on the projection objects: one or two 3822 3841 for imap=1:numel(IndexObj) … … 3824 3843 if numel(UvData.ProjObject)<iobj 3825 3844 break 3826 end3827 if UvData.Field.NbDim==33828 UvData.ProjObject{iobj}.NbDim=3;%test for 3D objects3829 if ~isfield(UvData.ProjObject{iobj},'RangeZ')3830 UvData.ProjObject{iobj}.RangeZ=UvData.Field.CoordMesh;%main plotting plane3831 end3832 if iobj==1 && ~(isfield(UvData.ProjObject{iobj},'Coord') && size(UvData.ProjObject{iobj}.Coord,2)>=3 && UvData.ProjObject{iobj}.Coord(1,3)<UvData.Field.ZMax && UvData.ProjObject{iobj}.Coord(1,3)>UvData.Field.ZMin)3833 UvData.ProjObject{iobj}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen3834 end3835 3845 end 3836 3846 [ObjectData,errormsg]=proj_field(UvData.Field,UvData.ProjObject{iobj});% project field on the object … … 3872 3882 ObjectData.A=feval(AClass,ObjectData.A); 3873 3883 end 3874 set(handles.uvmat,'UserData',UvData) 3884 3875 3885 if ~isempty(ObjectData) 3876 3886 if imap==2 && isempty(view_field_handle) … … 4362 4372 ParamIn.vec_color='Civ2_C'; 4363 4373 end 4374 else 4375 ParamIn.TimeAttrName=get(handles.TimeName,'String'); 4376 ParamIn.Coord_x=get(handles.Coord_x,'String'); 4377 ParamIn.Coord_y=get(handles.Coord_y,'String'); 4378 ParamIn.Coord_z=get(handles.Coord_z,'String'); 4364 4379 end 4365 4380 -
trunk/src/view_field.m
r977 r1009 336 336 FigName=get(ListFig(ilist),'name'); 337 337 if isempty(FigName) 338 FigName=['figure ' num2str(ListFig(ilist) )];338 FigName=['figure ' num2str(ListFig(ilist).Number)]; 339 339 end 340 340 if ~strcmp(FigName,'uvmat')
Note: See TracChangeset
for help on using the changeset viewer.