- Timestamp:
- Jun 6, 2012, 2:45:37 PM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r440 r441 415 415 set(handles.RootFile,'String',RootFile) 416 416 if strcmp(ExtInput,'.nc') 417 SubDirCiv= SubDir;418 else 419 SubDirCiv= [SubDir '.civ'];417 SubDirCiv=regexprep(SubDir,[SuddirImages '^'],'');%suppress the root SuddirImages; 418 else 419 SubDirCiv= '.civ'; 420 420 end 421 421 set(handles.SubdirCiv1,'String',SubDirCiv) … … 442 442 %% look for an image documentation file 443 443 ext_imadoc='';%default 444 SubDirBase=regexprep(SubDir,'\..*','');%take the root part of SubDir, before the first dot '.' 445 filexml=fullfile(RootPath,[SubDirBase '.xml']);% new convention: xml above the image dir 446 if ~exist(filexml,'file') 447 filexml=fullfile(RootPath,SubDir,[RootFile '.xml']);%old convention: xml within the image directroy 448 end 444 449 RootName=fullfile(RootPath,RootFile); 445 if exist( [RootName '.xml'],'file')450 if exist(filexml,'file') 446 451 ext_imadoc='.xml'; 447 elseif exist([RootName '.civxml'],'file') 448 ext_imadoc='.civxml'; 449 elseif exist([RootName '.civ'],'file') 452 elseif exist(fullfile(RootPath,SubDir,[RootFile '.civ']),'file') 450 453 ext_imadoc='.civ'; 454 fileciv=fullfile(RootPath,SubDir,[RootFile '.civ']); 451 455 elseif exist([RootName '.avi'],'file') 452 456 ext_imadoc='.avi'; … … 465 469 drawnow 466 470 switch ext_imadoc 467 case '.civxml'%OBSOLETE468 [tild,tild,time]=read_civxml([RootName '.civxml']);469 mode='pair j1-j2';470 if isempty(nom_type_ima)% dtermine types by default if not already selected by browser or uvmat471 nom_type_ima='_i_j';472 end473 471 case '.xml' 474 [XmlData,warntext]=imadoc2struct( [RootName '.xml']);472 [XmlData,warntext]=imadoc2struct(filexml); 475 473 ext_ima_read=[]; 476 474 nom_type_read=[]; … … 508 506 end 509 507 case '.civ'% OBSOLETE: case of .civ image documentation file 510 [error,time,TimeUnit,mode,npx,npy]=read_imatext( [RootName '.civ']);511 if error==2, msgbox_uvmat('WARNING',['no file ' RootName '.civ']);508 [error,time,TimeUnit,mode,npx,npy]=read_imatext(fileciv); 509 if error==2, msgbox_uvmat('WARNING',['no file ' fileciv]); 512 510 elseif error==1, msgbox_uvmat('WARNING','inconsistent number of fields in the .civ file'); 513 511 end … … 522 520 hhh=which('videoreader'); 523 521 if isempty(hhh)%use old video function of matlab 524 imainfo=aviinfo([RootName ext_imadoc]);%read infos on the avi movie 522 imainfo=aviinfo([RootName ext_imadoc]);%read infos on the avi movie TO REPLACE mmreader 525 523 dt=1/imainfo.FramesPerSecond;%time interval between successive frames 526 524 MaxIndex_i=imainfo.NumFrames;%number of frames … … 681 679 if get(handles.CheckCiv1,'Value')% if Civ1 is performed 682 680 set(handles.SubdirCiv2,'String',SubDir);% set by default civ2 directory the same as civ1 683 set(handles.ListSubdirCiv2,'Value',ilist)681 % set(handles.ListSubdirCiv2,'Value',ilist) 684 682 else % if Civ1 data already exist 685 683 errormsg=find_netcpair_civ(handles,1); %update the list of available pairs from netcdf files in the new directory … … 1903 1901 end 1904 1902 %check result directory 1905 subdir_civ1=get(handles.SubdirCiv1,'String');%subdirectory subdir_civ1 for the netcdf output data 1906 subdir_civ2=get(handles.SubdirCiv2,'String'); 1907 if isequal(subdir_civ1,''),subdir_civ1='CIV'; end% put default subdir 1903 subdir_civ1=regexprep(get(handles.SubdirCiv1,'String'),'^.','');%subdirectory subdir_civ1 for the netcdf output data 1904 subdir_civ2=regexprep(get(handles.SubdirCiv2,'String'),'^.',''); 1905 if isequal(subdir_civ1,''),subdir_civ1='civ'; end% put default subdir 1906 % subdir_civ1=[ '.' subdir_civ1]; 1907 % subdir_civ2=[ '.' subdir_civ2]; 1908 1908 if isequal(subdir_civ2,''),subdir_civ2=subdir_civ1; end% put default subdir 1909 subdir_civ1=[SubdirImages '.' subdir_civ1]; 1910 subdir_civ2=[SubdirImages '.' subdir_civ2]; 1909 1911 1910 1912 %% choose root names depending on ListCompareMode =displacement, shift, PIV or stereo PIV … … 2098 2100 detect=exist(filename,'file')==2; 2099 2101 if detect% if a netcdf file already exists 2100 indstr=regexp(subdir_civ1_new,'\D'); 2101 if indstr(end)<length(subdir_civ1_new) %subdir_civ1 ends by a number 2102 vers=str2double(subdir_civ1_new(indstr(end)+1:end))+1; 2103 subdir_civ1_new=[subdir_civ1_new(1:indstr(end)) num2str(vers)]; 2104 else 2105 vers=vers+1; 2106 subdir_civ1_new=[subdir_civ1_new(1:indstr(end)) '_' num2str(vers)]; 2102 r=regexp(subdir_civ1_new,'(?<root>.*\D)(?<num1>\d+)$','names');%detect whether name ends by a number 2103 if isempty(r) 2104 r(1).root=[subdir_civ1_new '_']; 2105 r(1).num1='0'; 2107 2106 end 2107 subdir_civ1_new=[r(1).root num2str(str2num(r(1).num1)+1)];%increment the index by 1 or put 1 2108 % indstr=regexp(subdir_civ1_new,'\D'); 2109 % if indstr(end)<length(subdir_civ1_new) %subdir_civ1 ends by a number 2110 % vers=str2double(subdir_civ1_new(indstr(end)+1:end))+1; 2111 % subdir_civ1_new=[subdir_civ1_new(1:indstr(end)) num2str(vers)]; 2112 % else 2113 % vers=vers+1; 2114 % subdir_civ1_new=[subdir_civ1_new(1:indstr(end)) '_' num2str(vers)]; 2115 % end 2108 2116 subdir_civ2=subdir_civ1_new; 2109 2117 break … … 2467 2475 end 2468 2476 end 2469 set(handles.SubdirCiv1,'String', subdir_civ1);%update the edit box2470 set(handles.SubdirCiv2,'String', subdir_civ2);%update the edit box2477 set(handles.SubdirCiv1,'String',regexprep(subdir_civ1,['^' SubdirImages],''));%suppress the root SuddirImages;);%update the edit box 2478 set(handles.SubdirCiv2,'String',regexprep(subdir_civ2,['^' SubdirImages],''));%update the edit box 2471 2479 2472 2480 % For CivX COPY IMAGES TO THE FORMAT .png IF NEEDED … … 3563 3571 end 3564 3572 3565 % ------------------------------------------------------------------------3566 % --- Executes on button press in ListSubdirCiv1.3567 function ListSubdirCiv1_Callback(hObject, eventdata, handles)3568 % ------------------------------------------------------------------------3569 list_subdir_civ1=get(handles.ListSubdirCiv1,'String');3570 val=get(handles.ListSubdirCiv1,'Value');3571 SubDir=list_subdir_civ1{val};3572 if strcmp(SubDir,'new...')3573 if get(handles.CheckCiv1,'Value')3574 SubDir='CIV'; %default subdirectory3575 else3576 msgbox_uvmat('ERROR','select CheckCiv1 to perform a new Civ operation')3577 return3578 end3579 end3580 set(handles.SubdirCiv1,'String',SubDir);3581 errormsg=find_netcpair_civ(handles,1);3582 if ~isempty(errormsg)3583 msgbox_uvmat('ERROR',errormsg)3584 end3585 3586 %------------------------------------------------------------------------ 3587 % --- Executes on button press in ListSubdirCiv2.3588 function ListSubdirCiv2_Callback(hObject, eventdata, handles)3589 % ------------------------------------------------------------------------3590 list_subdir_civ2=get(handles.ListSubdirCiv2,'String');3591 val=get(handles.ListSubdirCiv2,'Value');3592 SubDir=list_subdir_civ2{val};3593 if strcmp(SubDir,'new...')3594 if get(handles.CheckCiv2,'Value')3595 SubDir='CIV'; %default subdirectory3596 else3597 msgbox_uvmat('ERROR','select CheckCiv2 to perform a new Civ operation')3598 return3599 end3600 end3601 set(handles.SubdirCiv2,'String',SubDir);3573 % %------------------------------------------------------------------------ 3574 % % --- Executes on button press in ListSubdirCiv1. 3575 % function ListSubdirCiv1_Callback(hObject, eventdata, handles) 3576 % %------------------------------------------------------------------------ 3577 % list_subdir_civ1=get(handles.ListSubdirCiv1,'String'); 3578 % val=get(handles.ListSubdirCiv1,'Value'); 3579 % SubDir=list_subdir_civ1{val}; 3580 % if strcmp(SubDir,'new...') 3581 % if get(handles.CheckCiv1,'Value') 3582 % SubDir='CIV'; %default subdirectory 3583 % else 3584 % msgbox_uvmat('ERROR','select CheckCiv1 to perform a new Civ operation') 3585 % return 3586 % end 3587 % end 3588 % set(handles.SubdirCiv1,'String',SubDir); 3589 % errormsg=find_netcpair_civ(handles,1); 3590 % if ~isempty(errormsg) 3591 % msgbox_uvmat('ERROR',errormsg) 3592 % end 3593 % 3594 %------------------------------------------------------------------------ 3595 % % --- Executes on button press in ListSubdirCiv2. 3596 % function ListSubdirCiv2_Callback(hObject, eventdata, handles) 3597 % %------------------------------------------------------------------------ 3598 % list_subdir_civ2=get(handles.ListSubdirCiv2,'String'); 3599 % val=get(handles.ListSubdirCiv2,'Value'); 3600 % SubDir=list_subdir_civ2{val}; 3601 % if strcmp(SubDir,'new...') 3602 % if get(handles.CheckCiv2,'Value') 3603 % SubDir='CIV'; %default subdirectory 3604 % else 3605 % msgbox_uvmat('ERROR','select CheckCiv2 to perform a new Civ operation') 3606 % return 3607 % end 3608 % end 3609 % set(handles.SubdirCiv2,'String',SubDir); 3602 3610 3603 3611 %------------------------------------------------------------------------ -
trunk/src/find_file_series.m
r439 r441 89 89 RootFileNew=[RootFile rr.i1]; 90 90 checkpair=~isempty(regexp(NomType,'-','once'))||~isempty(regexp(NomType,'ab$','once'))||~isempty(regexp(NomType,'AB$','once'));%case of PIV results 91 if exist(fullfile(RootPath, [RootFileNew '.xml']),'file') %|| (checkpair && exist(fullfile(fileparts(RootPath),[RootFileNew '.xml']),'file'))91 if exist(fullfile(RootPath,SubDir,[RootFileNew '.xml']),'file') %|| (checkpair && exist(fullfile(fileparts(RootPath),[RootFileNew '.xml']),'file')) 92 92 RootFile=RootFileNew; 93 93 NomTypePref=r.tiretnum; -
trunk/src/mouse_motion.m
r432 r441 218 218 par.ImageWidth=size(par.ImageA,2); 219 219 Param.Civ1=par; 220 ibx2=floor((par. Bx-1)/2);221 iby2=floor((par. By-1)/2);222 isx2=floor((par.Search x-1)/2);223 isy2=floor((par.Search y-1)/2);224 shiftx=par.S hiftx;225 shifty=par.S hifty;220 ibx2=floor((par.CorrBoxSize(1)-1)/2); 221 iby2=floor((par.CorrBoxSize(2)-1)/2); 222 isx2=floor((par.SearchBoxSize(1)-1)/2); 223 isy2=floor((par.SearchBoxSize(2)-1)/2); 224 shiftx=par.SearchBoxShift(1); 225 shifty=par.SearchBoxShift(2); 226 226 hhh=findobj(CurrentAxes,'Tag','PIV_box_marker'); 227 227 hhhh=findobj(CurrentAxes,'Tag','PIV_search_marker'); -
trunk/src/read_field.m
r435 r441 20 20 % = image : usual image as recognised by Matlab 21 21 % = multimage: image series stored in a single file 22 % = m ovie: movie read with mmreader23 % = avi: avi movie read with aviread (OBSOLETE, used only when mmreader is not available, oldversions of Matlab)22 % = mmreader: movie read with mmreader 23 % = video: movie read with VideoReader (recent versions of Matlab) 24 24 % = vol: images representing scanned volume (images concatened in the y direction) 25 25 % ParamIn: Matlab structure of input parameters -
trunk/src/series.m
r440 r441 693 693 694 694 %% update pair menus 695 set(handles.Pairs,'Visible','on') 696 set(handles.PairString,'Visible','on') 695 697 ListView=get(handles.ListView,'String'); 696 698 ListView{iview}=num2str(iview); … … 698 700 set(handles.ListView,'Value',iview) 699 701 update_mode(handles,i1_series,i2_series,j1_series,j2_series,time) 702 700 703 701 704 %% display the set of existing files as an image … … 851 854 852 855 %% store the series info in 'UserData' 853 854 856 SeriesData.i1_series{iview}=i1_series; 855 857 SeriesData.i2_series{iview}=i2_series; … … 860 862 set(handles.series,'UserData',SeriesData) 861 863 862 864 %% check for pair display 865 check_pairs=0; 866 for iview=1:numel(SeriesData.i2_series) 867 if ~isempty(SeriesData.i2_series{iview})||~isempty(SeriesData.j2_series{iview}) 868 check_pairs=1; 869 end 870 end 871 if check_pairs 872 set(handles.Pairs,'Visible','on') 873 set(handles.PairString,'Visible','on') 874 else 875 set(handles.Pairs,'Visible','off') 876 set(handles.PairString,'Visible','off') 877 end 863 878 864 879 return … … 1041 1056 %------------------------------------------------------------ 1042 1057 list_pair=get(handles.ListPairs,'String');%get the menu of image pairs 1043 string=list_pair{get(handles.ListPairs,'Value')}; 1044 string=regexprep(string,',.*','');%removes time indication (after ',') 1058 if isempty(list_pair) 1059 string=''; 1060 else 1061 string=list_pair{get(handles.ListPairs,'Value')}; 1062 string=regexprep(string,',.*','');%removes time indication (after ',') 1063 end 1045 1064 PairString=get(handles.PairString,'Data'); 1046 1065 iview=get(handles.ListView,'Value'); … … 1198 1217 end 1199 1218 set(handles.ListPairs,'String',displ_pair) 1200 if isempty(displ_pair)1201 msgbox_uvmat('ERROR',['no file available for the selected subdirectory ' SubDir])1202 end1219 % if isempty(displ_pair) 1220 % msgbox_uvmat('ERROR',['no file available for the selected subdirectory' ]) 1221 % end 1203 1222 1204 1223 … … 1543 1562 ref_j=ceil((first_j+last_j)/2); 1544 1563 set(handles.num_ref_j,'String', num2str(ref_j)) 1545 ref_j_Callback(hObject, eventdata, handles)1564 num_ref_j_Callback(hObject, eventdata, handles) 1546 1565 SeriesData=get(handles.series,'UserData'); 1547 1566 if ~isfield(SeriesData,'Time') -
trunk/src/uvmat.m
r439 r441 909 909 910 910 %% read parameters (time, geometric calibration..) from a documentation file (.xml advised) 911 filexml=[FileBase '.xml']; 912 fileciv=[FileBase '.civ']; 911 SubDirBase=regexprep(SubDir,'\..*','');%take the root part of SubDir, before the first dot '.' 912 filexml=fullfile(RootPath,[SubDirBase '.xml']);% new convention: xml above the image dir 913 if ~exist(filexml,'file') 914 filexml=fullfile(RootPath,SubDir,[RootFile '.xml']);%old convention: xml within the image directroy 915 end 913 916 warntext='';%default warning message 914 917 NbSlice=1;%default … … 945 948 end 946 949 end 947 elseif exist(fileciv,'file')% if .civ file found948 [error,XmlData.Time,TimeUnit,mode,npx,npy,pxcmx,pxcmy]=read_imatext([FileBase '.civ']);949 GeometryCalib.R=[pxcmx 0 0; 0 pxcmy 0;0 0 0];950 GeometryCalib.Tx=0;951 GeometryCalib.Ty=0;952 GeometryCalib.Tz=1;953 GeometryCalib.dpx=1;954 GeometryCalib.dpy=1;955 GeometryCalib.sx=1;956 GeometryCalib.Cx=0;957 GeometryCalib.Cy=0;958 GeometryCalib.f=1;959 GeometryCalib.kappa1=0;960 GeometryCalib.CoordUnit='cm';961 XmlData.GeometryCalib=GeometryCalib;962 if error==2, warntext=['no file ' FileBase '.civ'];963 elseif error==1, warntext='inconsistent number of fields in the .civ file';964 end965 set(handles.num_Npx,'String',num2str(npx));%fills nbre of pixels x box966 set(handles.num_Npy,'String',num2str(npy));%fills nbre of pixels y box967 set(handles.pxcm,'String',num2str(pxcmx));%fills scale x (pixel/cm) box968 set(handles.pycm,'String',num2str(pxcmy));%fills scale y (pixel/cm) box969 set(handles.pxcm,'Visible','on');%fills scale x (pixel/cm) box970 set(handles.pycm,'Visible','on');%fills scale y (pixel/cm) box971 set(handles.view_xml,'Visible','on')972 set(handles.view_xml,'String','view .civ')973 950 else 974 set(handles.view_xml,'Visible','off') 951 fileciv=fullfile(RootPath,SubDir,[RootFile '.civ']); 952 if exist(fileciv,'file')% if .civ file found (very old convention) 953 [error,XmlData.Time,TimeUnit,mode,npx,npy,pxcmx,pxcmy]=read_imatext(fileciv); 954 GeometryCalib.R=[pxcmx 0 0; 0 pxcmy 0;0 0 0]; 955 GeometryCalib.Tx=0; 956 GeometryCalib.Ty=0; 957 GeometryCalib.Tz=1; 958 GeometryCalib.dpx=1; 959 GeometryCalib.dpy=1; 960 GeometryCalib.sx=1; 961 GeometryCalib.Cx=0; 962 GeometryCalib.Cy=0; 963 GeometryCalib.f=1; 964 GeometryCalib.kappa1=0; 965 GeometryCalib.CoordUnit='cm'; 966 XmlData.GeometryCalib=GeometryCalib; 967 if error==2, warntext=['no file ' fileciv]; 968 elseif error==1, warntext='inconsistent number of fields in the .civ file'; 969 end 970 set(handles.num_Npx,'String',num2str(npx));%fills nbre of pixels x box 971 set(handles.num_Npy,'String',num2str(npy));%fills nbre of pixels y box 972 set(handles.pxcm,'String',num2str(pxcmx));%fills scale x (pixel/cm) box 973 set(handles.pycm,'String',num2str(pxcmy));%fills scale y (pixel/cm) box 974 set(handles.pxcm,'Visible','on');%fills scale x (pixel/cm) box 975 set(handles.pycm,'Visible','on');%fills scale y (pixel/cm) box 976 set(handles.view_xml,'Visible','on') 977 set(handles.view_xml,'String','view .civ') 978 else 979 set(handles.view_xml,'Visible','off') 980 end 975 981 end 976 982 … … 985 991 end 986 992 if ~isempty(XmlData.Time) 987 % nbfield=size(XmlData.Time,1);988 % nbfield_j=size(XmlData.Time,2);989 993 %transform .Time to a column vector if it is a line vector the nomenclature uses a single index 990 if isequal(nbfield,1) && ~isequal(nbfield_j,1)% .Time is a line vector 994 if isequal(size(XmlData.Time,1),1) 995 % if isequal(nbfield,1) && ~isequal(nbfield_j,1)% .Time is a line vector 991 996 NomType=get(handles.NomType,'String'); 992 if numel(NomType)>=2 &&(strcmp(NomType,'_i')||strcmp(NomType(1:2),'%0')||strcmp(NomType(1:2),'_%')) 997 % if isempty(nbfield_j) 998 % if numel(NomType)>=2 &&(strcmp(NomType,'_i')||strcmp(NomType(1:2),'%0')||strcmp(NomType(1:2),'_%')) 993 999 XmlData.Time=(XmlData.Time)'; 994 % nbfield=nbfield_j;995 % nbfield_j=1;996 end997 1000 end 998 1001 end
Note: See TracChangeset
for help on using the changeset viewer.