- Timestamp:
- Apr 30, 2018, 8:01:35 PM (7 years ago)
- Location:
- trunk/src
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/check_files.m
r1027 r1033 163 163 svn_info.rep_rev=0;svn_info.cur_rev=0; 164 164 [tild,result]=system(['svn info ' dir_fct]); %get info fromn the svn server 165 t=regexp(result,'R.vision\s*:\s*(?<rev>\d+)','names');%detect 'r ï¿œvision' or 'Revision' in the text165 t=regexp(result,'R.vision\s*:\s*(?<rev>\d+)','names');%detect 'revision' or 'Revision' in the text 166 166 if ~isempty(t) 167 167 svn_info.cur_rev=str2double(t.rev); %version nbre of the current package -
trunk/src/compile.m
r1027 r1033 46 46 MCRROOT = ['MCRROOT',int2str(mcrmajor),int2str(mcrminor)]; 47 47 FctNameVersion=[FctName,'_',MCRROOT]; 48 %hver=ver('MATLAB');49 %FctNameVersion=[FctName '_MCRROOT' regexprep(hver.Version,'\.','')]; % suppress the dot in version number50 48 try 51 49 disp(['mcc -m -R -nojvm -R -nodisplay -R -singleCompThread ' SubfctPath ' ' FctName '.m']) -
trunk/src/dir_uvmat.m
r1022 r1033 1 function [ ListFiles ] = dir_uvmat( DirName) 1 %'dir_uvmat': list the content of a folder, extending 'dir' to the case of OpenDap server 2 %-------------------------------------------------------------------- 3 %[RootPath,SubDir,RootFile,i1,i2,j1,j2,Ext,NomType]=fileparts_uvmat(FileInput) 4 % 5 %OUTPUT: 6 %ListFiles: 7 % 8 %INPUT: 9 %DirName: complete name of the folder to scan, including path 10 11 %======================================================================= 12 % Copyright 2008-2018, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France 13 % http://www.legi.grenoble-inp.fr 14 % Joel.Sommeria - Joel.Sommeria (A) legi.cnrs.fr 15 % 16 % This file is part of the toolbox UVMAT. 17 % 18 % UVMAT is free software; you can redistribute it and/or modify 19 % it under the terms of the GNU General Public License as published 20 % by the Free Software Foundation; either version 2 of the license, 21 % or (at your option) any later version. 22 % 23 % UVMAT is distributed in the hope that it will be useful, 24 % but WITHOUT ANY WARRANTY; without even the implied warranty of 25 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 % GNU General Public License (see LICENSE.txt) for more details. 27 %======================================================================= 28 29 function [ ListFiles] = dir_uvmat(DirName) 2 30 if regexp(DirName,'^http://') 3 31 catalog=[DirName,'/catalog.xml']; -
trunk/src/find_file_series.m
r1027 r1033 48 48 %------------------------------------------------------------------------ 49 49 50 %% get input root name and nomenclature type50 %% get input root name and info on the input file 51 51 if isempty(regexp(FilePath,'^http://')) 52 52 fullfileinput=fullfile(FilePath,fileinput);% input file name with path … … 153 153 end 154 154 end 155 155 156 156 detect_string=['^' RootFile sep1 i1_str i2_str sep2 j1_str j2_str FileExt '$'];%string used in regexp to detect file indices 157 % if isempty(regexp(FilePath,'^http://')) 158 %find the string used to extract the relevant files with the command dir 159 % star_string=[RootFile sep1 i1_star i2_star sep2 j1_star j2_star FileExt]; 160 % wd=pwd;%current working directory 161 % cd (FilePath)% move to the local dir to save time in the operation dir. 162 % dirpair=dir(star_string);% look for relevant files in the file directory 163 % cd(wd) 164 % else 165 ListStruct=dir_uvmat(FilePath); 166 ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray 167 ListFiles=ListCells(1,:);%list of file names 168 rr=regexp(ListFiles,detect_string,'names'); 169 % end 170 % nbpair=numel(dirpair); 157 ListStruct=dir_uvmat(FilePath);% scan the content of the folder FilePath 158 ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray 159 ListFiles=ListCells(1,:);%list of file names 160 rr=regexp(ListFiles,detect_string,'names'); 171 161 nbpair=numel(rr); 172 162 ref_i_list=zeros(1,nbpair); … … 177 167 % scan the list of relevant files, extract the indices 178 168 for ifile=1:nbpair 179 % rr=regexp(dirpair(ifile).name,detect_string,'names');169 % rr=regexp(dirpair(ifile).name,detect_string,'names'); 180 170 if ~isempty(rr{ifile}) 181 171 i1=str2num(rr{ifile}.i1); … … 274 264 NomType='*'; 275 265 i2_series=[];j1_series=[];j2_series=[]; 276 % i1_input=1;i2_input=[];j1_input=[];j2_input=[];266 % i1_input=1;i2_input=[];j1_input=[];j2_input=[]; 277 267 if ~exist(fullfileinput,'file') 278 268 RootFile=''; … … 281 271 end 282 272 end 283 % %% detect rdvision format284 % if strcmp(FileExt,'.bin')285 % if exist(fullfile(RootPath,SubDir,[RootFile '.seq']),'file')286 % FileInfo.FileType='rdvision';287 % FileInfo.SeqFile=[RootFile '.seq'];288 % end289 % end290 273 291 274 %% introduce the frame index in case of movies or multimage type -
trunk/src/get_file_info.m
r1032 r1033 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 % ='figure': Matlab figure 9 % ='xml': xml file 10 % ='xls': Excel file 11 % ='dat': text file for data, 12 % ='image': image format recognised by Matlab 13 % ='multimage': image format recognised by Matlab with multiple frames 14 % ='video': video movie file 15 % ='mmreader': video from old versions of Matlab (<2009) 16 % ='rdvision': images in binary format from company rdvision 17 % ='image_DaVis': images from softwar DaVis (company LaVision) 18 % ='cine_phantom': images from fast camera Phantom 19 % ='bin': binary file without specific organisation 20 % ='netcdf': netcdf file 21 % ='civdata': netcdf files provided by civ_series 22 % ='civx': netcdf files provided by the obsolete program civx (in fortran) 23 % ='pivdata_fluidimage': PIV data from software 'fluidimage' 8 24 % .FileIndexing='on' for data files (when series of indexed files are expected) 9 25 % .Height: image height in pixels … … 54 70 case {'.seq','.sqb'} 55 71 [A,FileInfo,timestamps,errormsg]=read_rdvision(fileinput,[]); 56 % %%%%%57 % FileInfo.NumberOfFrame=24000;58 % %%%%%%%%59 72 case '.im7' 60 73 try … … 66 79 FileInfo.Width=size(Image,1); 67 80 FileInfo.TimeName='timestamp'; 68 DateString=Input.Attributes{60}.Value 69 TimeString=Input.Attributes{59}.Value 81 for ilist=1:numel(Input.Attributes) 82 if strcmp(Input.Attributes{ilist}.Name,'_Date') 83 DateString=Input.Attributes{ilist}.Value; 84 end 85 if strcmp(Input.Attributes{ilist}.Name,'_Time') 86 TimeString=Input.Attributes{ilist}.Value; 87 end 88 end 70 89 catch ME 71 msgbox_uvmat('ERROR', [ME.message;'reading image from DaVis is possible only with Matlab version 2013 or earlier'])90 msgbox_uvmat('ERROR',{ME.message;'reading image from DaVis is possible only with Matlab version 2013 or earlier'}) 72 91 return 73 92 end … … 166 185 end 167 186 end 168 switch FileInfo.FileType 169 case {'image','image_DaVis','multimage','mmreader','cine_phantom','video','netcdf','civdata'} 187 if ismember (FileInfo.FileType,{'image','image_DaVis','multimage','mmreader','cine_phantom','video','netcdf','civdata'}) 170 188 FileInfo.FileIndexing='on'; % allow to detect file index for scanning series 171 189 end 190 FileInfo.FieldType=FileInfo.FileType;%default 191 switch FileInfo.FileType 192 case {'image','multimage','video','mmreader','rdvision','image_DaVis','cine_phantom'} 193 FileInfo.FieldType='image'; 194 end 195 -
trunk/src/read_civdata.m
r1027 r1033 80 80 VelTypeOut=VelType; 81 81 errormsg=''; 82 if ~exist(FileName,'file')83 errormsg=['input file ' FileName ' does not exist'];84 return85 end86 82 if ischar(FieldNames), FieldNames={FieldNames}; end; 87 83 ProjModeRequest=''; … … 102 98 Data=nc2struct(FileName,'ListGlobalAttribute','CivStage'); 103 99 if isfield(Data,'Txt') 104 erro msg=['error in read_civdata: ' Data.Txt];100 errormsg=['error in read_civdata: ' Data.Txt]; 105 101 return 106 102 end … … 108 104 [varlist,role,VelTypeOut]=varcivx_generator(ProjModeRequest,VelType,Data.CivStage); 109 105 if isempty(varlist) 110 erro msg=['error in read_civdata: unknow velocity type ' VelType];106 errormsg=['error in read_civdata: unknow velocity type ' VelType]; 111 107 return 112 108 else -
trunk/src/read_field.m
r1032 r1033 47 47 Field=[]; 48 48 if ~exist('num','var') 49 num=1; 50 end 51 if isempty(num) 49 52 num=1; 50 53 end … … 272 275 case 'image_DaVis' 273 276 Input=readimx(FileName); 277 if numel(Input.Frames)==1 278 num=1; 279 end 274 280 A=Input.Frames{num}.Components{1}.Planes{1}'; 275 %timestamps=double(Input.Attributes{1}.Value(2))/1000000; 276 timestamps=str2num(Input.Frames{1}.Attributes{12}.Value(1:end-3))/1000000; 281 for ilist=1:numel(Input.Frames{1}.Attributes) 282 if strcmp(Input.Frames{1}.Attributes{ilist}.Name,'AcqTimeSeries') 283 timestamps=str2num(Input.Frames{1}.Attributes{ilist}.Value(1:end-3))/1000000; 284 break 285 end 286 end 277 287 case 'cine_phantom' 278 288 [A,FileInfo] = read_cine_phantom(FileName,num ); -
trunk/src/read_image.m
r1027 r1033 43 43 num=1; 44 44 end 45 if isempty(num) 46 num=1; 47 end 45 48 A=[]; 46 49 ObjectOut=VideoObject;%default … … 68 71 case 'image_DaVis' 69 72 Input=readimx(FileName); 73 if numel(Input.Frames)==1 74 A=Input.Frames{1}.Components{1}.Planes{1}'; 75 else 70 76 A=Input.Frames{num}.Components{1}.Planes{1}'; 77 end 71 78 end -
trunk/src/series.m
r1030 r1033 175 175 RunModeList=[RunModeList;{'cluster'}]; 176 176 set(handles.MonitorCluster,'Visible','on'); % make visible button for access to Monika 177 set(handles.num_CPUTime,'Visible','on'); % make visible button for access to Monika 178 set(handles.CPUTime_txt,'Visible','on'); % make visible button for CPU time estimate for one ref index 177 set(handles.num_CPUTime,'Visible','on'); % make visible button for CPU time estimate for one ref index 178 set(handles.num_CPUTime,'String','1')% defqult CPU time estimate 1 minute 179 set(handles.CPUTime_txt,'Visible','on'); % make visible button for CPU time title 179 180 end 180 181 % [s,w]=system('qstat -help'); % look for cluster system 'sge' … … 1569 1570 NbCoreAdvised=SeriesData.SeriesParam.ClusterParam.NbCoreAdvised; 1570 1571 NbCoreMax=SeriesData.SeriesParam.ClusterParam.NbCoreMax; 1571 if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled) 1572 warning_string=', preferably use .sh option to save Matlab licences'; 1572 if NbCoreMax~=1 1573 if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled) 1574 warning_string=', preferably use .sh option to save Matlab licences'; 1575 else 1576 warning_string=')'; 1577 end 1578 answer=msgbox_uvmat('INPUT_TXT',['Number of cores (max ' num2str(NbCoreMax) ', ' warning_string],num2str(NbCoreAdvised)); 1579 if isempty(answer) 1580 errormsg='Action launch interrupted by user'; 1581 return 1582 end 1583 NbCore=str2double(answer); 1573 1584 else 1574 warning_string=')'; 1575 end 1576 answer=msgbox_uvmat('INPUT_TXT',['Number of cores (max ' num2str(NbCoreMax) ', ' warning_string],num2str(NbCoreAdvised)); 1577 if isempty(answer) 1578 errormsg='Action launch interrupted by user'; 1579 return 1580 end 1581 NbCore=str2double(answer); 1582 % extra_oar=answer{2}; 1583 % case {'cluster_pbs', 'cluster_sge', 'cluster_qstat_unknown'} 1584 % if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled) 1585 % NbCore=1; % one core used only (limitation of Matlab licences) 1586 % answer=msgbox_uvmat('INPUT_Y-N','Number of cores =1: select the compiled version .sh for multi-core processing. Proceed with the .m version?'); 1587 % if ~strcmp(answer,'Yes') 1588 % errormsg='Action launch interrupted'; 1589 % return 1590 % end 1591 % extra_oar=''; 1592 % else 1593 % answer=inputdlg({'Number of jobs (max 1000)','Queue'},'qsub parameters',1,{'100','piv_debian'}); 1594 % NbCore=str2double(answer{1}); 1595 % qstat_Queue=answer{2}; 1596 % %extra_oar=answer{2}; % TODO : fix this for LMFA cluster. Maybe 1597 % %extrs_oar and extra_pbs are not the best names 1598 % end 1585 NbCore=1; 1586 end 1599 1587 end 1600 1588 if ~isfield(Param.IndexRange,'NbSlice') … … 2157 2145 %------------------------------------------------------------------------ 2158 2146 % --- Executes on selection change in ActionName. 2159 function ActionName_Callback(hObject, eventdata, handles)2147 function ActionName_Callback(hObject, ActionPath, handles) 2160 2148 %------------------------------------------------------------------------ 2161 2149 … … 2164 2152 answer= msgbox_uvmat('INPUT_Y-N','stop current Action process?'); 2165 2153 if strcmp(answer,'Yes') 2166 STOP_Callback(hObject, eventdata, handles)2154 STOP_Callback(hObject, [], handles) 2167 2155 else 2168 2156 return … … 2192 2180 %% add a new function to the menu if 'more...' has been selected in the menu ActionName 2193 2181 if isequal(ActionName,'more...') 2182 if isempty(ActionPath) 2183 ActionPath=get(handles.ActionPath,'String'); 2184 end 2194 2185 [FileName, PathName] = uigetfile( ... 2195 2186 {'*.m', ' (*.m)'; 2196 2187 '*.m', '.m files '; ... 2197 2188 '*.*', 'All Files (*.*)'}, ... 2198 'Pick a series processing function ', get(handles.ActionPath,'String'));2189 'Pick a series processing function ',ActionPath); 2199 2190 if length(FileName)<2 2200 2191 return … … 2281 2272 ActionName= ActionList{get(handles.ActionName,'Value')}; % selected function name 2282 2273 if ~exist(ActionPath,'dir') 2283 msgbox_uvmat('ERROR',['The prescribed function path ' ActionPath ' does not exist']); 2274 ActionName_Callback(handles.ActionName, ActionPath, handles)% update the function 2275 % msgbox_uvmat('ERROR',['The prescribed function path ' ActionPath ' does not exist']); 2284 2276 return 2285 2277 end -
trunk/src/series/aver_stat.m
r1027 r1033 167 167 168 168 %% determine the file type on each line from the first input file 169 ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};170 169 NcTypeOptions={'netcdf','civx','civdata'}; 171 170 for iview=1:NbView … … 176 175 [FileInfo{iview},MovieObject{iview}]=get_file_info(filecell{iview,1}); 177 176 FileType{iview}=FileInfo{iview}.FileType; 178 CheckImage{iview}= ~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images177 CheckImage{iview}=strcmp(FileInfo{iview}.FieldType,'image');% =1 for images 179 178 CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files 180 179 if ~isempty(j1_series{iview}) -
trunk/src/series/beam_forming.m
r1027 r1033 93 93 94 94 %% determine the file type on each line from the first input file 95 ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};96 95 NcTypeOptions={'netcdf','civx','civdata'}; 97 96 for iview=1:NbView … … 102 101 [FileInfo{iview},MovieObject{iview}]=get_file_info(filecell{iview,1}); 103 102 FileType{iview}=FileInfo{iview}.FileType; 104 CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images103 CheckImage{iview}=strcmp(FileInfo{iview}.FieldType,'image');% =1 for images 105 104 CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files 106 105 if ~isempty(j1_series{iview}) -
trunk/src/series/check_data_files.m
r1027 r1033 109 109 110 110 %determine the file type on each line from the first input file 111 ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};112 111 NcTypeOptions={'netcdf','civx','civdata'}; 113 112 for iview=1:nbview 114 113 [FileInfo{iview},Object{iview}]=get_file_info(filecell{iview,1}); 115 114 FileType{iview}=FileInfo{iview}.FileType; 116 CheckImage{iview}= ~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images115 CheckImage{iview}=strcmp(FileInfo{iview}.FieldType,'image');% =1 for images 117 116 CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files 118 117 end -
trunk/src/series/check_peaklock.m
r1027 r1033 125 125 126 126 %determine the file type on each line from the first input file 127 ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};128 127 NcTypeOptions={'netcdf','civx','civdata'}; 129 128 for iview=1:nbview … … 134 133 [FileInfo{iview},MovieObject{iview}]=get_file_info(filecell{iview,1}); 135 134 FileType{iview}=FileInfo{iview}.FileType; 136 CheckImage{iview}= ~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images135 CheckImage{iview}=strcmp(FileInfo{iview}.FieldType,'image');% =1 for images 137 136 CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files 138 137 if ~isempty(j1_series{iview}) -
trunk/src/series/civ_input.m
r1027 r1033 80 80 set(handles.num_CorrSmooth,'String',{'1';'2'}) 81 81 set(handles.CheckThreshold,'Visible','on') 82 set(handles.CheckDeformation,'Value',0)% desactivate (work in progress)82 set(handles.CheckDeformation,'Value',0)% desactivate 83 83 end 84 84 switch Param.Action.ActionName … … 95 95 FileType='image';%fdefault 96 96 FileInfo=[]; 97 if isfield(SeriesData,'FileType')&&isfield(SeriesData,'FileInfo')... 98 &&numel(SeriesData.FileType)>=1&&numel(SeriesData.FileInfo)>=1 99 FileType=SeriesData.FileType{1};%type of the first input file series 100 FileInfo=SeriesData.FileInfo{1};% info on the first input file series 97 if isfield(SeriesData,'FileInfo')... 98 FileType=SeriesData.FileInfo{1}.FileType;% info on the first input file series 99 FieldType=SeriesData.FileInfo{1}.FieldType;% info on the first input file series 101 100 else 102 101 set(hhseries.REFRESH,'BackgroundColor',[1 0 1])% indicate that the file input in series needs to be refreshed … … 109 108 iview_image=1;%line # for the input images 110 109 switch FileType 111 case {'image','image_DaVis','multimage','video','mmreader','cine_phantom','netcdf'}112 % NomTypeImaA=NomTypeInput;113 % iview_image=1;%line # for the input images114 110 case 'civdata' 115 111 if ~strcmp(Param.Action.ActionName,'civ_series') … … 154 150 return 155 151 otherwise 152 if ~strcmp(FieldType,'image') 156 153 msgbox_uvmat('ERROR','civ_series needs images, scalar fields in netcdf format, or civ data as input') 157 154 return 155 end 158 156 end 159 157 … … 308 306 end 309 307 if isfield(Param.ActionInput,'Civ2') 310 CheckDeformation_Callback(hObject, eventdata, handles) 311 end 312 end 313 if isfield(Param,'ActionInput') && isfield(Param.ActionInput,'ListCompareMode')&&... 314 strcmp(Param.ActionInput.ListCompareMode,'displacement') 315 set(handles.PairIndices,'Visible','off') 316 end 308 CheckDeformation_Callback(hObject, eventdata, handles) 309 end 310 end 311 if isfield(Param,'ActionInput') && isfield(Param.ActionInput,'ListCompareMode')&&... 312 strcmp(Param.ActionInput.ListCompareMode,'displacement') 313 set(handles.PairIndices,'Visible','off') 314 set(handles.CheckRefFile,'Visible','on') 315 else 316 set(handles.CheckRefFile,'Visible','off') 317 end 317 318 318 319 %% set the menu and default choice of civ pairs … … 370 371 %% list the possible index pairs, depending on the option set in ListPairMode 371 372 ListPairMode_Callback([], [], handles) 372 %ListPairCiv1_Callback(hObject, eventdata, handles)373 373 374 374 %% set the GUI to modal: wait for OK to close … … 714 714 mode_selected=mode_list{mode_value}; 715 715 end 716 % displ_num=[];%default717 716 ref_i=str2double(get(handles.ref_i,'String')); 718 % last_i=str2num(get(handles.last_i,'String'));719 717 CivInputData=get(handles.civ_input,'UserData'); 720 718 TimeUnit=get(handles.TimeUnit,'String'); … … 725 723 nbfield2=siztime(2)-1; 726 724 %indchosen=1; %%first pair selected by default 727 %displ_num used to define the indices of the civ_input pairs728 725 % in mode 'pair j1-j2', j1 and j2 are the file indices, else the indices 729 726 % are relative to the reference indices ref_i and ref_j respectively. 730 727 if isequal(mode_selected,'pair j1-j2') 731 728 dt=1; 732 displ='';733 729 index=0; 734 730 numlist_a=[]; … … 751 747 end 752 748 [dtsort,indsort]=sort(displ_dt); 753 if ~isempty(numlist_a)754 displ_num(1,:)=numlist_a(indsort);755 displ_num(2,:)=numlist_b(indsort);756 end757 displ_num(3,:)=0;758 displ_num(4,:)=0;759 749 enable_j(handles, 'off') 760 750 elseif isequal(mode_selected,'series(Dj)') %| isequal(mode,'st_series(Dj)') 761 index=1:200;762 displ_num(1,index)=-floor(index/2);763 displ_num(2,index)=ceil(index/2);764 displ_num(3:4,index)=zeros(2,200);765 751 enable_j(handles, 'on') 766 752 elseif isequal(mode_selected,'series(Di)') %| isequal(mode,'st_series(Di)') 767 % index=1:200;768 % displ_num(1:2,index)=zeros(2,200);769 % displ_num(3,index)=-floor(index/2);770 % displ_num(4,index)=ceil(index/2);771 753 enable_i(handles, 'on') 772 754 if nbfield2 > 1 … … 776 758 end 777 759 elseif isequal(mode_selected,'displacement')%the pairs have the same indices 778 displ_num(1,1)=0;779 displ_num(2,1)=0;780 displ_num(3,1)=0;781 displ_num(4,1)=0;782 760 if nbfield > 1 || nbfield==0 783 761 enable_i(handles, 'on') … … 791 769 end 792 770 end 793 %set(handles.ListPairCiv1,'UserData',displ_num);794 771 errormsg=find_netcpair_civ( handles,1); 795 772 if ~isempty(errormsg) 796 773 msgbox_uvmat('ERROR',errormsg) 797 798 % find_netcpair_civ2(handles) 799 774 end 775 776 %------------------------------------------------------------------------ 800 777 function enable_i(handles, state) 801 778 set(handles.itext,'Visible',state) 802 % set(handles.MinIndex_i,'Visible',state)803 % set(handles.last_i,'Visible',state)804 % set(handles.incr_i,'Visible',state)805 779 set(handles.MaxIndex_i,'Visible',state) 806 780 set(handles.ref_i,'Visible',state) 807 781 782 %------------------------------------------------------------------------ 808 783 function enable_j(handles, state) 809 784 set(handles.jtext,'Visible',state) 810 % set(handles.MinIndex_j,'Visible',state)811 % set(handles.last_j,'Visible',state)812 % set(handles.incr_j,'Visible',state)813 785 set(handles.MinIndex_j,'Visible',state) 814 786 set(handles.MaxIndex_j,'Visible',state) 815 787 set(handles.ref_j,'Visible',state) 816 %hseries=findobj(allchild(0),'Tag','series');817 %hhseries=guidata(hseries);818 %series('enable_j',hhseries,state); %file input with xml reading in uvmat, show the image in phys coordinates819 820 821 788 822 789 %------------------------------------------------------------------------ … … 874 841 errormsg=''; 875 842 CivInputData=get(handles.civ_input,'UserData'); 876 %browse=get(handles.RootPath,'UserData');877 843 compare_list=get(handles.ListCompareMode,'String'); 878 844 val=get(handles.ListCompareMode,'Value'); … … 896 862 menu_pair=get(handles.ListPairCiv2,'String');%previous menu of ListPairCiv1 897 863 PairCiv2Init=menu_pair{get(handles.ListPairCiv2,'Value')};%previous choice of pair 898 899 %% determine nom_type_nc, nomenclature type of the .nc files:900 %[nom_type_nc]=nomtype2pair(nom_type_ima,mode);901 864 902 865 %% reads .nc subdirectoy and image numbers from the interface … … 924 887 nbpair=200;%default 925 888 select=ones(size(1:nbpair));%flag for displayed pairs =1 for display 926 %nbpair=200; %default927 889 928 890 %% determine the menu display in .ListPairCiv1 … … 991 953 end 992 954 case 'displacement' 993 displ_pair={'Di=Dj=0'}; 994 displ_pair_dt={'Di=Dj=0'}; 995 end 996 if index==1 955 % displ_pair={'Di=Dj=0'}; 956 % displ_pair_dt={'Di=Dj=0'}; 957 set(handles.PairIndices,'Visible','off') 958 end 959 if index==1 && ~strcmp(mode_selected,'displacement') 997 960 set(handles.ListPairCiv1,'String',displ_pair_dt'); 998 961 end … … 1011 974 set(handles.ListPairCiv1,'Value',1) 1012 975 end 1013 % if initial>nbpair || (numel(select)>=initial && ~isequal(select(initial),1))1014 % set(handles.ListPairCiv1,'Value',ichoice);% first valid pair proposed by default in the menu1015 % end1016 976 1017 977 %% determine the default selection in the pair menu for Civ2 978 if ~strcmp(mode_selected,'displacement') 1018 979 if strcmp(get(handles.ListPairCiv2,'Visible'),'on') 1019 980 end_pair=regexp(PairCiv2Init,' :dt='); … … 1031 992 end 1032 993 set(handles.ListPairCiv2,'String',displ_pair_dt'); 994 end 1033 995 set(gcf,'Pointer','arrow')% Indicate that the process is finished 1034 996 … … 2305 2267 if ~isempty(filexml) 2306 2268 Param=xml2struct(filexml);% read the input xml file as a Matlab structure 2307 2308 % Param.Action.RUN=0; %desactivate the input RUN=12309 2269 if ~isfield(Param,'InputTable')||~isfield(Param,'IndexRange') 2310 2270 msgbox_uvmat('ERROR','invalid config file: open a file in a folder ''/0_XML''') … … 2326 2286 end 2327 2287 2288 %------------------------------------------------------------------------ 2328 2289 % --- Executes on selection change in CheckCiv3. 2290 %------------------------------------------------------------------------ 2329 2291 function CheckCiv3_Callback(hObject, eventdata, handles) 2330 2292 2293 %------------------------------------------------------------------------ 2331 2294 % --- Executes on button press in CheckRefFile. 2295 %------------------------------------------------------------------------ 2332 2296 function CheckRefFile_Callback(hObject, eventdata, handles) 2333 2297 2334 hseries=findobj(allchild(0),'Tag','series'); 2335 hhseries=guidata(hseries); 2336 InputTable=get(hhseries.InputTable,'Data'); 2337 InputFile=fullfile(InputTable{1,1},InputTable{1,2},[InputTable{1,3} InputTable{1,5}]); 2338 % browse for a reference file for displacement 2339 fileref= uigetfile_uvmat('pick a reference image file:',InputFile); 2340 if ~isempty(fileref) 2341 set(handles.RefFile,'String',fileref) 2342 set(handles.ConfigSource,'String','NEW') 2343 set(handles.ConfigSource,'BackgroundColor',[1 0 1]) 2344 end 2298 hseries=findobj(allchild(0),'Tag','series'); 2299 hhseries=guidata(hseries); 2300 InputTable=get(hhseries.InputTable,'Data'); 2301 i1=str2num(get(hhseries.num_first_i,'String')); 2302 j1=str2num(get(hhseries.num_first_j,'String')); 2303 InputFile=fullfile_uvmat(InputTable{1,1},InputTable{1,2},InputTable{1,3},InputTable{1,5},InputTable{1,4},i1,[],j1); 2304 % browse for a reference file for displacement 2305 fileref= uigetfile_uvmat('pick a reference image file:',InputFile); 2306 if ~isempty(fileref) 2307 FileInfo=get_file_info(fileref); 2308 CheckImage=strcmp(FileInfo.FieldType,'image');% =1 for images 2309 if ~CheckImage 2310 msgbox_uvmat('ERROR',['invalid file type input for reference image: ' FileInfo.FileType ' not an image']) 2311 else 2312 if isfield (FileInfo,'NumberOfFrames')&& FileInfo.NumberOfFrames>1 2313 set(handles.num_OriginIndex,'Visible','on') 2314 set(handles.OriginIndex_title,'Visible','on') 2315 else 2316 set(handles.num_OriginIndex,'Visible','off') 2317 set(handles.OriginIndex_title,'Visible','off') 2318 end 2319 set(handles.RefFile,'String',fileref) 2320 set(handles.ConfigSource,'String','NEW') 2321 set(handles.ConfigSource,'BackgroundColor',[1 0 1]) 2322 end 2323 end 2345 2324 2346 2325 %------------------------------------------------------------------------ -
trunk/src/series/merge_proj.m
r1030 r1033 134 134 135 135 %% determine the file type on each line from the first input file 136 ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};137 136 NcTypeOptions={'netcdf','civx','civdata'}; 138 137 for iview=1:NbView … … 146 145 FileType{iview}='netcdf'; 147 146 end 148 CheckImage{iview}= ~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images147 CheckImage{iview}=strcmp(FileInfo{iview}.FieldType,'image');% =1 for images 149 148 if CheckImage{iview} 150 149 ParamIn{iview}=MovieObject{iview}; -
trunk/src/series/sub_background.m
r1032 r1033 107 107 108 108 %% check the validity of input file types 109 ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom','image_DaVis'};%allowed input file types(images)110 109 FileInfo=get_file_info(FirstFileName); 111 110 FileType=FileInfo.FileType; 112 CheckImage= ~isempty(find(strcmp(FileType,ImageTypeOptions), 1));% =1 for images111 CheckImage=strcmp(FileInfo.FieldType,'image');% =1 for images 113 112 if ~CheckImage 114 113 msgbox_uvmat('ERROR',['invalid file type input: ' FileType ' not an image']) -
trunk/src/series/turb_stat.m
r1032 r1033 114 114 115 115 %% determine the file type on each line from the first input file 116 ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};117 116 NcTypeOptions={'netcdf','civx','civdata'}; 118 117 for iview=1:NbView … … 123 122 [FileInfo{iview},MovieObject{iview}]=get_file_info(filecell{iview,1}); 124 123 FileType{iview}=FileInfo{iview}.FileType; 125 CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images126 124 CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files 127 125 if ~isempty(j1_series{iview}) … … 153 151 % EDIT FROM HERE 154 152 155 %% check the validity of input file types156 if CheckImage{1}157 FileExtOut='.png'; % write result as .png images for image inputs158 elseif CheckNc{1}159 FileExtOut='.nc';% write result as .nc files for netcdf inputs160 else161 msgbox_uvmat('ERROR',['invalid file type input ' FileType{1}])162 return163 end164 165 166 153 %% settings for the output file 154 FileExtOut='.nc';% write result as .nc files for netcdf inputs 167 155 NomTypeOut=nomtype2pair(NomType{1});% determine the index nomenclature type for the output file 168 156 first_i=i1_series{1}(1); -
trunk/src/set_grid.m
r1027 r1033 241 241 end 242 242 [FileInfo,VideoObject]=get_file_info(GUI.ImageA); 243 switch FileInfo.FileType 244 case {'image','multimage','video','mmreader'}% case of input image or movie OK 245 otherwise 246 msgbox_uvmat('ERROR',['error: ' GUI.ImageA ' is not an image type recognized by Matlab ']) 247 return 248 end 243 if ~strcmp(FileInfo.FieldType,'image');% =1 for images 244 msgbox_uvmat('ERROR',['error: ' GUI.ImageA ' is not an image type recognized by Matlab ']) 245 return 246 end 247 249 248 [RootPath,SubDir,RootFile,tild,tild,tild,tild,FileExt]=fileparts_uvmat(GUI.ImageA); 250 249 … … 336 335 ImageB=fullfile(PathName,FileName); 337 336 [FileInfo,tild,VideoObject]=get_file_info(ImageB); 338 switch FileInfo.FileType 339 case {'image','multimage','video','mmreader'}% case of input image or movie OK 340 set(handles.ImageB,'String',ImageB) 341 otherwise 342 msgbox_uvmat('ERROR',['error: ' imageB ' is not an image type recognized by Matlab ']) 337 if ~strcmp(FileInfo.FieldType,'image');% =1 for images 338 msgbox_uvmat('ERROR',['error: ' imageB ' is not an image type recognised by Matlab ']) 343 339 return 344 340 end -
trunk/src/struct2nc.m
r1027 r1033 121 121 VarType='nc_int'; 122 122 case 'logical' 123 VarType='nc_byte'; 123 VarType='nc_int'; 124 Data.(ListVarName{ivar})=uint8(Data.(ListVarName{ivar})); 124 125 end 125 126 if ~isempty(VarType) -
trunk/src/sub_field.m
r1027 r1033 99 99 ProjModeRequest=cell(size(Field.ListVarName)); 100 100 if isfield(Field,'VarAttribute') 101 for ilist=1:numel(Field.VarAttribute)102 if isfield(Field.VarAttribute{ilist},'ProjModeRequest')103 ProjModeRequest{ilist}=Field.VarAttribute{ilist}.ProjModeRequest;104 end105 end101 for ilist=1:numel(Field.VarAttribute) 102 if isfield(Field.VarAttribute{ilist},'ProjModeRequest') 103 ProjModeRequest{ilist}=Field.VarAttribute{ilist}.ProjModeRequest; 104 end 105 end 106 106 end 107 107 ProjModeRequest_1=cell(size(Field_1.ListVarName)); -
trunk/src/transform_field/phys.m
r1027 r1033 79 79 %% transform first field 80 80 iscalar=0;% counter of scalar fields 81 checktransform=0; 81 82 if ~isempty(Calib{1}) 82 if ~isfield(Calib{1},'CalibrationType')||~isfield(Calib{1},'CoordUnit') 83 return %bad calib parameter input 84 end 85 if ~(isfield(DataIn,'CoordUnit')&& strcmp(DataIn.CoordUnit,'pixel')) 86 return % transform only fields in pixel coordinates 87 end 88 DataOut=phys_1(DataIn,Calib{1},ZIndex);% transform coordinates and velocity components 89 %case of images or scalar: in case of two input fields, we need to project the transform on the same regular grid 90 if isfield(DataIn,'A') && isfield(DataIn,'Coord_x') && ~isempty(DataIn.Coord_x) && isfield(DataIn,'Coord_y')&&... 91 ~isempty(DataIn.Coord_y) && length(DataIn.A)>1 92 iscalar=1; 93 A{1}=DataIn.A; 83 if isfield(Calib{1},'CalibrationType')&& isfield(Calib{1},'CoordUnit') && isfield(DataIn,'CoordUnit')&& strcmp(DataIn.CoordUnit,'pixel') 84 DataOut=phys_1(DataIn,Calib{1},ZIndex);% transform coordinates and velocity components 85 %case of images or scalar: in case of two input fields, we need to project the transform on the same regular grid 86 if isfield(DataIn,'A') && isfield(DataIn,'Coord_x') && ~isempty(DataIn.Coord_x) && isfield(DataIn,'Coord_y')&&... 87 ~isempty(DataIn.Coord_y) && length(DataIn.A)>1 88 iscalar=1; 89 A{1}=DataIn.A; 90 end 91 checktransform=1; 94 92 end 95 93 end 96 94 97 95 %% document the selected plane position and angle if relevant 98 if isfield(Calib{1},'SliceCoord')&&size(Calib{1}.SliceCoord,1)>=ZIndex96 if checktransform && isfield(Calib{1},'SliceCoord')&&size(Calib{1}.SliceCoord,1)>=ZIndex 99 97 DataOut.PlaneCoord=Calib{1}.SliceCoord(ZIndex,:);% transfer the slice position corresponding to index ZIndex 100 98 if isfield(Calib{1},'SliceAngle') % transfer the slice rotation angles … … 108 106 109 107 %% transform second field if relevant 108 checktransform_1=0; 110 109 if ~isempty(DataOut_1) 111 110 if isfield(DataIn_1,'ZIndex') && ~isequal(DataIn_1.ZIndex,ZIndex) … … 113 112 return 114 113 end 115 if ~isfield(Calib{2},'CalibrationType')||~isfield(Calib{2},'CoordUnit') 116 return %bad calib parameter input 117 end 118 if (isfield(DataIn_1,'CoordUnit')&& strcmp(DataIn_1.CoordUnit,'pixel')) 114 if isfield(Calib{2},'CalibrationType')&&isfield(Calib{2},'CoordUnit') && isfield(DataIn_1,'CoordUnit')&& strcmp(DataIn_1.CoordUnit,'pixel') 119 115 DataOut_1=phys_1(DataOut_1,Calib{2},ZIndex); 120 end 121 if isfield(Calib{1},'SliceCoord') 122 if ~(isfield(Calib{2},'SliceCoord') && isequal(Calib{2}.SliceCoord,Calib{1}.SliceCoord)) 123 DataOut_1.Txt='different plane positions for the two input fields'; 124 return 125 end 126 DataOut_1.PlaneCoord=DataOut.PlaneCoord;% same plane position for the two input fields 127 if isfield(Calib{1},'SliceAngle') 128 if ~(isfield(Calib{2},'SliceAngle') && isequal(Calib{2}.SliceAngle,Calib{1}.SliceAngle)) 129 DataOut_1.Txt='different plane angles for the two input fields'; 116 if isfield(Calib{1},'SliceCoord') 117 if ~(isfield(Calib{2},'SliceCoord') && isequal(Calib{2}.SliceCoord,Calib{1}.SliceCoord)) 118 DataOut_1.Txt='different plane positions for the two input fields'; 130 119 return 131 120 end 132 DataOut_1.PlaneAngle=DataOut.PlaneAngle; % same plane angle for the two input fields 133 end 134 end 135 if isfield(DataIn_1,'A')&&isfield(DataIn_1,'Coord_x')&&~isempty(DataIn_1.Coord_x) && isfield(DataIn_1,'Coord_y')&&... 136 ~isempty(DataIn_1.Coord_y)&&length(DataIn_1.A)>1 137 iscalar=iscalar+1; 138 Calib{iscalar}=Calib{2}; 139 A{iscalar}=DataIn_1.A; 121 DataOut_1.PlaneCoord=DataOut.PlaneCoord;% same plane position for the two input fields 122 if isfield(Calib{1},'SliceAngle') 123 if ~(isfield(Calib{2},'SliceAngle') && isequal(Calib{2}.SliceAngle,Calib{1}.SliceAngle)) 124 DataOut_1.Txt='different plane angles for the two input fields'; 125 return 126 end 127 DataOut_1.PlaneAngle=DataOut.PlaneAngle; % same plane angle for the two input fields 128 end 129 end 130 if isfield(DataIn_1,'A')&&isfield(DataIn_1,'Coord_x')&&~isempty(DataIn_1.Coord_x) && isfield(DataIn_1,'Coord_y')&&... 131 ~isempty(DataIn_1.Coord_y)&&length(DataIn_1.A)>1 132 iscalar=iscalar+1; 133 Calib{iscalar}=Calib{2}; 134 A{iscalar}=DataIn_1.A; 135 end 136 checktransform_1=1; 140 137 end 141 138 end 142 139 143 140 %% transform the scalar(s) or image(s) 144 if iscalar~=0141 if checktransform && iscalar~=0 145 142 [A,Coord_x,Coord_y]=phys_ima(A,XmlData,ZIndex);%TODO : introduire interp2_uvmat ds phys_ima 146 143 if iscalar==1 && ~isempty(DataOut_1) % case for which only the second field is a scalar -
trunk/src/uvmat.m
r1032 r1033 2303 2303 end 2304 2304 end 2305 if ~isempty(i1_series) 2305 2306 [ref_j,ref_i]=find(squeeze(i1_series(1,:,:))); 2306 2307 if ~isempty(j1_series) … … 2332 2333 set(handles.scan_j,'Value',1) 2333 2334 scan_j_Callback([],[], handles); 2335 end 2334 2336 end 2335 2337 set(handles.scan_j,'Visible',state_j) … … 3470 3472 end 3471 3473 test_keepdata_1=0;% test for keeping the previous stored data if the input files are unchanged 3472 if ~isequal(NomType_1,'*')&& isfield(UvData,'FileName_1')3473 test_keepdata_1= strcmp(FileName_1,UvData.FileName_1) ;3474 end3474 % if ~isequal(NomType_1,'*')&& isfield(UvData,'FileName_1') 3475 % test_keepdata_1= strcmp(FileName_1,UvData.FileName_1) ; 3476 % end 3475 3477 if test_keepdata_1 3476 3478 Field{2}=UvData.Field_1;% keep the stored field … … 3690 3692 if isempty(transform) 3691 3693 UvData.Field=Field{1}; 3694 if numel(Field)==2 3695 UvData.Field=sub_field(Field{1},[],Field{2}); 3696 % UvData.Field.(FieldName)=Field{1}.(FieldName)-Field{2}.(FieldName_1); 3697 end 3692 3698 else 3693 3699 XmlData=[];%default … … 4607 4613 GetFieldData=get_field(FileName,ParamIn);% inport field names from the GUI get_field 4608 4614 FieldList={}; 4609 VecColorList={};4610 4615 switch GetFieldData.FieldOption 4611 4616 case 'vectors' 4612 4617 UName=GetFieldData.PanelVectors.vector_x; 4613 4618 VName=GetFieldData.PanelVectors.vector_y; 4614 YName=GetFieldData.Coordinates.Coord_y; 4619 if isfield(GetFieldData,'Coordinates') 4620 YName=GetFieldData.Coordinates.Coord_y; 4621 if isfield(GetFieldData.Coordinates,'Coord_z') 4622 ZName=GetFieldData.Coordinates.Coord_z; 4623 end 4624 end 4615 4625 CName=GetFieldData.PanelVectors.vec_color; 4616 4626 FieldList={['vec(' UName ',' VName ')'];... … … 4622 4632 VecColorList=[{CName};VecColorList]; 4623 4633 end 4634 set(handles.ColorScalar,'Value',1) 4635 set(handles.ColorScalar,'String',VecColorList); 4624 4636 case 'scalar' 4637 set(handles.Scalar,'Visible','on') 4638 ResizeFcn(gcbo,[],handles) 4625 4639 AName=GetFieldData.PanelScalar.scalar; 4626 YName=GetFieldData.Coordinates.Coord_y; 4640 if isfield(GetFieldData,'Coordinates') 4641 YName=GetFieldData.Coordinates.Coord_y; 4642 if isfield(GetFieldData.Coordinates,'Coord_z') 4643 ZName=GetFieldData.Coordinates.Coord_z; 4644 end 4645 end 4627 4646 FieldList={AName}; 4628 4647 case '1D plot' 4629 4648 YName=GetFieldData.PanelOrdinate.ordinate; 4649 FieldList={''}; 4630 4650 case 'civdata...'%reinitiate input, return to automatic civ data reading 4631 4651 display_file_name(handles,FileName,1) 4632 end 4652 end 4633 4653 if ~strcmp(GetFieldData.FieldOption,'civdata...') 4634 4654 XName=GetFieldData.Coordinates.Coord_x; … … 4659 4679 set(handles.FieldName_1,'Value',1) 4660 4680 set(handles.FieldName_1,'String',[FieldList; {'get_field...'}]); 4661 set(handles.ColorScalar,'Value',1) 4662 set(handles.ColorScalar,'String',VecColorList); 4681 4663 4682 UvData.FileType{2}='netcdf'; 4664 4683 set(handles.uvmat,'UserData',UvData)
Note: See TracChangeset
for help on using the changeset viewer.