Changeset 497
- Timestamp:
- Jul 21, 2012, 11:15:52 PM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/check_files.m
r480 r497 3 3 % uvmat path to the Matlab path if needed. 4 4 %---------------------------------------------------------------------- 5 % function [ errormsg,date_str,ver]=check_files5 % function [checkmsg,date_str,ver]=check_files 6 6 % 7 7 % OUTPUT: 8 % errormsg: error message listing functions whose paths are not in the directory of uvmat.m8 % checkmsg: error message listing functions whose paths are not in the directory of uvmat.m 9 9 % date_str: date of the most recent modification of a file in the toolbox 10 10 % ver : svn version in case this is a svn repository … … 26 26 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 27 27 28 function [errormsg,date_str,svn_info]=check_files 29 errormsg={};%default 30 date_str=''; 28 function [checkmsg,date_str,svn_info]=check_files 29 checkmsg={};%default 31 30 svn_info.rep_rev=[]; 32 31 svn_info.cur_rev=[]; … … 53 52 'editxml.fig';...%interface for editxml 54 53 'fileparts_uvmat';...% extracts the root name,field indexes and nomenclature type from an input filename 55 'fill_GUI';...% fill a GUI with handles 'handles' from input data Param54 'fill_GUI';...% fill a GUI with a set of parameters from a Matlab structure 56 55 'filter_tps';...% find the thin plate spline coefficients for interpolation-smoothing 57 56 'find_field_indices';...% group the variables of a nc-formated Matlab structure into 'fields' with common dimensions … … 87 86 'read_image';... read images or video objects 88 87 'read_get_field';... read the list of selected variables from the GUI get_field (TODO: use read_GUI) 89 'read_GUI';... %read a ll parameters set by a GUIas a Matlab structure88 'read_GUI';... %read a GUI and provide the data as a Matlab structure 90 89 'read_image';...%read .civ files (obsolete, but can be adapted to other text documentation files) 91 90 'read_multimadoc';... %read a set of Imadoc files and compare their timing of different file series … … 121 120 }; 122 121 dir_fct=which('uvmat');% path to uvmat 123 [pathuvmat,name,ext]=fileparts(dir_fct);122 pathuvmat=fileparts(dir_fct); 124 123 125 124 %% add the uvmat path to matlab if needed … … 136 135 if isempty(dir_fct) 137 136 icount=icount+1; 138 errormsg{icount}=[list_fct{i} ' not found'];% test for function not found137 checkmsg{icount}=[list_fct{i} ' not found'];% test for function not found 139 138 else 140 [pth,name,ext]=fileparts(dir_fct);141 if ~isequal(pathuvmat,pth) &~isequal(fullfile(pathuvmat,'private'),pth)139 pth=fileparts(dir_fct); 140 if ~isequal(pathuvmat,pth) && ~isequal(fullfile(pathuvmat,'private'),pth) 142 141 icount=icount+1; 143 errormsg{icount}=[dir_fct ' overrides the package UVMAT'];% bad path for the function142 checkmsg{icount}=[dir_fct ' overrides the package UVMAT'];% bad path for the function 144 143 end 145 144 datfile=dir(dir_fct); … … 150 149 end 151 150 date_str=datestr(max(datnum)); 151 152 %% check svn status 152 153 [status,result]=system('svn --help'); 153 154 if status==0 … … 158 159 svn_info.cur_rev=str2double(t.rev); 159 160 end 160 [tild,result]=system(['svn info -r ''HEAD'' ' dir_fct]);161 [tild,result]=system(['svn info -r ''HEAD'' ' pathuvmat]); 161 162 t=regexp(result,'R.vision\s*:\s*(?<rev>\d+)','names'); 162 163 if ~isempty(t) 163 svn_info.rep_rev=str2double(t.rev);164 svn_info.rep_rev=str2double(t.rev); 164 165 end 165 [tild,result]=system(['svn status ' dir_fct]);166 [tild,result]=system(['svn status ' pathuvmat]); 166 167 svn_info.status=result; 167 errormsg =[errormsg {['SVN revision : ' num2str(svn_info.cur_rev)]}];168 checkmsg =[checkmsg {['SVN revision : ' num2str(svn_info.cur_rev)]}]; 168 169 if svn_info.rep_rev>svn_info.cur_rev 169 errormsg =[errormsg ...170 checkmsg =[checkmsg ... 170 171 {['Repository now at revision ' num2str(svn_info.rep_rev) '. Please type svn update in uvmat folder']}]; 171 172 end 172 173 modifications=regexp(svn_info.status,'M\s[^(\n|\>)]+','match'); 173 174 if ~isempty(modifications) 174 errormsg=[errormsg modifications]; 175 for ilist=1:numel(modifications) 176 [tild,FileName,FileExt]=fileparts(modifications{ilist}); 177 checkmsg=[checkmsg {[FileName FileExt ' modified']}]; 178 end 175 179 end 176 180 else 177 errormsg=[errormsg {'SVN not available'}];181 checkmsg=[checkmsg {'SVN not available'}]; 178 182 end 179 errormsg=errormsg';183 checkmsg=checkmsg'; 180 184 -
trunk/src/civ_matlab.m
r494 r497 228 228 [Data.Civ1_SubRange,Data.Civ1_NbSites,Data.Civ1_Coord_tps,Data.Civ1_U_tps,Data.Civ1_V_tps,tild,Ures, Vres,tild,FFres]=... 229 229 filter_tps([Data.Civ1_X(ind_good) Data.Civ1_Y(ind_good)],Data.Civ1_U(ind_good),Data.Civ1_V(ind_good),[],Data.Patch1_SubDomain,Data.Patch1_Rho,Data.Patch1_Threshold); 230 % fill=zeros(3,2,size(Data.Civ1_SubRange,3)); %matrix of zeros to complement the matrix Data.Civ1_Coord_tps (conveninent for file storage)231 % Data.Civ1_Coord_tps=cat(1,Data.Civ1_Coord_tps,fill);232 230 Data.Civ1_U_smooth(ind_good)=Ures; 233 231 Data.Civ1_V_smooth(ind_good)=Vres; … … 424 422 [Data.Civ2_SubRange,Data.Civ2_NbSites,Data.Civ2_Coord_tps,Data.Civ2_U_tps,Data.Civ2_V_tps,tild,Ures, Vres,tild,FFres]=... 425 423 filter_tps([Data.Civ2_X(ind_good) Data.Civ2_Y(ind_good)],Data.Civ2_U(ind_good),Data.Civ2_V(ind_good),[],Data.Patch2_SubDomain,Data.Patch2_Rho,Data.Patch2_Threshold); 426 % fill=zeros(3,2,size(Data.Civ2_SubRange,3)); %matrix of zeros to complement the matrix Data.Civ1_Coord_tps (conveninent for file storage)427 % Data.Civ2_Coord_tps=cat(1,Data.Civ2_Coord_tps,fill);428 424 Data.Civ2_U_smooth(ind_good)=Ures; 429 425 Data.Civ2_V_smooth(ind_good)=Vres; -
trunk/src/fill_GUI.m
r476 r497 1 %'fill_GUI': fill a GUI with handles 'handles' from input data Param1 %'fill_GUI': fill a GUI with a set of parameters from a Matlab structure 2 2 % ----------------------------------------------------------------------- 3 % function errormsg=fill_GUI(Param,handles) 4 % OUPUT: 5 % errormsg: error message, ='' by default 6 % 7 % INPUT: 8 % Param: matlab structure containing the information to display in the GUI 9 % handles: Matlab structure containing the handles of the GUI elements 10 % 11 % see also the reverse function read_GUI.m 12 % 3 13 function errormsg=fill_GUI(Param,handles) 4 14 %------------------------------------------------------------------------ … … 18 28 else 19 29 hh=[]; 20 input_data=Param.(fields{ifield}) 30 input_data=Param.(fields{ifield}); 21 31 check_done=0; 22 32 if isfield(handles,fields{ifield}) 23 hh=handles.(fields{ifield}) 33 hh=handles.(fields{ifield}); 24 34 if strcmp(get(hh,'Type'),'uitable') 25 35 set(hh,'Visible','on') -
trunk/src/find_file_series.m
r494 r497 218 218 [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) 219 219 NomType=regexprep(NomType,['^' NomTypePref],''); 220 end221 %% update the file type if the input file does not exist (pb of 0001)222 if isempty(FileType)223 [FileType,tild,MovieObject]=get_file_type(fullfile(FilePath,dirpair(ifile_min).name));220 %% update the file type if the input file does not exist (pb of 0001) 221 if isempty(FileType) 222 [FileType,tild,MovieObject]=get_file_type(fullfile(FilePath,dirpair(ifile_min).name)); 223 end 224 224 end 225 225 end -
trunk/src/mouse_down.m
r456 r497 129 129 end 130 130 break 131 case 'uicontrol' %if the mouse is over a uicontrol, duplicate the display in an editable zoom window 131 %if the mouse is over a uicontrol, duplicate the display in an editable zoom window 132 case 'uicontrol' 132 133 if isequal(get(hObject,'SelectionType'),'alt') && isequal(get(hchild,'Visible'),'on') && ~isequal(get(hchild,'tag'),'frame_object')&&... 133 134 ~isequal(get(hchild,'tag'),'ListObject') 134 135 if ~strcmp(get(hchild,'Style'),'frame')%do not visualisaze frames 135 136 msg_pos(1:2)=GUI_pos(1:2)+obj_pos(1:2).*GUI_pos(3:4); 136 output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],'',get(hchild,'String'),msg_pos); 137 display_str=get(hchild,'TooltipString'); 138 output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],display_str,get(hchild,'String'),msg_pos); 137 139 break 138 140 end … … 152 154 if strcmp(htype,'uicontrol') && strcmp(get(hchild,'Visible'),'on') 153 155 msg_pos(1:2)=GUI_pos(1:2)+obj_pos(1:2).*GUI_pos(3:4); 154 output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],'',get(hchild,'String'),msg_pos); 156 display_str=get(hchild,'TooltipString'); 157 output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],display_str,get(hchild,'String'),msg_pos); 155 158 break 156 159 end … … 165 168 if ~isempty(output_str) 166 169 set(hObject,'Units','pixels') 170 if strcmp(get(hchild,'enable'),'on') 167 171 set(hchild,'String',output_str) 172 end 168 173 end 169 174 -
trunk/src/msgbox_uvmat.m
r472 r497 112 112 if exist('Position','var') 113 113 if iscell(default_answer) 114 widthstring=max(cellfun('length',default_answer) );114 widthstring=max(cellfun('length',default_answer),length(display_str)); 115 115 heightstring=size(default_answer,1); 116 116 set(handles.edit_box,'Max',2); 117 117 else 118 widthstring= length(default_answer);118 widthstring=max(length(default_answer),length(display_str)); 119 119 heightstring=1; 120 120 end 121 widthstring=max(widthstring,length(title) );121 widthstring=max(widthstring,length(title)+20); 122 122 boxsize=[10*widthstring 20*heightstring];%size of the display edit box 123 123 set(handles.edit_box,'Units','pixels') … … 126 126 set(handles.edit_box,'Position',[5,34,boxsize(1),boxsize(2)]) 127 127 FigPos(3)=10+boxsize(1); 128 FigPos(4)= 36+boxsize(2);128 FigPos(4)=56+boxsize(2); 129 129 FigPos(2)=Position(2)-FigPos(4)-25; 130 130 set(handles.figure1,'Position',FigPos) -
trunk/src/read_GUI.m
r427 r497 1 % ----------------------------------------------------------------------- 2 % --- read a GUI with handle 'handle' producing a structure 'struct' 1 % 'read_GUI':read a GUI and provide the data as a Matlab structure 2 %---------------------------------------------------------------------- 3 % function struct=read_GUI(handle) 3 4 % 4 % The output Matlab structure 'struct' contains the information displayed on5 % the GUI or a panel with handle 'handle'5 % OUTPUT: 6 % struct: matlab structure containing the information displayed in the GUI 6 7 % The content of a panel with tag 'tag' is displayed as a substructure struct.(tag) (recursive use of read_GUI) 7 % Output of a nelement with tag 'tag':8 % 'checkbox','radiobutton','togglebutton': struct.(tag)=value9 % 'edit': struct.(tag)=string,8 % Output of a GUI element with tag 'tag': 9 % -case 'checkbox','radiobutton','togglebutton': struct.(tag)=value 10 % -case'edit': struct.(tag)=string, 10 11 % or, if the tag is in the form by 'num_tag', 11 12 % struct.(tag)=str2double(string). If the result is empty the 'UserData' is taken as the default input. 12 % 'listbox','popupmenu': struct.(tag)=selected string, or, if the tag is in the form by 'num_tag', struct.(tag)=str2double(string)13 % 'table': struct.(tag)=data of the table13 % -case 'listbox','popupmenu': struct.(tag)=selected string, or, if the tag is in the form by 'num_tag', struct.(tag)=str2double(string) 14 % -case 'table': struct.(tag)=data of the table 14 15 % 15 16 function struct=read_GUI(handle) -
trunk/src/read_civdata.m
r494 r497 176 176 'Civ1_X','Civ1_Y','Civ1_Z','Civ1_U_smooth','Civ1_V_smooth','Civ1_W','Civ1_C','Civ1_F','Civ1_FF',... 177 177 'Civ1_Coord_tps','Civ1_U_tps','Civ1_V_tps','Civ1_W_tps','Civ1_SubRange','Civ1_NbSites'}; 178 role={'coord_x','coord_y','coord_z','vector_x','vector_y','vector_z','ancillary','warnflag','errorflag','coord_tps','vector_x ',...179 'vector_y ','vector_z','ancillary','ancillary'};178 role={'coord_x','coord_y','coord_z','vector_x','vector_y','vector_z','ancillary','warnflag','errorflag','coord_tps','vector_x_tps',... 179 'vector_y_tps','vector_z_tps','ancillary','ancillary'}; 180 180 units={'pixel','pixel','pixel','pixel','pixel','pixel','','','','pixel','pixel','pixel','pixel','pixel',''}; 181 181 case 'civ2' … … 188 188 'Civ2_X','Civ2_Y','Civ2_Z','Civ2_U_smooth','Civ2_V_smooth','Civ2_W','Civ2_C','Civ2_F','Civ2_FF',... 189 189 'Civ2_Coord_tps','Civ2_U_tps','Civ2_V_tps','','Civ2_SubRange','Civ2_NbSites'}; 190 role={'coord_x','coord_y','coord_z','vector_x','vector_y','vector_z','ancillary','warnflag','errorflag','coord_tps','vector_x ',...191 'vector_y ','vector_z','ancillary','ancillary'};190 role={'coord_x','coord_y','coord_z','vector_x','vector_y','vector_z','ancillary','warnflag','errorflag','coord_tps','vector_x_tps',... 191 'vector_y_tps','vector_z_tps','ancillary','ancillary'}; 192 192 units={'pixel','pixel','pixel','pixel','pixel','pixel','','','','pixel','pixel','pixel','pixel','pixel',''}; 193 193 end -
trunk/src/read_field.m
r493 r497 1 2 %'read_field': read input fields in different formats 1 %'read_field': read the fields from files in different formats (netcdf files, images, video) 3 2 %-------------------------------------------------------------------------- 4 3 % function [Field,ParamOut,errormsg] = read_field(FileName,FileType,ParamIn,num) … … 16 15 %INPUT 17 16 % FileName: name of the input file 18 % FileType: type of file 19 % = netcdf : netcdf file 20 % = image : usual image as recognised by Matlab 21 % = multimage: image series stored in a single file 22 % = mmreader: movie read with mmreader 23 % = video: movie read with VideoReader (recent versions of Matlab) 24 % = vol: images representing scanned volume (images concatened in the y direction) 17 % FileType: type of file, as determined by the function get_file_type.m 25 18 % ParamIn: movie object or Matlab structure of input parameters 26 19 % .FieldName: name (char string) of the input field (for Civx data) … … 29 22 % .Npx, .Npy: nbre of pixels along x and y (used for .vol input files) 30 23 % num: frame number for movies 24 % 25 % see also read_image.m,read_civxdata.m,read_civdata.m, 31 26 32 27 function [Field,ParamOut,errormsg] = read_field(FileName,FileType,ParamIn,num) -
trunk/src/read_image.m
r493 r497 1 %--read images or video objects 2 function [A,ParamOut]=read_image(FileName,FileType,VideoObject,num) 3 %------------------------------------------------------------------------ 4 %num is the view number needed for an avi movie 5 ParamOut=VideoObject;%default 1 %'read_image': read images or video objects 2 %---------------------------------------------------------------------- 3 % function [A,ObjectOut]=read_image(FileName,FileType,VideoObject,num) 4 % 5 % OUTPUT: 6 % A(npy,npx,rgb): matrix of integers (iunt8 or uint16) representing the image, with sizes npy, npx, and possibly color component rgb=1:3 7 % ObjectOut: video object (=[] for images) 8 % 9 % INPUT: 10 % FileName: input file name 11 % FileType: input file type, as determined by the function get_file_type.m 12 % VideoObject: video object (for faster reading if availlable) 13 % num: frame index for movies or multimage types 14 % 15 function [A,ObjectOut]=read_image(FileName,FileType,VideoObject,num) 16 %----------------------------------------------------------------------- 17 if ~exist('VideoObject','var') 18 VideoObject=[]; 19 end 20 if ~exist('num','var') 21 num=1; 22 end 23 ObjectOut=VideoObject;%default 6 24 switch FileType 7 25 case 'video' … … 9 27 A=read(VideoObject,num); 10 28 else 11 ParamOut=VideoReader(FileName);12 A=read( ParamOut,num);29 ObjectOut=VideoReader(FileName); 30 A=read(ObjectOut,num); 13 31 end 14 32 case 'mmreader' … … 16 34 A=read(VideoObject,num); 17 35 else 18 ParamOut=mmreader(FileName);19 A=read( ParamOut,num);36 ObjectOut=mmreader(FileName); 37 A=read(ObjectOut,num); 20 38 end 21 39 case 'multimage' -
trunk/src/uvmat.m
r496 r497 936 936 if isfield(XmlData, 'GeometryCalib') && ~isempty(XmlData.GeometryCalib) 937 937 if isfield(XmlData.GeometryCalib,'VolumeScan') && isequal(XmlData.GeometryCalib.VolumeScan,'y') 938 set (handles.n b_slice,'String','volume')938 set (handles.num_NbSlice,'String','volume') 939 939 end 940 940 hgeometry_calib=findobj('tag','geometry_calib'); … … 1016 1016 end 1017 1017 if isfield(GeometryCalib,'VolumeScan') && isequal(GeometryCalib.VolumeScan,'y') 1018 set(handles.n b_slice,'String','volume')1018 set(handles.num_NbSlice,'String','volume') 1019 1019 else 1020 set(handles.n b_slice,'String',num2str(NbSlice))1020 set(handles.num_NbSlice,'String',num2str(NbSlice)) 1021 1021 end 1022 1022 slices_Callback([],[], handles) … … 1229 1229 if get(handles.slices,'Value')==1 1230 1230 set(handles.slices,'BackgroundColor',[1 1 0]) 1231 set(handles.n b_slice,'Visible','on')1231 set(handles.num_NbSlice,'Visible','on') 1232 1232 set(handles.z_text,'Visible','on') 1233 1233 set(handles.z_index,'Visible','on') 1234 n b_slice_Callback(hObject, eventdata, handles)1234 num_NbSlice_Callback(hObject, eventdata, handles) 1235 1235 else 1236 set(handles.n b_slice,'Visible','off')1236 set(handles.num_NbSlice,'Visible','off') 1237 1237 set(handles.slices,'BackgroundColor',[0.7 0.7 0.7]) 1238 1238 set(handles.z_text,'Visible','off') … … 1243 1243 1244 1244 %------------------------------------------------------------------------ 1245 function n b_slice_Callback(hObject, eventdata, handles)1246 %------------------------------------------------------------------------ 1247 nb_slice_str=get(handles.n b_slice,'String');1245 function num_NbSlice_Callback(hObject, eventdata, handles) 1246 %------------------------------------------------------------------------ 1247 nb_slice_str=get(handles.num_NbSlice,'String'); 1248 1248 if isequal(nb_slice_str,'volume') 1249 1249 num=stra2num(get(handles.j1,'String')); … … 1252 1252 else 1253 1253 num=str2double(get(handles.i1,'String')); 1254 nbslice=str2double(get(handles.n b_slice,'String'));1254 nbslice=str2double(get(handles.num_NbSlice,'String')); 1255 1255 end 1256 1256 z=mod(num-1,nbslice)+1; … … 1326 1326 mdetect=exist(maskname,'file'); 1327 1327 if mdetect 1328 set(handles.n b_slice,'String',Name(i+1:ind_mask-1));1329 set(handles.n b_slice,'BackgroundColor',[1 1 0])1328 set(handles.num_NbSlice,'String',Name(i+1:ind_mask-1)); 1329 set(handles.num_NbSlice,'BackgroundColor',[1 1 0]) 1330 1330 set(handles.CheckMask,'UserData',Mask); 1331 1331 set(handles.CheckMask,'BackgroundColor',[1 1 0]) … … 1412 1412 Mask.CoordUnit='pixel'; 1413 1413 if isequal(get(handles.slices,'Value'),1) 1414 NbSlice=str2num(get(handles.n b_slice,'String'));1414 NbSlice=str2num(get(handles.num_NbSlice,'String')); 1415 1415 num_i1=str2num(get(handles.i1,'String')); 1416 1416 Mask.ZIndex=mod(num_i1-1,NbSlice)+1; … … 1842 1842 Field_b.AY=Field_a.AY; 1843 1843 % z index 1844 nbslice=str2double(get(handles.n b_slice,'String'));1844 nbslice=str2double(get(handles.num_NbSlice,'String')); 1845 1845 if ~isempty(nbslice) 1846 1846 Field_b.ZIndex=mod(num_i2-1,nbslice)+1; … … 1987 1987 % NomType=get(handles.FileIndex,'UserData'); 1988 1988 %update the z position index 1989 nbslice_str=get(handles.n b_slice,'String');1989 nbslice_str=get(handles.num_NbSlice,'String'); 1990 1990 if isequal(nbslice_str,'volume')%NOT USED 1991 1991 z_index=num_j1; … … 2390 2390 {'nb_tps','nb_coord','nb_subdomain'},{'nb_tps','nb_subdomain'},{'nb_tps','nb_subdomain'}}]; 2391 2391 Field{1}.VarAttribute{nbvar+3}.Role='coord_tps'; 2392 Field{1}.VarAttribute{nbvar+4}.Role='vector_x ';2393 Field{1}.VarAttribute{nbvar+5}.Role='vector_y ';2392 Field{1}.VarAttribute{nbvar+4}.Role='vector_x_tps'; 2393 Field{1}.VarAttribute{nbvar+5}.Role='vector_y_tps'; 2394 2394 if isfield(Field{1},'ListDimName')%cleaning 2395 2395 Field{1}=rmfield(Field{1},'ListDimName'); … … 4880 4880 web(helpfile); 4881 4881 end 4882
Note: See TracChangeset
for help on using the changeset viewer.