Changeset 441 for trunk/src/uvmat.m
- Timestamp:
- Jun 6, 2012, 2:45:37 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.