Changeset 937 for trunk/src/series.m
- Timestamp:
- Mar 30, 2016, 11:04:43 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r935 r937 467 467 %% look for the previously opened file 'oldfile' 468 468 InputTable=get(handles.InputTable,'Data'); 469 RootPathCell=InputTable(:,1); 470 SubDirCell=InputTable(:,2); 469 if ~isempty(InputTable) 471 470 oldfile=fullfile(InputTable{1,1},InputTable{1,2}); 472 if isempty(oldfile) 471 else 473 472 % use a file name stored in prefdir 474 473 dir_perso=prefdir; … … 476 475 if exist(profil_perso,'file') 477 476 h=load (profil_perso); 478 if isfield(h,' RootPath') && ischar(h.RootPath)479 oldfile=h. RootPath;477 if isfield(h,'MenuCampaign') && ~isempty(h.MenuCampaign)&& ischar(h.MenuCampaign{1}) 478 oldfile=h.MenuCampaign{1}; 480 479 end 481 480 end … … 519 518 REFRESH_Callback(hObject, eventdata, handles) 520 519 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 % % return542 % % end543 % OutPut=browse_data(oldfile);% open the GUI browse_data to get select a campaign dir, experiment and device544 % if ~isfield(OutPut,'Campaign')545 % return546 % end547 % DirName=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.DataSeries{1});548 % ListStruct=dir(DirName); %list files and the dir DataSeries549 % % select the first appropriate file in the dir550 % FileName='';551 % for ilist=1:numel(ListStruct)552 % if ~isequal(ListStruct(ilist).isdir,1)%look for files, not dir553 % FileName=ListStruct(ilist).name;554 % FileInfo=get_file_info(fullfile(DirName,FileName));555 % switch FileInfo.FileType556 % case {'image','multimage','civx','civdata','netcdf'}557 % break558 % end559 % end560 % end561 % if isempty(FileName)562 % msgbox_uvmat('ERROR',['no appropriate input file in the DataSeries folder ' fullfile(DirName)])563 % return564 % end565 %566 % %% update the list of campaigns in the menubar567 % 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 found571 % MenuCampaign(end)=[]; %suppress the last item572 % MenuCampaign=[{DirName};MenuCampaign];%insert the new campaign573 % for ilist=1:numel(MenuCampaign)574 % set(handles.(['MenuCampaign_' num2str(ilist)]),'Label',MenuCampaign{ilist})575 % end576 % % 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 uvmat581 % else582 % save (profil_perso,'MenuCampaign','-V6'); %store the file names for future opening of uvmat583 % end584 % end585 %586 % %% display the selected field and related information587 % if get(handles.CheckAppend,'Value')588 % display_file_name(handles,fullfile(DirName,FileName),'append')589 % else590 % display_file_name(handles,fullfile(DirName,FileName),'one')591 % end592 % set(handles.MenuOpenCampaign,'ForegroundColor',[0 0 0])593 594 520 % -------------------------------------------------------------------- 595 521 function MenuCampaign_Callback(hObject, eventdata, handles) 596 522 % -------------------------------------------------------------------- 597 set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0]) 523 598 524 OutPut=browse_data(get(hObject,'Label'),'on','on');% open the GUI browse_data to get select a campaign dir, experiment and device 599 525 if ~isfield(OutPut,'Campaign') … … 636 562 set(handles.InputTable,'Data',InputTable) 637 563 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 dirs642 % for ilist=1:numel(hdir)643 % if ~isequal(hdir(ilist).isdir,1)%look for files, not dir644 % FileName=hdir(ilist).name;645 % FileInfo=get_file_info(fullfile(DirName,FileName));646 % switch FileInfo.FileType647 % case {'image','multimage','civx','civdata','netcdf'}648 % break649 % end650 % end651 % end652 % if get(handles.CheckAppend,'Value')653 % display_file_name(handles,fullfile(DirName,FileName),'append')654 % else655 % display_file_name(handles,fullfile(DirName,FileName),'one')656 % end657 % set(handles.MenuOpenCampaign,'ForegroundColor',[0 0 0])658 564 659 565 … … 816 722 817 723 %% enable other menus and uicontrols 818 set(handles.MenuOpenCampaign,'Enable','on')724 % set(handles.MenuOpenCampaign,'Enable','on') 819 725 set(handles.MenuCampaign_1,'Enable','on') 820 726 set(handles.MenuCampaign_2,'Enable','on') … … 1006 912 ref_i=1; 1007 913 if isfield(SeriesData,'ref_i') 1008 ref_i=SeriesData.ref_i;914 ref_i=SeriesData.ref_i; 1009 915 end 1010 916 if isempty(first_i) … … 1019 925 ref_j=1; 1020 926 if isfield(SeriesData,'ref_j') 1021 ref_j=SeriesData.ref_j;927 ref_j=SeriesData.ref_j; 1022 928 end 1023 929 if isempty(first_j) … … 1046 952 last_j=first_j; 1047 953 end 1048 set(handles.num_first_i,'String',num2str(first_i)); 954 set(handles.num_first_i,'String',num2str(first_i)); 1049 955 set(handles.num_first_j,'String',num2str(first_j)); 1050 set(handles.num_last_i,'String',num2str(last_i)); 956 set(handles.num_last_i,'String',num2str(last_i)); 1051 957 set(handles.num_last_j,'String',num2str(last_j)); 1052 958 1053 959 %% number of slices set by default 1054 NbSlice= 1;%default960 NbSlice=[];%default 1055 961 % read value set by the first series for the append mode (iwiew >1) 1056 962 if iview>1 && strcmp(get(handles.num_NbSlice,'Visible'),'on') 1057 NbSlice=str2 num(get(handles.num_NbSlice,'String'));963 NbSlice=str2double(get(handles.num_NbSlice,'String')); 1058 964 end 1059 965 … … 1061 967 TimeUnit=''; 1062 968 % read value set by the first series for the append mode (iwiew >1) 1063 if iview>1 969 if iview>1 1064 970 TimeUnit=get(handles.TimeUnit,'String'); 1065 971 end … … 1078 984 [XmlData,errormsg]=imadoc2struct(XmlFileName); 1079 985 if ~isempty(errormsg) 1080 986 msgbox_uvmat('WARNING',['error in reading ' XmlFileName ': ' errormsg]); 1081 987 end 1082 988 % read time if available 1083 989 if isfield(XmlData,'Time') 1084 990 Time=XmlData.Time; 1085 991 TimeName='xml'; 1086 992 end 1087 993 if isfield(XmlData,'Camera') 1088 if isfield(XmlData.Camera,'NbSlice')&& ~isempty(XmlData.Camera.NbSlice)1089 if iview>1 && ~isempty(NbSlice) && ~strcmp(NbSlice,XmlData.Camera.NbSlice)1090 msgbox_uvmat('WARNING','inconsistent number of slices with the first field series');1091 end1092 NbSlice=XmlData.Camera.NbSlice;% Nbre of slices from camera1093 end994 % if isfield(XmlData.Camera,'NbSlice')&& ~isempty(XmlData.Camera.NbSlice) 995 % if iview>1 && ~isempty(NbSlice) && ~strcmp(NbSlice,XmlData.Camera.NbSlice) 996 % msgbox_uvmat('WARNING','inconsistent number of slices with the first field series'); 997 % end 998 % NbSlice=XmlData.Camera.NbSlice;% Nbre of slices from camera 999 % end 1094 1000 if isfield(XmlData.Camera,'TimeUnit')&& ~isempty(XmlData.Camera.TimeUnit) 1095 1001 if iview>1 && ~isempty(TimeUnit) && ~strcmp(TimeUnit,XmlData.Camera.TimeUnit) … … 1100 1006 end 1101 1007 % number of slices 1008 if isfield(XmlData,'TranslationMotor')&& isfield(XmlData.TranslationMotor,'NbSlice') 1009 NbSlice_motor=XmlData.TranslationMotor.NbSlice; 1010 if ~isempty(NbSlice) && ~isequal(NbSlice_motor,NbSlice) 1011 msgbox_uvmat('WARNING','inconsistent Z numbers of Z indices'); 1012 else 1013 NbSlice=NbSlice_motor; 1014 end 1015 end 1016 1102 1017 if isfield(XmlData,'GeometryCalib') 1103 1018 check_calib=1; 1104 1019 if isfield(XmlData.GeometryCalib,'SliceCoord') 1105 1020 siz=size(XmlData.GeometryCalib.SliceCoord); 1106 if siz(1)>1 1107 if iview>1 && ~isempty(NbSlice) && ~strcmp(NbSlice,siz(1)) 1108 msgbox_uvmat('WARNING','inconsistent number of Z indices with the first field series'); 1109 end 1021 if ~isempty(NbSlice)&& ~isequal(size(1),NbSlice) 1022 msgbox_uvmat('WARNING','inconsistent numbers of Z indices between motor and calibration'); 1023 else 1110 1024 NbSlice=siz(1); 1111 1025 end 1112 1026 end 1113 1027 end 1114 set(handles.num_NbSlice,'String',num2str(NbSlice)) 1028 end 1029 if ~isempty(NbSlice) 1030 set(handles.num_NbSlice,'String',num2str(NbSlice)) 1031 set(handles.num_NbSlice,'Visible','on') 1115 1032 end 1116 1033 … … 2013 1930 '#!/bin/bash \n'... 2014 1931 '. /etc/sysprofile \n'... 1932 'module load matlab/8.6 \n'...% CHOICE OF MATLAB VERSION 2015 1933 'matlab -nodisplay -nosplash -nojvm -logfile ''' filelog{iprocess} ''' <<END_MATLAB \n'... 2016 1934 'addpath(''' path_series '''); \n'...
Note: See TracChangeset
for help on using the changeset viewer.