- Timestamp:
- Mar 16, 2010, 7:41:52 AM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r45 r54 114 114 if isunix 115 115 syst='LINUX'; 116 xmlfile=fullfile(path_UVMAT,'PARAM_LINUX.xml');117 if exist(xmlfile,'file')118 try119 t=xmltree(xmlfile);120 sparam=convert(t);121 catch122 errormsg={[' Problem for reading ' xmlfile]; lasterr};123 end124 else125 erromsg=[xmlfile ' not found: path to civx binaries undefined'];126 end127 116 else 128 117 syst='WIN'; 129 xmlfile=fullfile(path_UVMAT,'PARAM_WIN.xml'); 130 if exist(xmlfile,'file') 131 try 132 t=xmltree(xmlfile);133 sparam=convert(t);134 catch135 errormsg={[' Problem for reading ' xmlfile]; lasterr};136 end137 e lse138 erromsg=[xmlfile ' not found: path to civx binaries undefined']; 139 e nd118 end 119 xmlfile=fullfile(path_UVMAT,'PARAM.xml'); 120 if exist(xmlfile,'file') 121 try 122 t=xmltree(xmlfile); 123 sparam=convert(t); 124 catch 125 errormsg={[' Problem for reading ' xmlfile]; lasterr}; 126 end 127 else 128 errormsg=[xmlfile ' not found: path to civx binaries undefined']; 140 129 end 141 130 display(syst) … … 160 149 if ~sge 161 150 if isequal(todo_path,'') || isequal(todo_path,[]) 162 display(['no batch distributed processing available:file path TODO.txt not defined in UVMAT/PARAM _' syst])151 display(['no batch distributed processing available:file path TODO.txt not defined in UVMAT/PARAM.xml']) 163 152 test_batch=0; 164 153 end … … 327 316 end 328 317 end 329 [RootPath,RootFile,str1,str2,str_a,str_b,ext,nom_type,subdir]=name2display(fileinput) 318 [RootPath,RootFile,str1,str2,str_a,str_b,ext,nom_type,subdir]=name2display(fileinput); 330 319 filebase=fullfile(RootPath,RootFile); 331 if isequal(nom_type,'*')% all fields in a single file ( movie files) 332 num_i1=1;num_i2=1;num_j1=1;num_j2=1; 333 else 334 num_i1=str2double(str1); 335 num_i2=str2double(str2); 336 num_j1=str2double(str_a); 337 num_j2=str2double(str_b); 338 end 320 % if isequal(nom_type,'*')% all fields in a single file ( movie files) 321 % num_i1=1;num_i2=1;num_j1=1;num_j2=1; 322 % else 323 num_i1=stra2num(str1); 324 if isempty(num_i1),num_i1=1;end 325 num_i2=stra2num(str2); 326 if isempty(num_i2),num_i2=1;end 327 num_j1=stra2num(str_a); 328 if isempty(num_j1),num_j1=1;end 329 num_j2=stra2num(str_b); 330 if isempty(num_j2),num_j2=1;end 339 331 if isequal(get(handles.compare,'Value'),1) 340 332 browse=[];%initialisation … … 460 452 461 453 %------------------------------------------------------------------------ 462 % function activated when a new filebase (image series) is introduced454 % --- function activated when a new filebase (image series) is introduced 463 455 function displ_filebase_Callback(hObject, eventdata, handles) 464 456 %------------------------------------------------------------------------ … … 566 558 if isfield(XmlData,'Time') 567 559 time=XmlData.Time; 568 nbfield=size( XmlData.Time,1);569 nburst=size( XmlData.Time,2);560 nbfield=size(time,1); 561 nburst=size(time,2); 570 562 end 571 563 ext_ima_read=[]; … … 835 827 end 836 828 displ_num=[];%default 837 first_i=str2num(get(handles.first_i,'String'));829 ref_i=str2num(get(handles.ref_i,'String')); 838 830 % last_i=str2num(get(handles.last_i,'String')); 839 831 time=get(handles.displ_filebase,'UserData'); %get the set of times … … 857 849 numlist_b(index)=numod_b; 858 850 if ~isempty(time) 859 dt(numod_a,numod_b)=time( first_i,numod_b)-time(first_i,numod_a);%first time interval dt851 dt(numod_a,numod_b)=time(ref_i,numod_b)-time(ref_i,numod_a);%first time interval dt 860 852 displ_dt(index)=dt(numod_a,numod_b); 861 853 else … … 1634 1626 path_uvmat=which('uvmat');% check the path detected for source file uvmat 1635 1627 path_UVMAT=fileparts(path_uvmat); %path to UVMAT 1636 if isunix 1637 %fid = fopen(fullfile(path_UVMAT,'PARAM_LINUX.txt'),'r');%open the file with civ binary names 1638 xmlfile=fullfile(path_UVMAT,'PARAM_LINUX.xml'); 1639 if exist(xmlfile,'file') 1640 t=xmltree(xmlfile); 1641 sparam=convert(t); 1642 end 1643 else 1644 %fid = fopen(fullfile(path_UVMAT,'PARAM_WIN.txt'),'r');%open the file with civ binary names 1645 xmlfile=fullfile(path_UVMAT,'PARAM_WIN.xml'); 1646 if exist(xmlfile,'file') 1647 t=xmltree(xmlfile); 1648 sparam=convert(t); 1649 end 1650 end 1628 %fid = fopen(fullfile(path_UVMAT,'PARAM_LINUX.txt'),'r');%open the file with civ binary names 1629 xmlfile=fullfile(path_UVMAT,'PARAM.xml'); 1630 if exist(xmlfile,'file') 1631 t=xmltree(xmlfile); 1632 sparam=convert(t); 1633 end 1651 1634 if isfield(sparam,'Civ1_exe') 1652 1635 civ1_exe=sparam.Civ1_exe; 1653 if isequal(civ1_exe(1:4),'civx')%the binary is defined in /civx, default setting1636 if ~exist(civ1_exe,'file') 1654 1637 civ1_exe=fullfile(path_UVMAT,civ1_exe); 1655 1638 end … … 1657 1640 if isfield(sparam,'Civ2_exe') 1658 1641 civ2_exe=sparam.Civ2_exe; 1659 if isequal(civ2_exe(1:4),'civx')%the binary is defined in /civx, default setting1642 if ~exist(civ2_exe,'file')%the binary is defined in /bin, default setting 1660 1643 civ2_exe=fullfile(path_UVMAT,civ2_exe); 1661 1644 end … … 1663 1646 if isfield(sparam,'Patch_exe') 1664 1647 patch_exe=sparam.Patch_exe; 1665 if isequal(patch_exe(1:4),'civx')%the binary is defined in /civx, default setting1648 if ~exist(patch_exe,'file')%the binary is defined in /bin, default setting 1666 1649 patch_exe=fullfile(path_UVMAT,patch_exe); 1667 1650 end … … 2118 2101 path_uvmat=which('uvmat');% check the path detected for source file uvmat 2119 2102 path_UVMAT=fileparts(path_uvmat); %path to UVMAT 2120 if isunix 2121 xmlfile=fullfile(path_UVMAT,'PARAM_LINUX.xml'); 2122 if exist(xmlfile,'file') 2123 t=xmltree(xmlfile); 2124 sparam=convert(t); 2125 end 2126 else 2127 xmlfile=fullfile(path_UVMAT,'PARAM_WIN.xml'); 2128 if exist(xmlfile,'file') 2129 t=xmltree(xmlfile); 2130 sparam=convert(t); 2131 end 2132 end 2103 xmlfile=fullfile(path_UVMAT,'PARAM.xml'); 2104 if exist(xmlfile,'file') 2105 t=xmltree(xmlfile); 2106 sparam=convert(t); 2107 end 2108 % else 2109 % xmlfile=fullfile(path_UVMAT,'PARAM_WIN.xml'); 2110 % if exist(xmlfile,'file') 2111 % t=xmltree(xmlfile); 2112 % sparam=convert(t); 2113 % end 2114 % end 2133 2115 sge=0; 2134 2116 if isfield(sparam,'Civ_exe') … … 2350 2332 time=get(handles.displ_filebase,'UserData'); %get the set of times 2351 2333 civAll=get(handles.Experimental,'Value'); % Boolean for new civ excution method 2352 'TESTbatch'2353 size(filecell.nc.civ1)2354 nbslice2355 nbfield2356 2334 for ifile=1:nbfield 2357 2335 for j=1:nbslice … … 2409 2387 end 2410 2388 2411 %TESTgrid2412 2389 test_grid=get(handles.browse_gridciv1,'Value'); 2413 2390 if test_grid … … 2432 2409 par_civ1.gridflag='n'; 2433 2410 end 2434 %endTESTgrid 2435 2411 % 2436 2412 i_cmd=i_cmd+1; 2437 2413 if isequal(civAll,0) -
trunk/src/editxml.m
r42 r54 332 332 path_uvmat=which('editxml');% check the path detected for source file uvmat 333 333 path_UVMAT=fileparts(path_uvmat); %path to UVMAT 334 if isunix 335 xmlparam=fullfile(path_UVMAT,'PARAM_LINUX.xml') 336 if exist(xmlparam,'file') 337 tparam=xmltree(xmlparam); 338 sparam=convert(tparam); 339 if isfield(sparam,'SchemaPath') 340 schemapath=[fullfile(sparam.SchemaPath,head_name) '.xsd'] 341 end 342 end 334 % if isunix 335 xmlparam=fullfile(path_UVMAT,'PARAM.xml'); 336 if exist(xmlparam,'file') 337 tparam=xmltree(xmlparam); 338 sparam=convert(tparam); 339 if isfield(sparam,'SchemaPath') 340 schemapath=[fullfile(sparam.SchemaPath,head_name) '.xsd'] 341 end 342 if exist(fullfile(path_UVMAT,schemapath) 343 schemapath=fullfile(path_UVMAT,schemapath);%look for relative path definition 344 end 345 schemapath=fullfile(path_UVMAT,schemapath); 343 346 % schemapath=['/coriolis/papillon/data/civbin/XML_SCHEMAS/' head_name '.xsd']%current dir for schema 344 else345 xmlparam=fullfile(path_UVMAT,'PARAM_WIN.xml')346 if exist(xmlparam,'file')347 tparam=xmltree(xmlparam);348 sparam=convert(tparam)349 if isfield(sparam,'SchemaPath')350 schemapath=[fullfile(sparam.SchemaPath,head_name) '.xsd']351 end352 end347 % else 348 % xmlparam=fullfile(path_UVMAT,'PARAM_WIN.xml') 349 % if exist(xmlparam,'file') 350 % tparam=xmltree(xmlparam); 351 % sparam=convert(tparam) 352 % if isfield(sparam,'SchemaPath') 353 % schemapath=[fullfile(sparam.SchemaPath,head_name) '.xsd'] 354 % end 355 % end 353 356 % schemapath=['\\Papillon\data\civbin\XML_SCHEMAS\' head_name '.xsd']%current dir for schemas 354 end357 % end 355 358 if exist(schemapath,'file') 356 359 xs=xmltree(schemapath); 357 360 else 358 msgbox_uvmat('ERROR',['The xml schema for ' CurrentFile ' is unknown, check the schema path set in the xml file PARAM'])361 msgbox_uvmat('ERROR',['The xml schema for ' CurrentFile ' is unknown, check the schema path set in the file PARAM.xml']) 359 362 [FileName, PathName]=uigetfile( ... 360 363 {'*.xsd', '(*.xsd)'; -
trunk/src/geometry_calib.m
r42 r54 582 582 path_uvmat=which('uvmat');% check the path detected for source file uvmat 583 583 path_UVMAT=fileparts(path_uvmat); %path to UVMAT 584 if isunix584 % if isunix 585 585 %fid = fopen(fullfile(path_UVMAT,'PARAM_LINUX.txt'),'r');%open the file with civ binary names 586 xmlfile=fullfile(path_UVMAT,'PARAM_LINUX.xml');587 588 589 590 591 else592 %fid = fopen(fullfile(path_UVMAT,'PARAM_WIN.txt'),'r');%open the file with civ binary names593 xmlfile=fullfile(path_UVMAT,'PARAM_WIN.xml');594 if exist(xmlfile,'file')595 t=xmltree(xmlfile);596 sparam=convert(t);597 end598 end586 xmlfile=fullfile(path_UVMAT,'PARAM.xml'); 587 if exist(xmlfile,'file') 588 t=xmltree(xmlfile); 589 sparam=convert(t); 590 end 591 % else 592 % %fid = fopen(fullfile(path_UVMAT,'PARAM_WIN.txt'),'r');%open the file with civ binary names 593 % xmlfile=fullfile(path_UVMAT,'PARAM_WIN.xml'); 594 % if exist(xmlfile,'file') 595 % t=xmltree(xmlfile); 596 % sparam=convert(t); 597 % end 598 % end 599 599 if ~isfield(sparam,'GeometryCalib_exe') 600 600 msgbox_uvmat('ERROR',['calibration program <GeometryCalib_exe> undefined in parameter file ' xmlfile]) … … 602 602 end 603 603 Tsai_exe=sparam.GeometryCalib_exe; 604 if ~exist(Tsai_exe,'file')%the binary is defined in /bin, default setting 605 Tsai_exe=fullfile(path_UVMAT,Tsai_exe); 606 end 604 607 if ~exist(Tsai_exe,'file') 605 msgbox_uvmat('ERROR',['calibration program ' Tsai_exe 'does not exist'])608 msgbox_uvmat('ERROR',['calibration program ' sparam.GeometryCalib_exe ' defined in PARAM.xml does not exist']) 606 609 return 607 610 end -
trunk/src/series/sub_background.m
r38 r54 58 58 %----------------------------------------------------------------- 59 59 if iscell(Series.RootPath) 60 wardlg_uvmat('This function use only one input file series','ERROR') 60 msgbox_uvmat('ERROR','This function use only one input image series') 61 return 62 end 63 64 %determine input image type 65 FileType=[];%default 66 MovieObject=[]; 67 if isequal(lower(FileExt),'.avi') 68 hhh=which('mmreader'); 69 if ~isequal(hhh,'')&& mmreader.isPlatformSupported() 70 MovieObject=mmreader(fullfile(RootPath,[RootFile FileExt])); 71 FileType='movie'; 72 else 73 FileType='avi'; 74 end 75 elseif isequal(lower(FileExt),'.vol') 76 FileType='vol'; 77 else 78 form=imformats(FileExt(2:end)); 79 if ~isempty(form)% if the extension corresponds to an image format recognized by Matlab 80 if isequal(NomType,'*'); 81 FileType='multimage'; 82 else 83 FileType='image'; 84 end 85 end 86 end 87 if isempty(FileType) 88 msgbox_uvmat('ERROR',['invalid file extension ' FileExt ': this function only accepts image or movie input']) 89 return 61 90 end 62 91 … … 206 235 %read the first series of nbaver_ima images and sort by luminosity at each pixel 207 236 for ifield = 1:nbaver_ima 208 ifile=indselect(ifield); 209 [filename,idetect]=... 210 name_generator(filebase,num_i1(ifile),num_j1(ifile),Series.FileExt,Series.NomType); 211 Aread=imread(filename); 212 size(Aread) 213 if size(Aread,3)>1 %(color images) 214 Aread=sum(Aread,3); %sum over color components 215 end 216 Ak(:,:,ifield)=Aread; 237 ifile=indselect(ifield); 238 filename=name_generator(filebase,num_i1(ifile),num_j1(ifile),Series.FileExt,Series.NomType); 239 Aread=read_image(filename,FileType,num_i1(ifile),movieobject); 240 Ak(:,:,ifield)=Aread; 217 241 end 218 242 Asort=sort(Ak,3);%sort the luminosity of images at each point … … 241 265 stopstate=get(hseries.RUN,'BusyAction'); 242 266 if isequal(stopstate,'queue')% enable STOP command 243 % waitbarpos(4)=((ifield+(islice-1)*nbfield_slice)/(nbfield_slice*nbslice_i))*Series.WaitbarPos(4);244 % waitbarpos(2)=Series.WaitbarPos(4)+Series.WaitbarPos(2)-waitbarpos(4);245 % set(hwaitbar,'Position',waitbarpos)246 % drawnow247 267 update_waitbar(hseries.waitbar,WaitbarPos,(ifield+(islice-1)*nbfield_slice)/(nbfield_slice*nbslice_i)) 248 268 (ifield+(islice-1)*nbfield_slice)/(nbfield_slice*nbslice_i) … … 251 271 for iburst=1:step 252 272 ifile=indselect(ifield+step*floor(nbaver/2)+iburst-1); 253 [filename,idetect]=... 254 name_generator(filebase,num_i1(ifile),num_j1(ifile),Series.FileExt,Series.NomType); 255 Aread=imread(filename); 256 if size(Aread,3)>1 %(color images) 257 Aread=sum(Aread,3); %sum over color components 258 end 273 filename=name_generator(filebase,num_i1(ifile),num_j1(ifile),Series.FileExt,Series.NomType); 274 Aread=read_image(filename,FileType,num_i1(ifile),movieobject); 259 275 Ak(:,:,nbaver_ima-step+iburst)=Aread; 260 276 end … … 298 314 299 315 316 %------------------------------------------------------------------------ 317 %--read images and convert them to the uint16 format used for PIV 318 function A=read_image(filename,type_ima,num,movieobject) 319 %------------------------------------------------------------------------ 320 %num is the view number needed for an avi movie 321 switch type_ima 322 case 'movie' 323 A=read(movieobject,num); 324 case 'avi' 325 mov=aviread(filename,num); 326 A=frame2im(mov(1)); 327 case 'multimage' 328 A=imread(filename,num); 329 case 'image' 330 A=imread(filename); 331 end 332 siz=size(A); 333 if length(siz)==3;%color images 334 A=sum(double(A),3); 335 end 300 336 301
Note: See TracChangeset
for help on using the changeset viewer.