Changeset 1150
- Timestamp:
- Jun 24, 2024, 6:38:26 PM (4 months ago)
- Location:
- trunk/src
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/browse_data.m
r1127 r1150 426 426 ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray 427 427 ListFiles=ListCells(1,:); 428 check_xml=~cellfun('isempty',regexp(ListFiles,'(\.xml|~)$'));% detect non xml files and files not marked by ~ 428 check_xml=~cellfun('isempty',regexp(ListFiles,'\.xml$'));% detect xml files 429 check_tild=~cellfun('isempty',regexp(ListFiles,'~$'));% detect ~ files 429 430 index_isdir=find(strcmp('isdir',fieldnames(ListStruct))); 430 431 check_dir=cell2mat(ListCells(index_isdir,:));% =1 for directories, =0 for files 431 nbfiles=numel(find(~check_xml & ~check_dir ));% number of non xml files432 nbfiles=numel(find(~check_xml & ~check_dir & ~check_tild));% number of non xml files 432 433 check_dir=check_dir & cellfun('isempty', regexp(ListFiles,'^(-|\.|\+/\.)'));% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . ) 433 434 ListFiles(check_dir)=regexprep(ListFiles(check_dir),'^.+','+/$0');% put '+/' in front of dir name display … … 477 478 ListCells=struct2cell(ListStruct);%transform dir struct to a cell arrray 478 479 ListFiles=ListCells(1,:);%list of dir and file names 479 cell_remove=regexp(ListFiles,'^( -|\.|\+/\.)');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . )480 cell_remove=regexp(ListFiles,'^((-|\.|\+/\.))');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . ) 480 481 check_keep=cellfun('isempty', cell_remove); 481 482 index_isdir=find(strcmp('isdir',fieldnames(ListStruct))); … … 721 722 ListDevices=get(handles.ListDevices,'String'); 722 723 DeviceIndices=get(handles.ListDevices,'Value'); 723 set(handles.DataSeries,'String',ListDevices); 724 set(handles.DataSeries,'String',ListDevices);%transfer list of devices to DataSeries 724 725 set(handles.DataSeries,'Value',DeviceIndices); 725 726 726 727 ListExperiments=get(handles.ListExperiments,'String'); 727 728 ExpIndices=get(handles.ListExperiments,'Value'); 728 set(handles.ListDevices,'String',ListExperiments); 729 set(handles.ListDevices,'String',ListExperiments);%transfer list of experiments to devices 729 730 set(handles.ListDevices,'Value',ExpIndices); 730 731 … … 740 741 % set(handles.ListExperiments,'String',DataSeries) 741 742 % set(handles.ListExperiments,'Value',ValueDevice) 742 % ListExperiments_Callback(hObject, [], handles) 743 744 745 % % --- Executes on selection change in DataSeries. 746 % function DataSeries_Callback(hObject, eventdata, handles) 747 % SourceDir=get(handles.SourceDir,'String'); 748 % ListData=get(handles.DataSeries,'String'); 749 % Folder=ListData{get(handles.DataSeries,'Value')}; 750 % if ~isempty(regexp(Folder,'^\+/'))% if a folder is selected 751 % Folder=regexprep(Folder,'\+/',''); 752 % ListExperiments=get(handles.ListExperiments,'String'); 753 % list_val=get(handles.ListExperiments,'Value'); 754 % for iexp=1:numel(list_val) 755 % ExpName=regexprep(ListExperiments{list_val(iexp)},'\+/',''); 756 % FullName=fullfile(SourceDir,ExpName,Folder); 757 % dd=dir(FullName); 758 % check_sub=1; 759 % for idir=1:numel(dd) 760 % ListData{ilist}=dd(ilist).name; 761 % if dd(ilist).isdir && ~strcmp(dd(ilist).name,'.')&& ~strcmp(dd(ilist).name,'..')&& isempty(regexp(dd(ilist).name,'^_LOG'))... 762 % && isempty(regexp(dd(ilist).name,'^_LOG'))&& isempty(regexp(dd(ilist).name,'^_XML')) 763 % check_sub=1; 764 % ListData{ilist}=['+/' dd(ilist).name]; 765 % end 766 % end 767 % if check_sub 768 % set(handles.ListDevices,'String',ListData); 769 % set(handles.ListDevices,'Visible','on'); 770 % set(handles.DataSeries,'String',ListData) 771 % break 772 % end 773 % end 774 % end 775 776 % % --- Executes on button press in CheckDevices. 777 % function CheckDevices_Callback(hObject, eventdata, handles) 778 % if get(handles.CheckDevices,'Value') 779 % set(handles.ListDevices,'Visible','on') 780 % ListDevices=get(handles.DataSeries,'String'); 781 % Index=get(handles.DataSeries,'Value'); 782 % set(handles.ListDevices,'String',ListDevices) 783 % set(handles.ListDevices,'Value',Index) 784 % set(handles.DataSeries,'Value',1) 785 % if strcmp(get(handles.MirrorDir,'Visible'),'on') 786 % MirrorPath=get(handles.MirrorDir,'String'); 787 % else 788 % MirrorPath=get(handles.SourceDir,'String'); 789 % end 790 % IndexExperiment=get(handles.ListExperiments,'Value'); 791 % ListExperiment=get(handles.ListExperiments,'String'); 792 % Experiment=ListExperiment{get(handles.ListExperiments,'Value')}; 793 % Experiment=regexprep(Experiment,'^\+/','');% remove the +/ used to mark dir 794 % Experiment=regexprep(Experiment,'^~','');% remove the ~ used to mark symbolic link 795 % Device=regexprep(ListDevices{Index},'^\+/','');% remove the +/ used to mark dir 796 % Device=regexprep(Device,'^~','');% remove the ~ used to mark symbolic link 797 % DataSeries=dir(fullfile(MirrorPath,Experiment,Device)); 798 % DataSeriesCell=struct2cell(DataSeries); 799 % set(handles.DataSeries,'String',DataSeriesCell(1,:)') 800 % else 801 % ListDevices=get(handles.ListDevices,'String'); 802 % Index=get(handles.ListDevices,'Value'); 803 % set(handles.ListDevices,'Visible','off') 804 % set(handles.DataSeries,'String',ListDevices) 805 % set(handles.DataSeries,'Value',Index) 806 % end 743 ListExperiments_Callback(hObject, [], handles) 744 SourceDir_Callback(hObject, [], handles) 807 745 808 746 -
trunk/src/geometry_calib.m
r1148 r1150 346 346 display([XmlName ' updated with calibration parameters' dispmessage]) 347 347 else 348 display([XmlName ' created with calibration parameters ' dispmessage])348 display([XmlName ' created with calibration parameters: no timing defined' dispmessage]) 349 349 end 350 350 end … … 396 396 %------------------------------------------------------------------------ 397 397 % --- Executes on button press in Replicate 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 398 function Replicate_Callback(hObject, eventdata, handles) 399 % %------------------------------------------------------------------------ 400 set(handles.CheckEnableMouse,'Value',0)% desactivate mouse (to avoid spurious creation of new points) 401 402 if get(handles.Replicate,'Value') %open the GUI browse_data 403 % look for the GUI uvmat and check for an image as input 404 huvmat=findobj(allchild(0),'Name','uvmat'); 405 hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat 406 RootPath=get(hhuvmat.RootPath,'String'); 407 SubDir=get(hhuvmat.SubDir,'String'); 408 browse_data(fullfile(RootPath,SubDir)) 409 else 410 hbrowse=findobj(allchild(0),'Tag','browse_data'); 411 if ~isempty(hbrowse) 412 delete(hbrowse) 413 end 414 end 415 415 %------------------------------------------------------------------------ 416 416 % --- activate calibration and store parameters in ouputfile . … … 1294 1294 Heading=s.Heading; 1295 1295 end 1296 1296 if isfield (s,'GeometryCalib') 1297 1297 GeometryCalib=s.GeometryCalib; 1298 1298 fx=1;fy=1;Cx=0;Cy=0;kc=0; %default … … 1341 1341 set(handles.CheckEnableMouse,'BackgroundColor',[0.7 0.7 0.7]) 1342 1342 end 1343 1343 end 1344 1344 %------------------------------------------------------------------------ 1345 1345 %---display calibration intrinsic parameters -
trunk/src/imadoc2struct.m
r1149 r1150 70 70 s.Camera.FirstFrameIndexI=1; %first index assumed equl to 1 by default 71 71 end 72 Timing=s.Camera.BurstTiming; 73 if ~iscell(Timing) 74 Timing={Timing}; 75 end 72 s.Time=xmlburst2time(s.Camera.BurstTiming,s.Camera.FirstFrameIndexI); 73 end 76 74 77 s.Time=[];78 for k=1:length(Timing)79 Frequency=1;80 if isfield(Timing{k},'FrameFrequency')81 Frequency=Timing{k}.FrameFrequency;82 end83 Dtj=[];84 if isfield(Timing{k},'Dtj')85 Dtj=Timing{k}.Dtj/Frequency;%Dtj converted from frame unit to TimeUnit (e.g. 's');86 end87 NbDtj=1;88 if isfield(Timing{k},'NbDtj')&&~isempty(Timing{k}.NbDtj)89 NbDtj=Timing{k}.NbDtj;90 end91 Dti=[];92 if isfield(Timing{k},'Dti')93 Dti=Timing{k}.Dti/Frequency;%Dti converted from frame unit to TimeUnit (e.g. 's');94 end95 NbDti=1;96 if isfield(Timing{k},'NbDti')&&~isempty(Timing{k}.NbDti)97 NbDti=Timing{k}.NbDti;98 end99 Time_val=Timing{k}.Time;%time in TimeUnit100 if ~isempty(Dti)101 Dti=reshape(Dti'*ones(1,NbDti),NbDti*numel(Dti),1); %concatene Dti vector NbDti times102 Time_val=[Time_val;Time_val(end)+cumsum(Dti)];%append the times defined by the intervals Dti103 end104 if ~isempty(Dtj)105 Dtj=reshape(Dtj'*ones(1,NbDtj),1,NbDtj*numel(Dtj)); %concatene Dtj vector NbDtj times106 Dtj=[0 Dtj];107 Time_val=Time_val*ones(1,numel(Dtj))+ones(numel(Time_val),1)*cumsum(Dtj);% produce a time matrix with Dtj108 end109 % reading Dtk110 Dtk=[];%default111 NbDtk=1;%default112 if isfield(Timing{k},'Dtk')113 Dtk=Timing{k}.Dtk;114 end115 if isfield(Timing{k},'NbDtk')&&~isempty(Timing{k}.NbDtk)116 NbDtk=Timing{k}.NbDtk;117 end118 if isempty(Dtk)119 s.Time=[s.Time;Time_val];120 else121 for kblock=1:NbDtk+1122 Time_val_k=Time_val+(kblock-1)*Dtk;123 s.Time=[s.Time;Time_val_k];124 end125 end126 end127 128 s.Time=[zeros(size(s.Time,1),1) s.Time]; %insert a vertical line of zeros (to deal with zero file indices)129 if s.Camera.FirstFrameIndexI~=0130 s.Time=[zeros(s.Camera.FirstFrameIndexI,size(s.Time,2)); s.Time]; %insert a horizontal line of zeros131 end132 end133 75 134 76 function [s,errormsg]=read_subtree(subt,Data,NbOccur,NumTest) -
trunk/src/series.m
r1148 r1150 1420 1420 %% create the Action fct handle if RunMode option = 'local' 1421 1421 if strcmp(RunMode,'local') 1422 if ~isequal(ActionPath,path_series) 1423 eval(['spath=which(''' ActionName ''');']) %spath = current path of the selected function ACTION 1424 if ~exist(ActionPath,'dir') 1425 errormsg=['The prescribed function path ' ActionPath ' does not exist']; 1426 return 1427 end 1428 if ~isequal(spath,ActionPath) 1429 addpath(ActionPath)% add the prescribed path if not the current one 1430 end 1431 end 1432 eval(['h_fun=@' ActionName ';'])%create a function handle for ACTION 1433 if ~isequal(ActionPath,path_series) 1434 rmpath(ActionPath)% add the prescribed path if not the current one 1435 end 1436 end 1422 current_dir=pwd; % current working dir 1423 cd(ActionPath) 1424 h_fun=str2func(ActionName);% create the function handle for the function ActionName 1425 cd(current_dir) 1426 % if ~isequal(ActionPath,path_series) 1427 % 1428 % %eval(['spath=which(''' ActionName ''');']) %spath = current path of the selected function ACTION 1429 % if ~exist(ActionPath,'dir') 1430 % errormsg=['The prescribed function path ' ActionPath ' does not exist']; 1431 % return 1432 % end 1433 % spath=fileparts(which(ActionName)); 1434 % if ~strcmp(spath,ActionPath) 1435 % addpath(ActionPath)% add the prescribed path if not the current one 1436 % end 1437 % end 1438 % eval(['h_fun=@' ActionName ';'])%create a function handle for ACTION 1439 % if ~isequal(ActionPath,path_series) 1440 % rmpath(ActionPath)% add the prescribed path if not the current one 1441 % end 1442 end 1437 1443 1438 1444 %% Get parameters from series.xml -
trunk/src/series/civ_3D.m
r1148 r1150 290 290 par_civ1.ImageB=zeros(2*SearchRange_z+1,npy,npx); 291 291 292 for islice= ceil(par_civ1.Dz/2):par_civ1.Dz:NbSlice293 if par_civ1.Dz<2*SearchRange_z+1 292 for islice=par_civ1.Dz:NbSlice 293 if par_civ1.Dz<2*SearchRange_z+1 294 294 par_civ1.ImageA=circshift(par_civ1.ImageA,-par_civ1.Dz); 295 295 par_civ1.ImageB=circshift(par_civ1.ImageA,-par_civ1.Dz); 296 296 end 297 297 for iz=1:par_civ1.Dz 298 ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ1( ifield),[],j1_series_Civ1(ifield,islice));298 ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ1(1,ifield),[],j1_series_Civ1(islice+SearchRange_z-iz+1,1)); 299 299 A= read_image(ImageName_A,FileType_A); 300 ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ1( ifield),[],j2_series_Civ1(ifield,islice));300 ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ1(1,ifield),[],j1_series_Civ1(islice+SearchRange_z-iz+1,1)); 301 301 B= read_image(ImageName_B,FileType_B); 302 302 par_civ1.ImageA(2*SearchRange_z+2-iz,:,:) = A; -
trunk/src/xml2struct.m
r1127 r1150 59 59 else 60 60 tsub=branch(t,uid_sub); 61 if ~isempty(get(tsub,1,'contents')) 61 62 ss=convert(tsub); 62 63 s.(varargin{isub})=convert_string(ss); 64 end 63 65 end 64 66 end -
trunk/src/xmlburst2time.m
r1149 r1150 5 5 if ~iscell(BurstTiming) 6 6 BurstTiming={BurstTiming}; 7 BurstTiming{1}.Time=0;%time origin set to zero by default8 7 end 9 8 TimeMatrix=[]; … … 12 11 if isfield(BurstTiming{k},'FrameFrequency') 13 12 Frequency=BurstTiming{k}.FrameFrequency; 13 end 14 if isfield(BurstTiming{k},'Time') 15 BurstTiming{k}.Time=0;%time origin set to zero by default 14 16 end 15 17 Dtj=[]; … … 58 60 end 59 61 TimeMatrix=[zeros(size(TimeMatrix,1),1) TimeMatrix]; %insert a vertical line of zeros (to deal with zero file indices) 60 62 if FirstFrameIndexI~=0 61 63 TimeMatrix=[zeros(FirstFrameIndexI,size(TimeMatrix,2)); TimeMatrix]; %insert a horizontal line of zeros 62 64 end
Note: See TracChangeset
for help on using the changeset viewer.