- Timestamp:
- Jun 10, 2019, 4:44:18 PM (5 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_object.m
r1061 r1065 120 120 end 121 121 end 122 if isfield(ObjectData,'RangeInterp')&&~isempty(ObjectData.RangeInterp) 123 YMax=ObjectData.RangeInterp; 124 end 122 125 if isfield(ObjectData,'RangeZ')&&~isempty(ObjectData.RangeZ) 123 126 ZMax=max(ObjectData.RangeZ); … … 144 147 nbpoints=numel(xline); 145 148 switch ObjectData.Type 146 case 'line_x'147 xline=[xline; ObjectData.RangeX(2)];%creating the line148 yline=[yline; ObjectData.RangeY(2)];%creating the line149 149 case 'polygon' 150 150 xline=[xline; ObjectData.Coord(1,1)];%closing the line -
trunk/src/proj_field.m
r1062 r1065 538 538 if isfield(ObjectData,'RangeY') 539 539 width=max(ObjectData.RangeY);%Rangey needed bfor mode 'projection' 540 end 541 if isfield(ObjectData,'RangeInterp') 542 width=ObjectData.RangeInterp;%Rangey needed bfor mode 'projection' 540 543 end 541 544 % default output -
trunk/src/series.m
r1061 r1065 2576 2576 end 2577 2577 set(handles.CheckMask,'Visible',MaskVisible); 2578 %% Setting of expected iteration time 2579 if isfield(ParamOut,'CPUTime') 2580 set(handles.num_CPUTime,'String',num2str(ParamOut.CPUTime)); 2581 end 2578 2582 2579 2583 %% definition of the directory containing the output files -
trunk/src/series/civ_series.m
r1062 r1065 88 88 end 89 89 end 90 % estimated CPUTime 91 Data.CPUTime=1; % 1 minute per field pair 90 92 return 91 93 end -
trunk/src/series/extract_rdvision.m
r1061 r1065 26 26 % .ActionExt: fct extension ('.m', Matlab fct, '.sh', compiled Matlab fct 27 27 % .RUN =0 for GUI input, =1 for function activation 28 % .RunMode='local','background', 'cluster': type of function use28 % .RunMode='local','background', 'cluster': type of function extract_rdvision.muse 29 29 % 30 30 % .IndexRange: set the file or frame indices on which the action must be performed … … 44 44 % Copyright 2008-2019, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France 45 45 % http://www.legi.grenoble-inp.fr 46 % Joel.Sommeria - Joel.Sommeria (A) legi.cnrs.fr 46 % Joel.Sommeria - Joel.Sommeria (A) legi.cnrs.frextract_rdvision.m 47 47 % 48 48 % This file is part of the toolbox UVMAT. … … 56 56 % but WITHOUT ANY WARRANTY; without even the implied warranty of 57 57 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 58 % GNU General Public License (see LICENSE.txt) for more details. 58 % GNU General Public License (see LICENSE.txt) for more details.extract_rdvision.m 59 59 %======================================================================= 60 60 … … 65 65 ParamOut.AllowInputSort='off';...% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default) 66 66 ParamOut.WholeIndexRange='on';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default) 67 ParamOut.NbSlice= 1; ...%nbre of slices, 1 prevents splitting in several processes, ('off' by default)67 ParamOut.NbSlice='off';%1; ...%nbre of slices, 1 prevents splitting in several processes, ('off' by default) 68 68 ParamOut.VelType='off';...% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default) 69 69 ParamOut.FieldName='off';...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default) … … 71 71 ParamOut.ProjObject='off';...%can use projection object(option 'off'/'on', 72 72 ParamOut.Mask='off';...%can use mask option (option 'off'/'on', 'off' by default) 73 ParamOut.OutputDirExt='.extract';%set the output dir extension 73 ParamOut.CPUTime=0.1;% expected time for writting one image ( in minute) 74 ParamOut.OutputDirExt='.extract';%set the output dir extensionextract_rdvision.m 74 75 ParamOut.OutputSubDirMode='one'; %output folder given by the folder name of the first input line 75 76 % detect the set of image folder … … 80 81 check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files 81 82 ListDir=ListCells(1,find(check_dir & ~check_bad)); 82 % InputTable=cell(numel(ListDir),5);83 % InputTable(:,2)=ListDir';84 83 isel=0; 85 84 InputTable=Param.InputTable; … … 90 89 seq_index=find(~cellfun('isempty',detect_seq),1); 91 90 if ~isempty(seq_index) 92 % msgbox_uvmat('ERROR',['not seq file in ' ListDir{ilist} ': please check the input folders'])93 % else94 91 isel=isel+1; 95 92 InputTable{isel,1}=RootPath; … … 98 95 InputTable{isel,3}=RootFile; 99 96 InputTable{isel,4}='*'; 100 InputTable{isel,5}='.seq'; 97 InputTable{isel,5}='.seq';extract_rdvision.m 101 98 end 102 99 end … … 114 111 if ischar(Param) 115 112 Param=xml2struct(Param);% read Param as input file (batch case) 116 % checkrun=0;117 113 end 118 114 disp(Param) … … 144 140 FileInfo=get_file_info(filecell{1,1}); 145 141 if strcmp(FileInfo.FileType,'rdvision') 146 if ~isequal(FileInfo.NumberOfFrames,nbfield)147 disp_uvmat('WARNING',['the whole series of ' num2str(FileInfo.NumberOfFrames) ' images must be extracted at once'],checkrun)148 %rmfield(OutputDir)149 % return150 end142 % if ~isequal(FileInfo.NumberOfFrames,nbfield) 143 % disp_uvmat('WARNING',['the whole series of ' num2str(FileInfo.NumberOfextract_rdvision.mFrames) ' images must be extracted at once'],checkrun) 144 % %rmfield(OutputDir) 145 % % return 146 % end 151 147 %% interactive input of specific parameters (for RDvision system) 152 148 display('converting images from RDvision system...') … … 196 192 end 197 193 end 198 % if ~exist(filexml,'file')199 % disp_uvmat('ERROR',[filexml ' missing'],checkrun)200 % return201 % end202 203 194 newxml=fullfile(RootPath,Param.InputTable{iview,3}); 204 195 newxml=regexprep(newxml,'_Master_Dalsa_4M180$','');%suppress '_Master_Dalsa_4M180' … … 210 201 filename_seq=fullfile(RootPath,Param.InputTable{iview,2},[Param.InputTable{iview,3} '.seq']); 211 202 filename_sqb=fullfile(RootPath,Param.InputTable{iview,2},[Param.InputTable{iview,3} '.sqb']); 212 213 logdir=[Param.OutputSubDir Param.OutputDirExt]; 214 [success,errormsg] = copyfile(filename_seq,[fullfile(RootPath,logdir,Param.InputTable{iview,3}) '.seq']); %copy the seq file in the upper folder 215 [success,errormsg] = copyfile(filename_sqb,[fullfile(RootPath,logdir,Param.InputTable{iview,3}) '.sqb']); %copy the sqb file in the upper folder 216 if check_xml 217 [success,errormsg] = copyfile(filexml,[fullfile(RootPath,logdir,Param.InputTable{iview,3}) '.xml']); %copy the original xml file in the upper folder 203 errormsg=''; 204 if isequal(Param.IndexRange.first_i,1) 205 206 logdir=[Param.OutputSubDir Param.OutputDirExt]; 207 [success,errormsg] = copyfile(filename_seq,[fullfile(RootPath,logdir,Param.InputTable{iview,3}) '.seq']); %copy the seq file in the upper folder 208 [success,errormsg] = copyfile(filename_sqb,[fullfile(RootPath,logdir,Param.InputTable{iview,3}) '.sqb']); %copy the sqb file in the upper folder 209 if check_xml 210 [success,errormsg] = copyfile(filexml,[fullfile(RootPath,logdir,Param.InputTable{iview,3}) '.xml']); %copy the original xml file in the upper folder 211 end 218 212 end 219 213 otherwise … … 267 261 % m.Data=data; 268 262 %%%%%%% 269 timestamp=zeros(1,numel(m.Data)); 270 for ii=1: numel(m.Data) 271 timestamp(ii)=m.Data(ii).timestamp; 272 end 273 [nbfield1,nbfield2,msg]=copyfile_modif(filexml,timestamp,newxml); %copy the xml file in the upper folder 274 [XmlData,errormsg]=imadoc2struct(newxml);% check reading of the new xml file 275 if ~isempty(errormsg) 276 disp(errormsg) 277 return 278 end 279 timestamp=timestamp(1:nbfield1*nbfield2); 280 timestamp=reshape(timestamp,nbfield2,nbfield1); 281 difftime=XmlData.Time(2:end,2:end)'-timestamp; 282 disp(['time from xml and timestamp differ by ' num2str(max(max(abs(difftime))))]) 283 if max(abs(difftime))>0.01 284 checkpreserve=1;% will not erase the initial files, possibility of error 285 end 286 287 %% checking consistency with the xml file 288 % if ~isequal(SeqData.nb_frames,numel(timestamp)) 289 % disp_uvmat('ERRROR',['inconsistent number of images ' num2str(SeqData.nb_frames) ' with respect to the xml file: ' num2str(numel(timestamp))] ,checkrun); 290 % return 291 % end 292 263 timestamp=zeros(1,numel(m.Data)); 264 for ii=1: numel(m.Data) 265 timestamp(ii)=m.Data(ii).timestamp; 266 end 267 if isequal(Param.IndexRange.first_i,1) 268 [nbfield1,nbfield2,msg]=copyfile_modif(filexml,timestamp,newxml); %copy the xml file in the upper folder 269 [XmlData,errormsg]=imadoc2struct(newxml);% check reading of the new xml file 270 if ~isempty(errormsg) 271 disp(errormsg) 272 return 273 end 274 timestamp=timestamp(1:nbfield1*nbfield2); 275 timestamp=reshape(timestamp,nbfield2,nbfield1); 276 difftime=XmlData.Time(2:end,2:end)'-timestamp; 277 disp(['time from xml and timestamp differ by ' num2str(max(max(abs(difftime))))]) 278 if max(abs(difftime))>0.01 279 checkpreserve=1;% will not erase the initial files, possibility of error 280 end 281 % checking consistency with the xml file 282 % if ~isequal(SeqData.nb_frames,numel(timestamp)) 283 % disp_uvmat('ERRROR',['inconsistent number of images ' num2str(SeqData.nb_frames) ' with respect to the xml file: ' num2str(numel(timestamp))] ,checkrun); 284 % return 285 % end 286 else 287 [nbfield1,nbfield2,msg]=copyfile_modif(filexml,timestamp,''); 288 end 293 289 if nbfield2>1 294 290 NomTypeNew='_1_1'; … … 297 293 end 298 294 299 [BinList,errormsg]=binread_rdv_series(RootPath,SeqData,m.Data,nbfield2,NomTypeNew );295 [BinList,errormsg]=binread_rdv_series(RootPath,SeqData,m.Data,nbfield2,NomTypeNew,Param.IndexRange.first_i,Param.IndexRange.last_i); 300 296 if ~isempty(errormsg) 301 297 disp_uvmat('ERROR',errormsg,checkrun) … … 304 300 305 301 % check the existence of the expected output image files (from the xml) 302 306 303 FileDir=SeqData.sequencename; 307 304 FileDir=regexprep(FileDir,'_Master_Dalsa_4M180$','');%suppress '_Master_Dalsa_4M180' 308 for i1=1:numel(timestamp)/nbfield2309 for j1=1:nbfield2310 OutputFile=fullfile_uvmat(RootPath,FileDir,'img','.png',NomTypeNew,i1,[],j1);% TODO: set NomTypeNew from SeqData.mode311 try312 A=imread(OutputFile);% check image reading (stop if error)313 catch ME314 disp(['checking ' OutputFile])315 disp(ME.message)316 end317 end318 end305 % for i1=1:numel(timestamp)/nbfield2 306 % for j1=1:nbfield2 307 % OutputFile=fullfile_uvmat(RootPath,FileDir,'img','.png',NomTypeNew,i1,[],j1);% TODO: set NomTypeNew from SeqData.mode 308 % try 309 % A=imread(OutputFile);% check image reading (stop if error) 310 % catch ME 311 % disp(['checking ' OutputFile]) 312 % disp(ME.message) 313 % end 314 % end 315 % end 319 316 end 320 317 … … 333 330 334 331 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 335 function [BinList,errormsg]=binread_rdv_series(PathDir,SeqData,SqbData,nbfield2,NomTypeNew )332 function [BinList,errormsg]=binread_rdv_series(PathDir,SeqData,SqbData,nbfield2,NomTypeNew,first,last) 336 333 % BINREAD_RDV Permet de lire les fichiers bin g???n???r???s par Hiris ??? partir du 337 334 % fichier seq associ???. … … 387 384 end 388 385 bin_file_counter=0; 389 for ii=1:SeqData.nb_frames 386 %for ii=1:SeqData.nb_frames 387 for ii=first:last 390 388 j1=[]; 391 389 if ~isequal(nbfield2,1) … … 422 420 BinSize(NbBinFile)=BinSize(NbBinFile)+SeqData.width*SeqData.height*SeqData.bytesperpixel*8; %record bits read 423 421 try 422 tic 424 423 imwrite(A,OutputFile,'BitDepth',BitDepth) % case of 16 bit images 425 424 disp([OutputFile ' written']); 425 toc 426 426 % [s,errormsg] = fileattrib(OutputFile,'-w','a'); %set images to read only '-w' for all users ('a') 427 427 % if ~s … … 559 559 560 560 %% save the new xml file 561 save(t,newxml) 562 [success,errormsg] = fileattrib(newxml,'+w','g');% allow writing access for the group of users 563 if success==0 564 disp({['warning: unable to set group write access to ' newxml ':']; errormsg});%error message for directory creation 565 msg=errormsg; 566 end 567 568 569 561 if ~isempty(newxml) 562 save(t,newxml) 563 [success,errormsg] = fileattrib(newxml,'+w','g');% allow writing access for the group of users 564 if success==0 565 disp({['warning: unable to set group write access to ' newxml ':']; errormsg});%error message for directory creation 566 msg=errormsg; 567 end 568 end 569 570 -
trunk/src/set_object.m
r1063 r1065 388 388 UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface 389 389 if isempty(str2num(get(handles.num_DX,'String')))||isempty(str2num(get(handles.num_DY,'String'))); 390 % Field=UvData.Field;391 390 if isfield(UvData.Field,'CoordMesh')&&~isempty(UvData.Field.CoordMesh) 392 391 set(handles.num_DX,'String',num2str(UvData.Field.CoordMesh)) -
trunk/src/uvmat.m
r1061 r1065 976 976 case {'line','polyline','points'} 977 977 data.RangeY=UvData.Field.CoordMesh; 978 data.RangeInterp=3*UvData.Field.CoordMesh; 978 979 case 'line_x' 979 980 check_plot=1; %plot the line directly when set_object is opened … … 981 982 data.RangeX=UvData.Field.XMin ; 982 983 data.RangeY=UvData.Field.CoordMesh; 984 data.RangeInterp=3*UvData.Field.CoordMesh; 983 985 if isfield(UvData.Field,'ZMin') && isfield(UvData.Field,'ZMax') 984 986 Coord_z=(UvData.Field.ZMin +UvData.Field.ZMax)/2; … … 993 995 data.RangeX=UvData.Field.YMin ; 994 996 data.RangeY=UvData.Field.CoordMesh; 997 data.RangeInterp=3*UvData.Field.CoordMesh; 995 998 if isfield(UvData.Field,'ZMin') && isfield(UvData.Field,'ZMax') 996 999 Coord_z=(UvData.Field.ZMin +UvData.Field.ZMax)/2;
Note: See TracChangeset
for help on using the changeset viewer.