Changeset 428 for trunk/src/uvmat.m


Ignore:
Timestamp:
May 19, 2012, 12:38:14 PM (9 years ago)
Author:
sommeria
Message:

bugs fixed. Introduction of transparency and axis aspect ratio in uvmat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r427 r428  
    16111611sub_value= get(handles.SubField,'Value');
    16121612if sub_value % a second input file has been entered
    1613     [FileName_1,RootPath_1,filebase_1,FileIndices_1,FileExt_1,SubDir_1]=read_file_boxes_1(handles);
    1614     [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(FileIndices_1);
    1615     NomType_1=get(handles.NomType_1,'String');
     1613     [InputFile.RootPath_1,InputFile.SubDir_1,InputFile.RootFile_1,InputFile.FileIndex_1,InputFile.FileExt_1,InputFile.NomType_1]=read_file_boxes_1(handles);   
     1614    [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(InputFile.FileIndex_1);
     1615%     InputFile.NomType_1=get(handles.NomType_1,'String');
    16161616else
    16171617    filename_1=[];
     
    17421742filename=fullfile_uvmat(InputFile.RootPath,InputFile.SubDir,InputFile.RootFile,FileExt,NomType,i1,i2,j1,j2);
    17431743if sub_value
    1744     filename_1=fullfile_uvmat(InputFile.RootPath_1,InputFile.SubDir_1,InputFile.RootFile_1,FileExt_1,NomType_1,i1_1,i2_1,j1_1,j2_1);
     1744    filename_1=fullfile_uvmat(InputFile.RootPath_1,InputFile.SubDir_1,InputFile.RootFile_1,InputFile.FileExt_1,InputFile.NomType_1,i1_1,i2_1,j1_1,j2_1);
    17451745end
    17461746
     
    17621762        set(handles.j2,'String',num2stra(j2,NomType,2));
    17631763    end
    1764    % [indices]=name_generator('',i1,j1,'',NomType,1,i2,j2,'');
    17651764    indices=fullfile_uvmat('','','','',NomType,i1,i2,j1,j2);
    17661765    set(handles.FileIndex,'String',indices);
    17671766    if ~isempty(filename_1)
    1768         indices_1=fullfile_uvmat('','','','',NomType_1,i1_1,i2_1,j1_1,j2_1);
    1769         %indices_1=name_generator('',i1_1,j1_1,'',NomType_1,1,i2_1,j2_1,'');
     1767        indices_1=fullfile_uvmat('','','','',InputFile.NomType_1,i1_1,i2_1,j1_1,j2_1);
    17701768        set(handles.FileIndex_1,'String',indices_1);
    17711769    end
     
    21052103            end
    21062104    end
     2105    if isequal(get(handles.NomType_1,'Visible'),'on')
    21072106    NomType_1=get(handles.NomType_1,'String');
     2107    else
     2108        NomType_1=get(handles.NomType,'String');
     2109    end
    21082110    test_keepdata_1=0;% test for keeping the previous stored data if the input files are unchanged
    21092111    if ~isequal(NomType_1,'*')%in case of a series of files (not avi movie)
     
    26382640        PlotParam{imap}.Scalar.CheckBW=[]; %B/W option depends on the input field (image or scalar)
    26392641        if isfield(ObjectData,'CoordUnit')
    2640         PlotParam{imap}.Coordinates.CheckFixEqual=1;% set x and y scaling equal if CoordUnit is defined (common unit for x and y)
     2642        PlotParam{imap}.Coordinates.CheckFixAspectRatio=1;% set x and y scaling equal if CoordUnit is defined (common unit for x and y)
     2643        PlotParam{imap}.Coordinates.AspectRatio=1; %set aspect ratio to 1
    26412644        end
    26422645    end
     
    28832886indy=1+round((nxy(1)-1)*(y12-rangy0(1))/(rangy0(2)-rangy0(1)));% index y of pixel
    28842887
     2888
     2889%-------------------------------------------------------------------
     2890% --- Executes on button press in 'CheckZoom'.
     2891%-------------------------------------------------------------------
     2892function CheckZoom_Callback(hObject, eventdata, handles)
     2893
     2894if (get(handles.CheckZoom,'Value') == 1);
     2895    set(handles.CheckZoom,'BackgroundColor',[1 1 0])
     2896    set(handles.CheckFixLimits,'Value',1)% propose by default fixed limits for the plotting axes
     2897    set(handles.CheckFixLimits,'BackgroundColor',[1 1 0])
     2898else
     2899    set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
     2900end
     2901
    28852902%-------------------------------------------------------------------
    28862903% --- Executes on button press in 'CheckFixLimits'.
     
    28962913
    28972914%-------------------------------------------------------------------
    2898 % --- Executes on button press in CheckFixEqual.
    2899 function CheckFixEqual_Callback(hObject, eventdata, handles)
    2900 if get(handles.CheckFixEqual,'Value')
    2901     set(handles.CheckFixEqual,'BackgroundColor',[1 1 0])
     2915% --- Executes on button press in CheckFixAspectRatio.
     2916function CheckFixAspectRatio_Callback(hObject, eventdata, handles)
     2917%-------------------------------------------------------------------
     2918if get(handles.CheckFixAspectRatio,'Value')
     2919    set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])
    29022920    update_plot(handles);
    29032921else
    2904     set(handles.CheckFixEqual,'BackgroundColor',[0.7 0.7 0.7])
     2922    set(handles.CheckFixAspectRatio,'BackgroundColor',[0.7 0.7 0.7])
    29052923    update_plot(handles);
    29062924end
    29072925
    29082926%-------------------------------------------------------------------
    2909 
     2927function num_AspectRatio_Callback(hObject, eventdata, handles)
    29102928%-------------------------------------------------------------------
    2911 % --- Executes on button press in 'CheckZoom'.
     2929set(handles.CheckFixAspectRatio,'Value',1)% select the fixed aspect ratio button
     2930set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])% mark in yellow
     2931update_plot(handles);
    29122932%-------------------------------------------------------------------
    2913 function CheckZoom_Callback(hObject, eventdata, handles)
    2914 
    2915 if (get(handles.CheckZoom,'Value') == 1);
    2916     set(handles.CheckZoom,'BackgroundColor',[1 1 0])
    2917     set(handles.CheckFixLimits,'Value',1)% propose by default fixed limits for the plotting axes
    2918     set(handles.CheckFixLimits,'BackgroundColor',[1 1 0])
    2919 else
    2920     set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
    2921 end
     2933
     2934%-------------------------------------------------------------------
     2935
     2936
    29222937
    29232938%-------------------------------------------------------------------
     
    29822997fin=close(nc);
    29832998
    2984 %---------------------------------------------------
     2999%-------------------------------------------------------------------
    29853000% --- Executes on button press in SubField
    29863001function SubField_Callback(hObject, eventdata, handles)
    2987 % huvmat=get(handles.run0,'parent');
     3002%-------------------------------------------------------------------
    29883003UvData=get(handles.uvmat,'UserData');
    29893004if get(handles.SubField,'Value')==0% if the subfield button is desactivated   
     
    30023017    set(handles.Fields_1,'Value',1);%set to blank state
    30033018    set(handles.VelType_1,'Value',1);%set to blank state
     3019    set(handles.num_Opacity,'String','')% desactivate opacity setting
    30043020    if ~strcmp(get(handles.VelType,'Visible'),'on')
    30053021        set(handles.VelType_1,'Visible','off')
     
    31723188if isempty(field_1)%||(numel(UvData.FileType)>=2 && strcmp(UvData.FileType{2},'image'))
    31733189    set(handles.SubField,'Value',0)
    3174 %     check_new=1;
    31753190    SubField_Callback(hObject, eventdata, handles)
    3176 %     if isempty(field_1)%remove second field if 'blank' field is selected
    3177         return
    3178 %     end
     3191    return
    31793192else
    31803193    set(handles.SubField,'Value',1)%state that a second field is now entered
     
    32013214        set(handles.transform_fct,'Value',1)% no transform by default
    32023215        set(handles.path_transform,'String','')
     3216        if check_new
     3217            UvData.FileType{2}=UvData.FileType{1};
     3218            set(handles.FileIndex_1,'String',get(handles.FileIndex,'String'))
     3219%             set(handles.FileExt_1,'String',get(handles.FileExt,'String'))
     3220              set(handles.uvmat,'UserData',UvData)
     3221        end
    32033222    case 'image'
    32043223        % guess the image name corresponding to the current netcdf name (no unique correspondance)
     
    37083727%-------------------------------------------------------------------
    37093728update_plot(handles);
     3729
     3730%-------------------------------------------------------------------
     3731function num_Opacity_Callback(hObject, eventdata, handles)
     3732update_plot(handles);
     3733%-------------------------------------------------------------------
    37103734
    37113735%-------------------------------------------------------------------
     
    47864810    web(helpfile);
    47874811end
    4788 
    4789 
    4790 % --- Executes on slider movement.
    4791 function slider7_Callback(hObject, eventdata, handles)
    4792 % hObject    handle to slider7 (see GCBO)
    4793 % eventdata  reserved - to be defined in a future version of MATLAB
    4794 % handles    structure with handles and user data (see GUIDATA)
    4795 
    4796 % Hints: get(hObject,'Value') returns position of slider
    4797 %        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
Note: See TracChangeset for help on using the changeset viewer.