Changeset 1033 for trunk/src/series
- Timestamp:
- Apr 30, 2018, 8:01:35 PM (7 years ago)
- Location:
- trunk/src/series
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
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);
Note: See TracChangeset
for help on using the changeset viewer.