- Timestamp:
- May 23, 2013, 12:33:52 AM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_file_series.m
r639 r643 70 70 if isempty(incr_i) 71 71 if isempty(first_j) || isempty(incr_j) % no j index or no defined increment for j 72 [ref_j,ref_i]=find(i1_series{iview}); 72 ref_j=find(max(i1_series{iview},[],2)); 73 ref_i=find(max(i1_series{iview},[],1)); 73 74 ref_i=ref_i-1; 74 75 ref_j=ref_j-1; … … 77 78 else 78 79 ref_j=first_j:incr_j:last_j; 79 [tild,ref_i]=find(i1_series{iview}(:,ref_j));80 ref_i=find(max(i1_series{iview}(:,ref_j),[],1)); 80 81 ref_i=ref_i-1; 81 82 ref_i=ref_i(ref_i>=first_i & ref_i<=last_i); … … 84 85 ref_i=first_i:incr_i:last_i;%default 85 86 if isempty(first_j) ||isempty(incr_j)% no j index or no defined increment for j 86 [ref_j,tild]=find(i1_series{iview});87 ref_j=find(max(i1_series{iview},[],2)); 87 88 ref_j=ref_j-1; 88 89 ref_j=ref_j(ref_j>=first_j & ref_j<=last_j); -
trunk/src/series.m
r639 r643 448 448 %------------------------------------------------------------------------ 449 449 InputTable=get(handles.InputTable,'Data'); 450 view_set=get(handles.REFRESH,'UserData');% list of lines to refresh450 % view_set=get(handles.REFRESH,'UserData');% list of lines to refresh 451 451 set(handles.REFRESH,'BackgroundColor',[1 1 0])% set REFRESH button to yellow color (indicate activation) 452 452 drawnow 453 for iview=view_set 453 empty_line=false(size(InputTable,1),1); 454 for iline=1:size(InputTable,1) 455 empty_line(iline)= isempty(cell2mat(InputTable(iline,1:3))); 456 end 457 InputTable(empty_line,:)=[];%remove empty lines 458 set(handles.InputTable,'Data',InputTable) 459 for iview=1:size(InputTable,1) 454 460 RootPath=fullfile(InputTable{iview,1},InputTable{iview,2}); 455 461 if ~exist(RootPath,'dir') 456 462 i1_series=[]; 457 RootPath=fileparts(RootPath); %will try the upped forld r463 RootPath=fileparts(RootPath); %will try the upped forlder 458 464 else 459 465 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,FileInfo,MovieObject]=... … … 474 480 set(handles.REFRESH,'Visible','off') 475 481 set(handles.REFRESH_title,'Visible','off') 476 set(handles.REFRESH,'UserData',[])482 % set(handles.REFRESH,'UserData',[]) 477 483 478 484 %------------------------------------------------------------------------ … … 864 870 check_burst=cellfun(@isempty,regexp(PairString,'^j'));%=0 for burst case, 1 otherwise 865 871 % check_nopair=cellfun(@isempty,PairString); 866 if isempty(find(check_burst ))% if all pair string begins by j (burst)872 if isempty(find(check_burst, 1))% if all pair string begins by j (burst) 867 873 status_j='off'; % no j index needed for bust case 868 874 end … … 876 882 xI=0.5:Position(3)-0.5; 877 883 nbview=numel(SeriesData.i1_series); 878 pair_max=cell(1,nbview); 884 j_max=cell(1,nbview); 885 MaxIndex_i=ones(1,nbview);%default 886 MinIndex_i=ones(1,nbview);%default 879 887 for iview=1:nbview 880 pair_max{iview}=squeeze(max(SeriesData.i1_series{iview},[],1)); %max on pair index 881 if (strcmp(get(handles.num_first_j,'Visible'),'off')&& size(pair_max{iview},2)~=1) 882 pair_max{iview}=squeeze(max(pair_max{iview},[],1)); % consider only the i index 883 end 884 index_min(iview)=find(pair_max{iview}>0, 1 ); 885 index_max(iview)=find(pair_max{iview}>0, 1, 'last' ); 886 end 887 index_min=min(index_min); 888 index_max=max(index_max); 889 range_index=index_max-index_min+1; 890 scale_y=Position(4)/nbview; 891 scale_x=Position(3)/range_index; 892 x=(0.5:range_index-0.5)*Position(3)/range_index; 888 pair_max=squeeze(max(SeriesData.i1_series{iview},[],1)); %max on pair index 889 j_max{iview}=max(pair_max,[],1);%max on j index 890 MaxIndex_i(iview)=max(find(j_max{iview}))-1;% max ref index i 891 MinIndex_i(iview)=min(find(j_max{iview}))-1;% min ref index i 892 % pair_max{iview}=squeezSeriesData.i1_series{iview},[],1)); %max on pair index 893 % if (strcmp(get(handles.num_first_j,'Visible'),'off')&& size(pair_max{iview},2)~=1) 894 % pair_max{iview}=squeeze(max(pair_max{iview},[],1)); % consider only the i index 895 % end 896 end 897 MinIndex_i=min(MinIndex_i); 898 MaxIndex_i=max(MaxIndex_i); 899 range_index=MaxIndex_i-MinIndex_i+1; 900 % scale_y=Position(4)/nbview; 901 % scale_x=Position(3)/range_index; 902 %x=(0.5:range_index-0.5)*Position(3)/range_index;% set of abscissa representing the whole i index range 893 903 % y=(0.5:nbview-0.5)*Position(4)/nbview; 894 904 range_y=max(1,floor(Position(4)/nbview)); 895 CData=zeros(nbview*range_y,floor(Position(3))); 905 npx=floor(Position(3)); 906 file_indices=MinIndex_i+floor(((0.5:npx-0.5)/npx)*range_index)+1; 907 CData=zeros(nbview*range_y,npx);% initiate the image representing the existing files 896 908 for iview=1:nbview 897 909 ind_y=1+(iview-1)*range_y:iview*range_y; 898 LineData=zeros(1,range_index); 899 x_index=find(pair_max{iview}>0)-index_min+1; 900 LineData(x_index)=1; 901 if numel(x)>1 902 LineData=interp1(x,LineData,xI,'nearest'); 910 LineData=zeros(size(file_indices)); 911 file_select=file_indices(file_indices<=numel(j_max{iview})); 912 ind_select=find(file_indices<=numel(j_max{iview})); 913 LineData(ind_select)=j_max{iview}(file_select)~=0; 914 % LineData=zeros(1,range_index); 915 % x_index=find(j_max{iview}>0)-MinIndex_i; 916 % LineData(x_index)=1; 917 % if numel(x)>1 918 % LineData 919 %LineData=interp1(x,LineData,xI,'nearest'); 903 920 CData(ind_y,:)=ones(size(ind_y'))*LineData; 904 end905 end 906 CData=cat(3,zeros(size(CData)),CData,zeros(size(CData))); 921 % end 922 end 923 CData=cat(3,zeros(size(CData)),CData,zeros(size(CData)));%make color images r=0,g,b=0 907 924 set(handles.FileStatus,'CData',CData); 908 925 … … 1797 1814 empty_line=false(size(Param.InputTable,1),1); 1798 1815 for iline=1:size(Param.InputTable,1) 1799 empty_line(iline)=ise qual(Param.InputTable(iline,1:3),{'','',''});1816 empty_line(iline)=isempty(cell2mat(Param.InputTable(iline,1:3))); 1800 1817 end 1801 1818 Param.InputTable(empty_line,:)=[]; … … 2405 2422 %-------------------------------------------------------------- 2406 2423 function CheckMask_Callback(hObject, eventdata, handles) 2407 2408 2424 if get(handles.CheckMask,'Value') 2409 set(handles.Mask,'Visible','on')2410 2425 InputTable=get(handles.InputTable,'Data'); 2411 defaultname=InputTable{1,1}; 2412 MaskName=uigetfile_uvmat('select a mask image file:',defaultname); 2413 if ~isempty(MaskName) 2414 set(handles.Mask,'String',MaskName) 2415 end 2416 else 2417 set(handles.Mask,'Visible','off') 2418 set(handles.Mask,'String','') 2426 for iview=1:size(InputTable,1) 2427 RootPath=InputTable{iview,1}; 2428 SubDir=InputTable{iview,2}; 2429 MaskSubDir=regexprep(SubDir,'\..*','');%take the root part of SubDir, before the first dot '.' 2430 MaskName=fullfile(RootPath,[MaskSubDir '.mask'],'mask_1.png'); 2431 if ~exist(MaskName,'file') 2432 msgbox_uvmat('WARNING',['mask file ' MaskName ' not found']) 2433 return 2434 end 2435 end 2419 2436 end 2420 2437 %--------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.