- Timestamp:
- Nov 29, 2010, 10:01:51 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r139 r141 193 193 194 194 %------------------------------------------------------------------------ 195 % --- Executes just before uvmat is made visible.195 % --- Executes just before the GUI uvmat is made visible. 196 196 function uvmat_OpeningFcn(hObject, eventdata, handles, input ) 197 197 %------------------------------------------------------------------------ … … 390 390 set_vec_col_bar(handles) %update the display of color code for vectors 391 391 392 %------------------------------------------------------------------- 392 %------------------------------------------------------------------------ 393 393 % --- Outputs from this function are returned to the command menuline. 394 394 function varargout = uvmat_OutputFcn(hObject, eventdata, handles) 395 395 varargout{1} = handles.output;% the only output argument is the handle to the GUI figure 396 396 397 %------------------------------------------------------------------- 398 %------------------------------------------------------------------- 399 % II - FUNCTIONS FOR INTRODUCING THE INPUT FILES397 %------------------------------------------------------------------------ 398 %------------------------------------------------------------------------ 399 % II - FUNCTIONS FOR INTRODUCING THE INPUT FILES 400 400 % automatically sets the global properties when the rootfile name is introduced 401 401 % then activate the view-field action if selected 402 402 % it is activated either by clicking on the RootPath window or by the 403 403 % browser 404 %------------------------------------------------------------------ 405 %------------------------------------------------------------------ 406 404 %------------------------------------------------------------------------ 405 %------------------------------------------------------------------------ 407 406 % --- Executes on the menu Open/Browse... 408 407 % search the files, recognize their type according to their name and fill the rootfile input windows … … 484 483 end 485 484 486 % -------------------------------------------------------------------- 485 % ----------------------------------------------------------------------- 486 % --- Open again the file whose name has been recorded in MenuFile_1 487 487 function MenuFile_1_Callback(hObject, eventdata, handles) 488 488 fileinput=get(handles.MenuFile_1,'Label'); 489 489 display_file_name(hObject, eventdata, handles,fileinput) 490 490 491 % -------------------------------------------------------------------- 491 % ----------------------------------------------------------------------- 492 % --- Open again the file whose name has been recorded in MenuFile_2 492 493 function MenuFile_2_Callback(hObject, eventdata, handles) 493 494 fileinput=get(handles.MenuFile_2,'Label'); 494 495 display_file_name(hObject, eventdata, handles,fileinput) 495 496 496 % -------------------------------------------------------------------- 497 % ----------------------------------------------------------------------- 498 % --- Open again the file whose name has been recorded in MenuFile_3 497 499 function MenuFile_3_Callback(hObject, eventdata, handles) 498 500 fileinput=get(handles.MenuFile_3,'Label'); 499 501 display_file_name(hObject, eventdata, handles,fileinput) 500 502 501 % -------------------------------------------------------------------- 503 % ----------------------------------------------------------------------- 504 % --- Open again the file whose name has been recorded in MenuFile_4 502 505 function MenuFile_4_Callback(hObject, eventdata, handles) 503 506 fileinput=get(handles.MenuFile_4,'Label'); 504 507 display_file_name(hObject, eventdata, handles,fileinput) 505 508 506 % -------------------------------------------------------------------- 509 % ----------------------------------------------------------------------- 510 % --- Open again the file whose name has been recorded in MenuFile_5 507 511 function MenuFile_5_Callback(hObject, eventdata, handles) 508 512 fileinput=get(handles.MenuFile_5,'Label'); 509 513 display_file_name(hObject, eventdata, handles,fileinput) 510 514 511 %----------------------------------------------------------------- 512 % fills the edit boxes RootPath, RootFile,NomType...from an input file name 'fileinput' 513 %---------------------------------------------------------------- 515 %------------------------------------------------------------------------ 516 % --- Fills the edit boxes RootPath, RootFile,NomType...from an input file name 'fileinput' 514 517 function display_file_name(hObject, eventdata, handles,fileinput) 515 518 if ~exist(fileinput,'file') … … 611 614 612 615 %------------------------------------------------------------------------ 616 % --- Called by action in RootPath edit box 613 617 function RootPath_Callback(hObject,eventdata,handles) 614 618 %------------------------------------------------------------------------ … … 616 620 617 621 %------------------------------------------------------------------------ 618 % -- called by action in RootFile edit box622 % --- Called by action in RootFile edit box 619 623 function SubDir_Callback(hObject, eventdata, handles) 620 624 %------------------------------------------------------------------------ … … 625 629 626 630 %------------------------------------------------------------------------ 627 % --- called by action in RootFile edit box631 % --- Called by action in RootFile edit box 628 632 function RootFile_Callback(hObject, eventdata, handles) 629 633 %------------------------------------------------------------------------ … … 631 635 632 636 %------------------------------------------------------------------------ 633 % --- called by action in FileIndex edit box637 % --- Called by action in FileIndex edit box 634 638 function FileIndex_Callback(hObject, eventdata, handles) 635 639 %------------------------------------------------------------------------ … … 650 654 651 655 %------------------------------------------------------------------------ 652 % --- called by action in FileIndex_1 edit box 653 function FileIndex_1_Callback(hObject, eventdata, handles) 654 %------------------------------------------------------------------------ 655 run0_Callback(hObject, eventdata, handles) 656 657 %------------------------------------------------------------------------ 658 % --- update information about a new field series (indices to scan, timing, calibration from an xml file, then refresh current plots 656 % --- Update information about a new field series (indices to scan, timing, 657 % calibration from an xml file, then refresh current plots 659 658 function update_rootinfo(hObject,eventdata,handles) 660 659 %------------------------------------------------------------------------ … … 895 894 set_scan_options(hObject, eventdata, handles) 896 895 897 898 %------------------------------------------------------------------- 899 %-- set index navigation options for new series input and refresh plot 900 %------------------------------------------------------------------- 896 %------------------------------------------------------------------------ 897 %--- Set index navigation options for new series input and refresh plot 898 %------------------------------------------------------------------------ 901 899 function set_scan_options(hObject, eventdata, handles) 902 900 … … 955 953 end 956 954 957 %------------------------------------------------------------------- 955 %------------------------------------------------------------------------ 956 % --- Executes on the menu Open/Browse_1 for the second input field, 957 % search the files, recognize their type according to their name and fill the rootfile input windows 958 958 function MenuBrowse_1_Callback(hObject, eventdata, handles) 959 959 %------------------------------------------------------------------- … … 1022 1022 end 1023 1023 1024 % -------------------------------------------------------------------- 1024 % ----------------------------------------------------------------------- 1025 % --- Open again as second field the file whose name has been recorded in MenuFile_1 1025 1026 function MenuFile_1_1_Callback(hObject, eventdata, handles) 1026 1027 fileinput_1=get(handles.MenuFile_1_1,'Label'); 1027 1028 display_file_name_1(hObject,eventdata,handles,fileinput_1) 1028 1029 1029 % -------------------------------------------------------------------- 1030 % ----------------------------------------------------------------------- 1031 % --- Open again as second field the file whose name has been recorded in MenuFile_2 1030 1032 function MenuFile_2_1_Callback(hObject, eventdata, handles) 1031 1033 fileinput_1=get(handles.MenuFile_2_1,'Label'); 1032 1034 display_file_name_1(hObject,eventdata,handles,fileinput_1) 1033 1035 1034 % -------------------------------------------------------------------- 1036 % ----------------------------------------------------------------------- 1037 % --- Open again as second field the file whose name has been recorded in MenuFile_3 1035 1038 function MenuFile_3_1_Callback(hObject, eventdata, handles) 1036 1039 fileinput_1=get(handles.MenuFile_3_1,'Label'); 1037 1040 display_file_name_1(hObject,eventdata,handles,fileinput_1) 1038 1041 1039 % -------------------------------------------------------------------- 1042 % ----------------------------------------------------------------------- 1043 % --- Open again as second field the file whose name has been recorded in MenuFile_4 1040 1044 function MenuFile_4_1_Callback(hObject, eventdata, handles) 1041 1045 fileinput_1=get(handles.MenuFile_4_1,'Label'); 1042 1046 display_file_name_1(hObject,eventdata,handles,fileinput_1) 1043 1047 1044 % -------------------------------------------------------------------- 1048 % ----------------------------------------------------------------------- 1049 % --- Open again as second field the file whose name has been recorded in MenuFile_5 1045 1050 function MenuFile_5_1_Callback(hObject, eventdata, handles) 1046 1051 fileinput_1=get(handles.MenuFile_5_1,'Label'); 1047 1052 display_file_name_1(hObject,eventdata,handles,fileinput_1) 1048 1053 1049 %----------------------------------------------------------------- 1050 % fills the edit boxes RootPath , RootFile,NomType...from an input file name 'fileinput'1051 %---------------------------------------------------------------- 1054 %------------------------------------------------------------------------ 1055 % fills the edit boxes RootPath_1, RootFile_1,NomType_1...from an input file name 'fileinput_1' 1056 %------------------------------------------------------------------------ 1052 1057 function display_file_name_1(hObject,eventdata,handles,fileinput_1) 1053 1058 … … 1165 1170 RootPath_1_Callback(hObject,eventdata,handles); 1166 1171 1167 1168 % -----------------------------------------------------1172 %----------------------------------------------------------------------- 1173 % --- Called by action in RootPath_1 edit box 1169 1174 function RootPath_1_Callback(hObject,eventdata,handles) 1170 1175 update_rootinfo_1(hObject,eventdata,handles) 1171 1176 1172 %------------------------------------------------------------------- 1177 %----------------------------------------------------------------------- 1178 % --- Called by action in RootFile_1 edit box 1173 1179 function RootFile_1_Callback(hObject, eventdata, handles) 1174 1180 update_rootinfo_1(hObject,eventdata,handles) 1175 %------------------------------------------------------------------- 1176 1177 %------------------------------------------------------------------- 1181 %----------------------------------------------------------------------- 1182 1183 %------------------------------------------------------------------------ 1184 % --- Called by action in FileIndex_1 edit box 1185 function FileIndex_1_Callback(hObject, eventdata, handles) 1186 %------------------------------------------------------------------------ 1187 1188 run0_Callback(hObject, eventdata, handles) 1189 1190 %------------------------------------------------------------------------ 1191 % --- Update information about a new second field series (indices to scan, timing, 1192 % calibration from an xml file, then refresh current plots 1178 1193 function update_rootinfo_1(hObject,eventdata,handles) %A REVOIR 1179 1194 1180 1195 set(handles.RootPath_1,'BackgroundColor',[1 1 0])% indicate active program by yellow color 1181 1196 drawnow 1182 %huvmat=get(handles.RootPath,'parent');1183 1197 UvData=get(handles.uvmat,'UserData');%huvmat=handles of the uvmat interface 1184 1198 UvData.NewSeries=1; %flag for run0: begin a new series … … 1208 1222 hhh=which('mmreader'); 1209 1223 elseif ~isempty(imformats(FileExt(2:end)))|| isequal(FileExt,'.vol') 1210 testima=1;1211 1224 if ~isequal(SubDir,'') 1212 1225 RootFile=get(handles.RootFile,'String'); … … 1226 1239 UvData=rmfield(UvData,'MovieObject_1'); 1227 1240 end 1228 if strcmp(get(handles.npx,'String'),'') || strcmp(get(handles.npy,'String'),'')%update npx and npy if it is not already filled by the first input field 1229 if isfield(imainfo,'Width') && isfield(imainfo,'Height') 1230 set(handles.npx,'String',num2str(imainfo.Width));%fills nbre of pixels x box 1231 set(handles.npy,'String',num2str(imainfo.Height));%fills nbre of pixels x box 1232 else 1233 set(handles.npx,'String','');%fills nbre of pixels x box 1234 set(handles.npy,'String','');%fills nbre of pixels x box 1235 end 1236 set(handles.BW,'Value',strcmp(ColorType,'grayscale'))% select handles.BW if grayscale image 1237 end 1238 1241 if ~isempty(imainfo)% (an image has been introduced as second fierld input) 1242 if strcmp(get(handles.npx,'String'),'') || strcmp(get(handles.npy,'String'),'')%update npx and npy if it is not already filled by the first input field 1243 if isfield(imainfo,'Width') && isfield(imainfo,'Height') 1244 set(handles.npx,'String',num2str(imainfo.Width));%fills nbre of pixels x box 1245 set(handles.npy,'String',num2str(imainfo.Height));%fills nbre of pixels x box 1246 else 1247 set(handles.npx,'String','');%fills nbre of pixels x box 1248 set(handles.npy,'String','');%fills nbre of pixels x box 1249 end 1250 set(handles.BW,'Value',strcmp(ColorType,'grayscale'))% select handles.BW if grayscale image 1251 end 1252 end 1239 1253 % find scaling parameters 1240 1254 filexml=[FileBase '.xml']; … … 1247 1261 end 1248 1262 if isfield(XmlData,'Camera') 1249 % if isfield(XmlData.Camera,'NbSlice')&& ~isempty(XmlData.Camera.NbSlice)1250 % NbSlice=XmlData.Camera.NbSlice;1251 % end1252 1263 if isfield(XmlData.Camera,'TimeUnit')&& ~isempty(XmlData.Camera.TimeUnit) 1253 1264 TimeUnit=XmlData.Camera.TimeUnit; … … 1452 1463 set(handles.masklevel,'String',list_index) 1453 1464 set(handles.masklevel,'Value',z) 1454 1455 1465 1456 1466 %-------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.