Changeset 591 for trunk/src/uvmat.m
- Timestamp:
- Mar 25, 2013, 5:43:18 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r589 r591 34 34 % .PosSetObject: position of set_object 35 35 % .PosGeometryCalib: size of set_object 36 % .NbBuiltin: nbre of functions always displayed in transform_fctmenu36 % .NbBuiltin: nbre of functions always displayed in TransformName menu 37 37 % .Object: cell array of structures representing the current projection objects, as produced by 'set_object.m'={[]} by default 38 38 % .NewSeries: =0/1 flag telling whether a new field series has been opened … … 215 215 end 216 216 217 %% load the list of previously browsed files in menus Open, Open_1 and transform_fct217 %% load the list of previously browsed files in menus Open, Open_1 and TransformName 218 218 dir_perso=prefdir; % path to the directory .matlab containing the personal data of the current user 219 219 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');% personal data file uvmat_perso.mat' in .matlab … … 240 240 end 241 241 transform_menu=[transform_menu;{'more...'}];%append the option more.. to the menu 242 set(handles. transform_fct,'String',transform_menu)% display the menu of transform fcts243 set(handles. transform_fct,'UserData',path_list)% store the corresponding list of path in UserData of uicontrol transform_fct244 set(handles. path_transform,'String','')245 set(handles. path_transform,'UserData',[])242 set(handles.TransformName,'String',transform_menu)% display the menu of transform fcts 243 set(handles.TransformName,'UserData',path_list)% store the corresponding list of path in UserData of uicontrol transform_fct 244 set(handles.TransformPath,'String','') 245 set(handles.TransformPath,'UserData',[]) 246 246 247 247 %% case of an input argument for uvmat … … 973 973 set(handles.pxcm,'String','') 974 974 set(handles.pycm,'String','') 975 set(handles. transform_fct,'Value',1); % no transform by default975 set(handles.TransformName,'Value',1); % no transform by default 976 976 else 977 977 if (isfield(GeometryCalib,'R')&& ~isequal(GeometryCalib.R(2,1),0) && ~isequal(GeometryCalib.R(1,2),0)) ||... … … 986 986 end 987 987 if ~get(handles.CheckFixLimits,'Value') 988 set(handles. transform_fct,'Value',3); % phys transform by default if fixedLimits is off988 set(handles.TransformName,'Value',3); % phys transform by default if fixedLimits is off 989 989 end 990 990 if isfield(GeometryCalib,'SliceCoord') … … 1108 1108 1109 1109 %% apply the effect of the transform fct and view the field 1110 transform=get(handles. path_transform,'UserData');1110 transform=get(handles.TransformPath,'UserData'); 1111 1111 if index==2 && (~isa(transform,'function_handle')||nargin(transform)<3) 1112 set(handles. transform_fct,'value',2); % set transform to sub_field if the current fct doe not accept two input fields1113 end 1114 transform_fct_Callback([],[],handles)1112 set(handles.TransformName,'value',2); % set transform to sub_field if the current fct doe not accept two input fields 1113 end 1114 TransformName_Callback([],[],handles) 1115 1115 mask_test=get(handles.CheckMask,'value'); 1116 1116 if mask_test … … 1413 1413 end 1414 1414 %px to phys or other transform on field 1415 menu_transform=get(handles. transform_fct,'String');1416 choice_value=get(handles. transform_fct,'Value');1415 menu_transform=get(handles.TransformName,'String'); 1416 choice_value=get(handles.TransformName,'Value'); 1417 1417 transform_name=menu_transform{choice_value};%name of the transform fct given by the menu 'transform_fct' 1418 transform=get(handles. path_transform,'UserData');1418 transform=get(handles.TransformPath,'UserData'); 1419 1419 if ~isequal(transform_name,'') && ~isequal(transform_name,'px') 1420 1420 if isfield(UvData,'XmlData') && isfield(UvData.XmlData{1},'GeometryCalib')%use geometry calib recorded from the ImaDoc xml file as first priority … … 1947 1947 1948 1948 %px to phys or other transform on field 1949 transform=get(handles. path_transform,'UserData');1949 transform=get(handles.TransformPath,'UserData'); 1950 1950 if ~isempty(transform) 1951 1951 if isfield(UvData,'XmlData') && numel(UvData.XmlData)>=index %use geometry calib recorded from the ImaDoc xml file as first priority … … 2420 2420 2421 2421 %% apply coordinate transform or other user fct 2422 transform=get(handles. path_transform,'UserData');2422 transform=get(handles.TransformPath,'UserData'); 2423 2423 if isempty(transform) 2424 2424 UvData.Field=Field{1}; … … 2432 2432 end 2433 2433 end 2434 transform=get(handles. path_transform,'UserData');2434 transform=get(handles.TransformPath,'UserData'); 2435 2435 switch nargin(transform) 2436 2436 case 4 … … 2999 2999 end 3000 3000 set(handles.uvmat,'UserData',UvData); 3001 transform_fct_list=get(handles. transform_fct,'String');3002 transform_fct=transform_fct_list(get(handles. transform_fct,'Value'));3001 transform_fct_list=get(handles.TransformName,'String'); 3002 transform_fct=transform_fct_list(get(handles.TransformName,'Value')); 3003 3003 if strcmp(transform_fct,'sub_field') 3004 set(handles. transform_fct,'Value',1)%suppress the sub_field transform3004 set(handles.TransformName,'Value',1)%suppress the sub_field transform 3005 3005 transform_fct_Callback(hObject, eventdata, handles); 3006 3006 else … … 3301 3301 UvData.FileType{2}=UvData.FileType{1}; 3302 3302 UvData.XmlData{2}= UvData.XmlData{1}; 3303 transform=get(handles. path_transform,'UserData');3303 transform=get(handles.TransformPath,'UserData'); 3304 3304 if (~isa(transform,'function_handle')||nargin(transform)<3) 3305 3305 set(handles.uvmat,'UserData',UvData) 3306 set(handles. transform_fct,'value',2); % set transform fct to 'sub_field' if the current fct does not accept two input fields3306 set(handles.TransformName,'value',2); % set transform fct to 'sub_field' if the current fct does not accept two input fields 3307 3307 transform_fct_Callback(hObject, eventdata, handles)% activate transform_fct_Callback and refresh current plot 3308 3308 check_refresh=0; … … 3400 3400 UvData.XmlData{2}= UvData.XmlData{1}; 3401 3401 set(handles.SubField,'Value',1) 3402 transform=get(handles. path_transform,'UserData');3402 transform=get(handles.TransformPath,'UserData'); 3403 3403 if (~isa(transform,'function_handle')||nargin(transform)<3) 3404 3404 set(handles.uvmat,'UserData',UvData) 3405 set(handles. transform_fct,'value',2); % set transform fct to 'sub_field' if the current fct does not accept two input fields3405 set(handles.TransformName,'value',2); % set transform fct to 'sub_field' if the current fct does not accept two input fields 3406 3406 transform_fct_Callback(hObject, eventdata, handles)% activate transform_fct_Callback and refresh current plot 3407 3407 else … … 3606 3606 %------------------------------------------------------------------ 3607 3607 %------------------------------------------------------------- 3608 % --- Executes on selection change in transform_fct.3609 3610 function transform_fct_Callback(hObject, eventdata, handles)3608 % --- Executes on selection change in TransformName. 3609 3610 function TransformName_Callback(hObject, eventdata, handles) 3611 3611 %------------------------------------------------------------- 3612 3612 UvData=get(handles.uvmat,'UserData'); 3613 menu=get(handles. transform_fct,'String');refresh3614 ichoice=get(handles. transform_fct,'Value');%item number in the menu3613 menu=get(handles.TransformName,'String');refresh 3614 ichoice=get(handles.TransformName,'Value');%item number in the menu 3615 3615 transform_name=menu{ichoice};% choice of the transform fct 3616 list_path=get(handles. transform_fct,'UserData');3616 list_path=get(handles.TransformName,'UserData'); 3617 3617 3618 3618 %% add a new item to the menu if the option 'more...' has been selected 3619 prev_path=fullfile(get(handles. path_transform,'String'));3619 prev_path=fullfile(get(handles.TransformPath,'String')); 3620 3620 if ~exist(prev_path,'dir') 3621 3621 prev_path=fullfile(fileparts(which('uvmat')),'transform_field'); … … 3641 3641 end 3642 3642 list_path{ichoice}=PathName;%update the list fo fct paths 3643 set(handles. transform_fct,'String',menu)3644 set(handles. transform_fct,'Value',ichoice)3643 set(handles.TransformName,'String',menu) 3644 set(handles.TransformName,'Value',ichoice) 3645 3645 3646 3646 % save the new menu in the personal file 'uvmat_perso.mat' … … 3672 3672 cd(current_dir) 3673 3673 end 3674 set(handles. path_transform,'String',list_path{ichoice})3675 set(handles. path_transform,'UserData',transform_handle)3676 set(handles. transform_fct,'UserData',list_path)3677 3678 %% update the ToolTip string of the menu transform_fctwith the first line of the selected fct file3674 set(handles.TransformPath,'String',list_path{ichoice}) 3675 set(handles.TransformPath,'UserData',transform_handle) 3676 set(handles.TransformName,'UserData',list_path) 3677 3678 %% update the ToolTip string of the menu TransformName with the first line of the selected fct file 3679 3679 if isempty(list_path{ichoice})% case of no selected fct 3680 set(handles. transform_fct,'ToolTipString','transform_fct:choose a transform function')3680 set(handles.TransformName,'ToolTipString','transform_fct:choose a transform function') 3681 3681 else 3682 3682 try … … 3684 3684 InputText=textscan(fid,'%s',1,'delimiter','\n'); 3685 3685 fclose(fid) 3686 set(handles. transform_fct,'ToolTipString',['transform_fct: ' InputText{1}{1}])% put the first line of the selected function as tooltip help3686 set(handles.TransformName,'ToolTipString',['transform_fct: ' InputText{1}{1}])% put the first line of the selected function as tooltip help 3687 3687 end 3688 3688 end … … 5066 5066 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt]; 5067 5067 UvData=get(handles.uvmat,'UserData'); 5068 % CoordList=get(handles. transform_fct,'String');5069 % val=get(handles. transform_fct,'Value');5068 % CoordList=get(handles.TransformName,'String'); 5069 % val=get(handles.TransformName,'Value'); 5070 5070 set_grid(FileName,UvData.Field);% call the set_object interface 5071 5071 … … 5089 5089 function MenuSeries_Callback(hObject, eventdata, handles) 5090 5090 %------------------------------------------------------------------------ 5091 series; %first display of the GUI to fill waiting time5092 5091 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles); 5093 5092 Param.FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];%first input file name … … 5128 5127 end 5129 5128 Param.index_fields_1=find(strcmp(FieldName_1,Param.list_fields_1));% selected string index 5130 Param.transform_str=get(handles.transform_fct,'String');5131 Param. transform_val=get(handles.transform_fct,'Value');5129 TransformList=get(handles.TransformName,'String'); 5130 Param.TransformName=TransformList{get(handles.TransformName,'Value')}; 5132 5131 Param.Coord_x_str=get(handles.Coord_x,'String'); 5133 5132 Param.Coord_x_val=get(handles.Coord_x,'Value'); … … 5165 5164 % --- Executes on button press in CheckColorBar. 5166 5165 function CheckColorBar_Callback(hObject, eventdata, handles) 5166 5167 5168 5169 function TransformPath_Callback(hObject, eventdata, handles) 5170 % hObject handle to TransformPath (see GCBO) 5171 % eventdata reserved - to be defined in a future version of MATLAB 5172 % handles structure with handles and user data (see GUIDATA) 5173 5174 % Hints: get(hObject,'String') returns contents of TransformPath as text 5175 % str2double(get(hObject,'String')) returns contents of TransformPath as a double
Note: See TracChangeset
for help on using the changeset viewer.