Changeset 644 for trunk/src/series.m


Ignore:
Timestamp:
May 28, 2013, 11:30:01 PM (8 years ago)
Author:
sommeria
Message:

various improvements: resize GUI uvmat, projection on lines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r643 r644  
    10731073
    10741074%% set the waitbar position with respect to the min and max in the series
    1075 for iview=1:numel(SeriesData.i1_series)
    1076     pair_max{iview}=squeeze(max(SeriesData.i1_series{iview},[],1)); %max on pair index
    1077     if (strcmp(get(handles.num_first_j,'Visible'),'off')&& size(pair_max{iview},2)~=1)
    1078         pair_max{iview}=squeeze(max(pair_max{iview},[],1)); % consider only the i index
    1079     end
    1080     pair_max{iview}=reshape(pair_max{iview},1,[]);
    1081     index_min(iview)=find(pair_max{iview}>0, 1 );
    1082     index_max(iview)=find(pair_max{iview}>0, 1, 'last' );
    1083 end
    1084 [index_min,iview_min]=min(index_min);
    1085 [index_max,iview_max]=min(index_max);
    1086 if size(SeriesData.i1_series{iview_min},2)==1% movie
    1087     index_first=ref_i(1);
    1088     index_last=ref_i(2);
    1089 else
    1090     index_first=(ref_i(1)-1)*(size(SeriesData.i1_series{iview_min},1))+ref_j(1)+1;
    1091     index_last=(ref_i(2)-1)*(size(SeriesData.i1_series{iview_max},1))+ref_j(2)+1;
    1092 end
    1093 range=index_max-index_min+1;
    1094 coeff_min=(index_first-index_min)/range;
    1095 coeff_max=(index_last-index_min+1)/range;
     1075MinIndex_i=min(get(handles.MinIndex_i,'Data'));
     1076MaxIndex_i=max(get(handles.MaxIndex_i,'Data'));
     1077pos_first=(ref_i(1)-MinIndex_i)/(MaxIndex_i-MinIndex_i+1);
     1078pos_last=(ref_i(2)-MinIndex_i+1)/(MaxIndex_i-MinIndex_i+1);
    10961079Position=get(handles.Waitbar,'Position');% position of the waitbar:= [ x,y, width, height]
    10971080Position_status=get(handles.FileStatus,'Position');
    1098 Position(1)=coeff_min*Position_status(3)+Position_status(1);
    1099 Position(3)=Position_status(3)*(coeff_max-coeff_min);
     1081Position(1)=Position_status(1)+Position_status(3)*pos_first;
     1082Position(3)=Position_status(3)*(pos_last-pos_first);
    11001083set(handles.Waitbar,'Position',Position)
    11011084update_waitbar(handles.Waitbar,0)
     1085
     1086% for iview=1:numel(SeriesData.i1_series)
     1087%     pair_max{iview}=squeeze(max(SeriesData.i1_series{iview},[],1)); %max on pair index
     1088%     if (strcmp(get(handles.num_first_j,'Visible'),'off')&& size(pair_max{iview},2)~=1)
     1089%         pair_max{iview}=squeeze(max(pair_max{iview},[],1)); % consider only the i index
     1090%     end
     1091%     pair_max{iview}=reshape(pair_max{iview},1,[]);
     1092%     index_min(iview)=find(pair_max{iview}>0, 1 );
     1093%     index_max(iview)=find(pair_max{iview}>0, 1, 'last' );
     1094% end
     1095% [index_min,iview_min]=min(index_min);
     1096% [index_max,iview_max]=min(index_max);
     1097% if size(SeriesData.i1_series{iview_min},2)==1% movie
     1098%     index_first=ref_i(1);
     1099%     index_last=ref_i(2);
     1100% else
     1101%     index_first=(ref_i(1)-1)*(size(SeriesData.i1_series{iview_min},1))+ref_j(1)+1;
     1102%     index_last=(ref_i(2)-1)*(size(SeriesData.i1_series{iview_max},1))+ref_j(2)+1;
     1103% end
     1104% range=index_max-index_min+1;
     1105% coeff_min=(index_first-index_min)/range;
     1106% coeff_max=(index_last-index_min+1)/range;
     1107% Position=get(handles.Waitbar,'Position');% position of the waitbar:= [ x,y, width, height]
     1108% Position_status=get(handles.FileStatus,'Position');
     1109% Position(1)=coeff_min*Position_status(3)+Position_status(1);
     1110% Position(3)=Position_status(3)*(coeff_max-coeff_min);
     1111% set(handles.Waitbar,'Position',Position)
     1112% update_waitbar(handles.Waitbar,0)
    11021113
    11031114%------------------------------------------------------------------------
     
    13701381set(handles.RUN,'BackgroundColor',[1 1 0])%show activation of RUN by yellow color
    13711382drawnow
     1383set(handles.status,'Value',0)% desable status display if relevant
     1384status_Callback(hObject, eventdata, handles)
    13721385
    13731386%% read the data on the GUI series
     
    18321845end
    18331846set(handles.ActionName,'BackgroundColor',[1 1 0])
     1847huigetfile=findobj(allchild(0),'tag','status_display')
     1848if ~isempty(huigetfile)
     1849    delete(huigetfile)
     1850end
    18341851drawnow
    18351852
     
    25982615    OutputDir=fullfile(RootPath,OutputSubDir);
    25992616    uigetfile_uvmat('status_display',OutputDir)
    2600    
    2601 %     hfig=findobj(allchild(0),'name','series_status');
    2602 %     if isempty(hfig)
    2603 %         ScreenSize=get(0,'ScreenSize');
    2604 %         hfig=figure('DeleteFcn',@stop_status,'Position',[ScreenSize(3)-600 ScreenSize(4)-640 560 600]);
    2605 %         set(hfig,'MenuBar','none')% suppress the menu bar
    2606 %         set(hfig,'NumberTitle','off')%suppress the fig number in the title
    2607 %         set(hfig,'name','series_status')
    2608 %         set(hfig,'tag','series_status')
    2609 %         uicontrol('Style','listbox','Units','normalized', 'Position',[0.05 0.09 0.9 0.71], 'Callback', @view_file,'tag','list','UserData',OutputDir);
    2610 %         uicontrol('Style','edit','Units','normalized', 'Position', [0.05 0.87 0.9 0.1],'tag','titlebox','Max',2,'String',OutputDir);
    2611 %         uicontrol('Style','frame','Units','normalized', 'Position', [0.05 0.81 0.9 0.05]);
    2612 %         uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.7 0.01 0.2 0.07],'String','Close','FontWeight','bold','FontUnits','points','FontSize',11,'Callback',@stop_status);
    2613 %         uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.1 0.01 0.2 0.07],'String','Refresh','FontWeight','bold','FontUnits','points','FontSize',11,'Callback',@refresh_GUI);
    2614 %         %set(hrefresh,'UserData',StatusData)
    2615 %         BarPosition=[0.05 0.81 0.01 0.05];
    2616 %         uicontrol('Style','frame','Units','normalized', 'Position',BarPosition ,'BackgroundColor',[1 0 0],'tag','waitbar');
    2617 %         drawnow
    2618 %     end
    2619 %     refresh_GUI(hfig)
    26202617else
    26212618    %% delete current display fig if selection is off
    26222619    set(handles.status,'BackgroundColor',[0 1 0])
    2623     hfig=findobj(allchild(0),'name','series_status');
     2620    hfig=findobj(allchild(0),'name','status_display');
    26242621    if ~isempty(hfig)
    26252622        delete(hfig)
Note: See TracChangeset for help on using the changeset viewer.