- Timestamp:
- Mar 28, 2016, 9:15:18 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/find_file_series.m
r924 r935 68 68 i1_series=[];i2_series=[];j1_series=[];j2_series=[]; 69 69 i1_input=1;i2_input=[];j1_input=[];j2_input=[]; 70 if ~exist(fullfileinput,'file')70 if exist(fullfileinput,'file')~=2 71 71 RootFile=''; 72 72 return -
trunk/src/get_file_info.m
r924 r935 37 37 function [FileInfo,VideoObject]=get_file_info(fileinput) 38 38 VideoObject=[]; 39 if exist(fileinput,'file') 39 if exist(fileinput,'file')==2 40 40 FileInfo.FileName=fileinput; 41 41 FileInfo.FileType='txt'; %default -
trunk/src/proj_field.m
r933 r935 951 951 PlaneAngle=[0 0 0]; 952 952 norm_plane=[0 0 1]; 953 cos_om=1;954 sin_om=0;953 %cos_om=1; 954 %sin_om=0; 955 955 test90x=0;%=1 for 90 degree rotation alround x axis 956 956 test90y=0;%=1 for 90 degree rotation alround y axis … … 1052 1052 ProjData.CoordMesh=FieldData.CoordMesh; 1053 1053 end 1054 error=0;%default1055 flux=0;1056 testfalse=0;1057 ListIndex={};1054 %error=0;%default 1055 %flux=0; 1056 %testfalse=0; 1057 %ListIndex={}; 1058 1058 1059 1059 %% group the variables (fields of 'FieldData') in cells of variables with the same dimensions … … 1340 1340 if strcmp(ProjMode{icell},'interp_tps') 1341 1341 Coord=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex}); 1342 1343 1344 coord_x=Coord(:,1,:);% initial x coordinates 1345 coord_y=Coord(:,2,:);% initial y coordinates 1346 check3D=(numel(CellInfo{icell}.CoordIndex)==3); 1347 if check3D 1348 coord_z=Coord(:,3,:); 1349 end 1350 1351 % translate initial coordinates to account for the new origin 1352 coord_x=coord_x-ObjectData.Coord(1,1); 1353 coord_y=coord_y-ObjectData.Coord(1,2); 1354 if check3D 1355 coord_z=coord_z-ObjectData.Coord(1,3); 1356 end 1357 1358 % selection of the vectors in the projection range (3D case) 1359 if check3D && width > 0 1360 %components of the unitiy vector normal to the projection plane 1361 fieldZ=norm_plane(1)*coord_x + norm_plane(2)*coord_y+ norm_plane(3)*coord_z;% distance to the plane 1362 indcut=find(abs(fieldZ) <= width); 1363 for ivar=VarIndex 1364 VarName=FieldData.ListVarName{ivar}; 1365 FieldData.(VarName)=FieldData.(VarName)(indcut); 1366 end 1367 coord_x=coord_x(indcut); 1368 coord_y=coord_y(indcut); 1369 coord_z=coord_z(indcut); 1370 end 1371 1372 %rotate coordinates if needed: coord_X,coord_Y= = coordinates in the new plane 1373 Psi=PlaneAngle(1); 1374 Theta=PlaneAngle(2); 1375 Phi=PlaneAngle(3); 1376 if testangle && ~test90y && ~test90x;%=1 for slanted plane 1377 coord_X=(coord_x *cos(Phi) + coord_y* sin(Phi)); 1378 coord_Y=(-coord_x *sin(Phi) + coord_y *cos(Phi))*cos(Theta); 1379 coord_Y=coord_Y+coord_z *sin(Theta); 1380 coord_X=(coord_X *cos(Psi) - coord_Y* sin(Psi));%A VERIFIER 1381 coord_Y=(coord_X *sin(Psi) + coord_Y* cos(Psi)); 1382 else 1383 coord_X=coord_x; 1384 coord_Y=coord_y; 1385 end 1386 1387 %restriction to the range of X and Y if imposed by the projection object 1388 1389 1390 Coord(:,1,:)=coord_X;% initial x coordinates 1391 Coord(:,2,:)=coord_Y;% initial y coordinates 1392 1393 1342 1394 NbCentres=FieldData.(FieldData.ListVarName{CellInfo{icell}.NbCentres_tps}); 1343 1395 SubRange=FieldData.(FieldData.ListVarName{CellInfo{icell}.SubRange_tps}); -
trunk/src/series.m
r934 r935 518 518 set(handles.InputTable,'Data',InputTable) 519 519 REFRESH_Callback(hObject, eventdata, handles) 520 % DataSeries=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.DataSeries{1}); 521 % fileinput=uigetfile_uvmat('pick an input file',DataSeries); 522 % hh=dir(fileinput); 523 % if numel(hh)>1 524 % msgbox_uvmat('ERROR','invalid input, probably a broken link'); 520 521 522 % %------------------------------------------------------------------------ 523 % % --- fct activated by the browser under 'Open campaign/Browse...' 524 % %------------------------------------------------------------------------ 525 % function MenuBrowseCampaignAppend_Callback(hObject, eventdata, handles) 526 % append='append'; 527 % browse_campaign(handles,append); 528 529 % %------------------------------------------------------------------------ 530 % function browse_campaign(handles,append); 531 % 532 % %% look for the previously opened file 'oldfile' 533 % 534 % % 535 % % 536 % % InputTable=get(handles.InputTable,'Data'); 537 % % RootPath=InputTable{1,1}; 538 % % CampaignPath=fileparts(fileparts(RootPath)); 539 % % DirFull=uigetfile_uvmat('define this path as the Campaign folder:',CampaignPath,'uigetdir'); 540 % % if ~ischar(DirFull)|| ~exist(DirFull,'dir') 541 % % return 542 % % end 543 % OutPut=browse_data(oldfile);% open the GUI browse_data to get select a campaign dir, experiment and device 544 % if ~isfield(OutPut,'Campaign') 545 % return 546 % end 547 % DirName=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.DataSeries{1}); 548 % ListStruct=dir(DirName); %list files and the dir DataSeries 549 % % select the first appropriate file in the dir 550 % FileName=''; 551 % for ilist=1:numel(ListStruct) 552 % if ~isequal(ListStruct(ilist).isdir,1)%look for files, not dir 553 % FileName=ListStruct(ilist).name; 554 % FileInfo=get_file_info(fullfile(DirName,FileName)); 555 % switch FileInfo.FileType 556 % case {'image','multimage','civx','civdata','netcdf'} 557 % break 558 % end 559 % end 560 % end 561 % if isempty(FileName) 562 % msgbox_uvmat('ERROR',['no appropriate input file in the DataSeries folder ' fullfile(DirName)]) 525 563 % return 526 564 % end 527 565 % 528 % 529 % 530 % %% launch the browser 531 % fileinput=uigetfile_uvmat('pick an input file in the series',oldfile); 532 % hh=dir(fileinput); 533 % if numel(hh)>1 534 % msgbox_uvmat('ERROR','invalid input, probably a broken link'); 535 % else 536 % if ~isempty(fileinput) 537 % display_file_name(handles,fileinput,'one') 566 % %% update the list of campaigns in the menubar 567 % MenuCampaign=[{get(handles.MenuCampaign_1,'Label')};{get(handles.MenuCampaign_2,'Label')};... 568 % {get(handles.MenuCampaign_3,'Label')};{get(handles.MenuCampaign_4,'Label')};{get(handles.MenuCampaign_5,'Label')}]; 569 % check_dir=isempty(find(strcmp(DirName,MenuCampaign))); 570 % if check_dir %insert the new campaign in the list if it is not found 571 % MenuCampaign(end)=[]; %suppress the last item 572 % MenuCampaign=[{DirName};MenuCampaign];%insert the new campaign 573 % for ilist=1:numel(MenuCampaign) 574 % set(handles.(['MenuCampaign_' num2str(ilist)]),'Label',MenuCampaign{ilist}) 575 % end 576 % % save the list for future opening: 577 % dir_perso=prefdir; 578 % profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 579 % if exist(profil_perso,'file') 580 % save (profil_perso,'MenuCampaign','-append'); %store the file names for future opening of uvmat 581 % else 582 % save (profil_perso,'MenuCampaign','-V6'); %store the file names for future opening of uvmat 538 583 % end 539 584 % end 540 % append='one';541 % set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0])542 % drawnow543 % browse_campaign(handles,append);544 545 %------------------------------------------------------------------------546 % --- fct activated by the browser under 'Open campaign/Browse...'547 %------------------------------------------------------------------------548 function MenuBrowseCampaignAppend_Callback(hObject, eventdata, handles)549 append='append';550 browse_campaign(handles,append);551 552 %------------------------------------------------------------------------553 function browse_campaign(handles,append);554 555 %% look for the previously opened file 'oldfile'556 557 585 % 558 % 559 % InputTable=get(handles.InputTable,'Data'); 560 % RootPath=InputTable{1,1}; 561 % CampaignPath=fileparts(fileparts(RootPath)); 562 % DirFull=uigetfile_uvmat('define this path as the Campaign folder:',CampaignPath,'uigetdir'); 563 % if ~ischar(DirFull)|| ~exist(DirFull,'dir') 564 % return 586 % %% display the selected field and related information 587 % if get(handles.CheckAppend,'Value') 588 % display_file_name(handles,fullfile(DirName,FileName),'append') 589 % else 590 % display_file_name(handles,fullfile(DirName,FileName),'one') 565 591 % end 566 OutPut=browse_data(oldfile);% open the GUI browse_data to get select a campaign dir, experiment and device 567 if ~isfield(OutPut,'Campaign') 568 return 569 end 570 DirName=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.DataSeries{1}); 571 ListStruct=dir(DirName); %list files and the dir DataSeries 572 % select the first appropriate file in the dir 573 FileName=''; 574 for ilist=1:numel(ListStruct) 575 if ~isequal(ListStruct(ilist).isdir,1)%look for files, not dir 576 FileName=ListStruct(ilist).name; 577 FileInfo=get_file_info(fullfile(DirName,FileName)); 578 switch FileInfo.FileType 579 case {'image','multimage','civx','civdata','netcdf'} 580 break 581 end 582 end 583 end 584 if isempty(FileName) 585 msgbox_uvmat('ERROR',['no appropriate input file in the DataSeries folder ' fullfile(DirName)]) 586 return 587 end 588 589 %% update the list of campaigns in the menubar 590 MenuCampaign=[{get(handles.MenuCampaign_1,'Label')};{get(handles.MenuCampaign_2,'Label')};... 591 {get(handles.MenuCampaign_3,'Label')};{get(handles.MenuCampaign_4,'Label')};{get(handles.MenuCampaign_5,'Label')}]; 592 check_dir=isempty(find(strcmp(DirName,MenuCampaign))); 593 if check_dir %insert the new campaign in the list if it is not found 594 MenuCampaign(end)=[]; %suppress the last item 595 MenuCampaign=[{DirName};MenuCampaign];%insert the new campaign 596 for ilist=1:numel(MenuCampaign) 597 set(handles.(['MenuCampaign_' num2str(ilist)]),'Label',MenuCampaign{ilist}) 598 end 599 % save the list for future opening: 600 dir_perso=prefdir; 601 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 602 if exist(profil_perso,'file') 603 save (profil_perso,'MenuCampaign','-append'); %store the file names for future opening of uvmat 604 else 605 save (profil_perso,'MenuCampaign','-V6'); %store the file names for future opening of uvmat 606 end 607 end 608 609 %% display the selected field and related information 610 if get(handles.CheckAppend,'Value') 611 display_file_name(handles,fullfile(DirName,FileName),'append') 612 else 613 display_file_name(handles,fullfile(DirName,FileName),'one') 614 end 615 set(handles.MenuOpenCampaign,'ForegroundColor',[0 0 0]) 592 % set(handles.MenuOpenCampaign,'ForegroundColor',[0 0 0]) 616 593 617 594 % -------------------------------------------------------------------- … … 619 596 % -------------------------------------------------------------------- 620 597 set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0]) 621 OutPut=browse_data(get(hObject,'Label') );% open the GUI browse_data to get select a campaign dir, experiment and device598 OutPut=browse_data(get(hObject,'Label'),'on','on');% open the GUI browse_data to get select a campaign dir, experiment and device 622 599 if ~isfield(OutPut,'Campaign') 623 600 return 624 601 end 625 DirName=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.DataSeries{1}); 626 hdir=dir(DirName); %list files and dirs 627 for ilist=1:numel(hdir) 628 if ~isequal(hdir(ilist).isdir,1)%look for files, not dir 629 FileName=hdir(ilist).name; 630 FileInfo=get_file_info(fullfile(DirName,FileName)); 631 switch FileInfo.FileType 632 case {'image','multimage','civx','civdata','netcdf'} 633 break 634 end 635 end 636 end 637 if get(handles.CheckAppend,'Value') 638 display_file_name(handles,fullfile(DirName,FileName),'append') 639 else 640 display_file_name(handles,fullfile(DirName,FileName),'one') 641 end 642 set(handles.MenuOpenCampaign,'ForegroundColor',[0 0 0]) 602 NbLines=numel(OutPut.Experiment)*numel(OutPut.DataSeries); 603 icount=0; 604 InputTable=get(handles.InputTable,'Data'); 605 for iexp=1:numel(OutPut.Experiment) 606 for idevice=1:numel(OutPut.DataSeries) 607 icount=icount+1; 608 InputTable{icount,1}=fullfile(OutPut.Campaign,OutPut.Experiment{iexp}); 609 InputTable{icount,2}=OutPut.DataSeries{idevice}; 610 if isempty(InputTable{icount,3}) 611 if icount>1 612 InputTable{icount,3}=InputTable{icount-1,3}; 613 else 614 InputTable{icount,3}=''; 615 end 616 end 617 if isempty(InputTable{icount,4}) 618 if icount>1 619 InputTable{icount,4}=InputTable{icount-1,4}; 620 else 621 InputTable{icount,4}=''; 622 end 623 end 624 if isempty(InputTable{icount,5}) 625 if icount>1 626 InputTable{icount,5}=InputTable{icount-1,5}; 627 else 628 InputTable{icount,5}=''; 629 end 630 end 631 end 632 end 633 if size(InputTable,1)>icount 634 InputTable(icount+1:size(InputTable,1),:)=[]; 635 end 636 set(handles.InputTable,'Data',InputTable) 637 REFRESH_Callback(hObject, eventdata, handles) 638 639 640 % DirName=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.DataSeries{1}); 641 % hdir=dir(DirName); %list files and dirs 642 % for ilist=1:numel(hdir) 643 % if ~isequal(hdir(ilist).isdir,1)%look for files, not dir 644 % FileName=hdir(ilist).name; 645 % FileInfo=get_file_info(fullfile(DirName,FileName)); 646 % switch FileInfo.FileType 647 % case {'image','multimage','civx','civdata','netcdf'} 648 % break 649 % end 650 % end 651 % end 652 % if get(handles.CheckAppend,'Value') 653 % display_file_name(handles,fullfile(DirName,FileName),'append') 654 % else 655 % display_file_name(handles,fullfile(DirName,FileName),'one') 656 % end 657 % set(handles.MenuOpenCampaign,'ForegroundColor',[0 0 0]) 643 658 644 659 … … 1610 1625 NbCore=1;% no need to split the calculation 1611 1626 case 'cluster_oar' 1612 if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled) 1613 NbCore=1;% one core used only (limitation of Matlab licences) 1614 answer=msgbox_uvmat('INPUT_Y-N','Number of cores =1: select the compiled version .sh for multi-core processing. Proceed with the .m version?'); 1615 if ~strcmp(answer,'Yes') 1616 errormsg='Action launch interrupted by user'; 1617 return 1618 end 1619 extra_oar=''; 1620 else 1627 %%%%% TEST A REMETTRE%%%%% 1628 % if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled) 1629 % NbCore=1;% one core used only (limitation of Matlab licences) 1630 % answer=msgbox_uvmat('INPUT_Y-N','Number of cores =1: select the compiled version .sh for multi-core processing. Proceed with the .m version?'); 1631 % if ~strcmp(answer,'Yes') 1632 % errormsg='Action launch interrupted by user'; 1633 % return 1634 % end 1635 % extra_oar=''; 1636 % else 1621 1637 answer=inputdlg({'Number of cores (max 36)','extra oar options'},'oarsub parameter',1,{'12',''}); 1622 1638 if isempty(answer) … … 1626 1642 NbCore=str2double(answer{1}); 1627 1643 extra_oar=answer{2}; 1628 end1644 % end 1629 1645 case 'cluster_pbs' 1630 1646 if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled) … … 1698 1714 DirXml=fullfile(OutputDir,'0_XML'); 1699 1715 if ~exist(DirXml,'dir') 1700 [ tild,msg1]=mkdir(DirXml);1716 [~,msg1]=mkdir(DirXml); 1701 1717 if ~strcmp(msg1,'') 1702 1718 errormsg=['cannot create ' DirXml ': ' msg1];%error message for directory creation … … 2113 2129 end 2114 2130 if exist(OutputDir,'dir') 2131 [SUCCESS,MESSAGE,MESSAGEID] = fileattrib (OutputDir) 2132 if MESSAGE.GroupWrite~=1 2115 2133 [success,msg] = fileattrib(OutputDir,'+w','g','s');% allow writing access for the group of users, recursively in the folder 2116 2134 if success==0 2117 msgbox_uvmat('WARNING',{['unable to set group write access to ' OutputDir ':']; msg1});%error message for directory creation 2135 msgbox_uvmat('WARNING',{['unable to set group write access to ' OutputDir ':']; msg});%error message for directory creation 2136 end 2118 2137 end 2119 2138 end -
trunk/src/series/extract_rdvision.m
r932 r935 469 469 NbDti=size(timestamp,1); %default for series or burst 470 470 uid_motor_nbslice=find(t,'ImaDoc/TranslationMotor/Nbslice'); 471 if ~isempty(uid_motor_nbslice) 471 uid_nbDtk=find(t,'ImaDoc/TranslationMotor/NbDtk'); 472 if ~isempty(uid_motor_nbslice)&& ~isempty(uid_nbDtk) 472 473 uid_content=get(t,uid_motor_nbslice,'contents'); 473 474 NbSlice=str2num(get(t,uid_content,'value')); 474 475 NbDti=NbSlice-1; 475 uid_NbDti=find(t,'ImaDoc/Camera/BurstTiming/NbDti');476 uid_content=get(t,uid_NbDti,'contents');477 t=set(t,uid_content,'value',num2str(NbDti));476 uid_NbDti=find(t,'ImaDoc/Camera/BurstTiming/NbDti'); 477 uid_content=get(t,uid_NbDti,'contents'); 478 t=set(t,uid_content,'value',num2str(NbDti)); 478 479 end 479 480 … … 510 511 [success,msg] = fileattrib(newxml,'+w','g');% allow writing access for the group of users 511 512 if success==0 512 msgbox_uvmat('WARNING',{['unable to set group write access to ' newxml ':']; msg 1});%error message for directory creation513 msgbox_uvmat('WARNING',{['unable to set group write access to ' newxml ':']; msg});%error message for directory creation 513 514 end 514 515 -
trunk/src/transform_field/phys_polar.m
r933 r935 67 67 DataOut.TransformInput.PolarReferenceRadius=str2num(answer{2}); 68 68 DataOut.TransformInput.PolarReferenceAngle=str2num(answer{3}); 69 if isfield(XmlData,'GeometryCalib')&& isfield(XmlData.GeometryCalib,'CoordUnit') 70 DataOut.CoordUnit=XmlData.GeometryCalib.CoordUnit;% states that the output is in unit defined by GeometryCalib, then erased all projection objects with different units 71 end 69 72 return 70 73 end -
trunk/src/uvmat.m
r934 r935 3585 3585 if isfield(UvData,'XmlData')%use geometry calib recorded from the ImaDoc xml file as first priority 3586 3586 XmlData=UvData.XmlData{1}; 3587 if isfield(UvData,'TransformInput') 3588 XmlData.TransformInput=UvData.TransformInput; 3589 end 3587 3590 if numel(UvData.XmlData)==2 3588 3591 XmlData_1=UvData.XmlData{2}; … … 4949 4952 XmlData=UvData.XmlData{1}; 4950 4953 end 4954 if isfield(UvData,'TransformInput') 4955 XmlData.TransformInput=UvData.TransformInput; 4956 end 4951 4957 UvData.Field.Action.RUN=0;% indicate that the transform fct is called only to get input param 4952 4958 DataOut=feval(transform_handle,UvData.Field,XmlData);% execute the transform fct to get the required conditions … … 4958 4964 end 4959 4965 if isfield(DataOut,'TransformInput')% used to add transform parameters at selection of the transform fct 4960 UvData. XmlData{1}.TransformInput=DataOut.TransformInput;4966 UvData.TransformInput=DataOut.TransformInput; 4961 4967 end 4962 4968 end
Note: See TracChangeset
for help on using the changeset viewer.