Changeset 1178 for trunk/src/uvmat.m
- Timestamp:
- Mar 21, 2025, 10:17:07 AM (4 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r1176 r1178 221 221 %% EXPORT menu 222 222 export_menu={'as field in workspace';'in new figure';'on existing axis';'make movie';'more...'}; 223 export_path=fullfile(path_uvmat,'export_fct');223 %export_path=fullfile(path_uvmat,'export_fct'); 224 224 225 225 %% load the list of previously browsed files in menus Open, Open_1 and TransformName … … 625 625 hveccolor=axes('Position',[0.93 0.1 0.02 0.5]); 626 626 ima=permute(get(handles.VecColBar,'CData'),[2 1 3]); 627 ymin=str2 num(get(handles.num_MinVec,'String'));628 ymax=str2 num(get(handles.num_MaxVec,'String'));627 ymin=str2double(get(handles.num_MinVec,'String')); 628 ymax=str2double(get(handles.num_MaxVec,'String')); 629 629 set(hveccolor,'YLim',[ymin ymax]) 630 630 imagesc([0 1],[ymin ymax],ima) … … 862 862 huvmat=findobj(allchild(0),'Tag','uvmat'); 863 863 hhuvmat=guidata(huvmat); 864 increment=str2 num(get(hhuvmat.num_IndexIncrement,'String')); %get the field increment from uvmat864 increment=str2double(get(hhuvmat.num_IndexIncrement,'String')); %get the field increment from uvmat 865 865 set(hhuvmat.STOP,'Visible','on') 866 866 set(hhuvmat.speed,'Visible','on') … … 1409 1409 hset_slice=get(hObject, 'parent'); 1410 1410 hZ=findobj(hset_slice,'Tag','num_Z_1'); 1411 Z_plane=str2 num(get(hZ,'String'));% set of Z positions explicitly entered as a Matlab vector1411 Z_plane=str2double(get(hZ,'String'));% set of Z positions explicitly entered as a Matlab vector 1412 1412 SliceData=read_GUI(hset_slice); 1413 1413 Slice.NbSlice=SliceData.NbSlice; … … 2066 2066 end 2067 2067 2068 % %------------------------------------------------------------------------2069 % % -- open the GUI civ.fig for PIV2070 % function MenuCIVx_Callback(hObject, eventdata, handles)2071 % %------------------------------------------------------------------------2072 % [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles);2073 % FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];2074 % civ(FileName);% interface de civ(not in the uvmat file)2075 2076 2068 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2077 2069 % MenuHelp Callback … … 2083 2075 2084 2076 2085 2086 2087 2088 2089 2090 2091 2092 2093 2077 %------------------------------------------------------------------------ 2094 2078 % --- Called by action in FileIndex edit box … … 2096 2080 %------------------------------------------------------------------------ 2097 2081 [tild,tild,tild,i1,i2,j1,j2]=fileparts_uvmat(get(handles.FileIndex,'String')); 2082 UvData=get(handles.uvmat,'UserData'); 2083 check_index=false; 2084 if isfield(UvData,'XmlData')&& ~isempty(UvData.XmlData) 2085 if isfield(UvData.XmlData{1},'FileSeries')% case of frame indexing documented by the xml file (PCO) 2086 if strcmp(UvData.XmlData{1}.FileSeries.Convention,'PCO') 2087 i1_mod=i1*UvData.XmlData{1}.FileSeries.NbFramePerFile+1; 2088 if isfield(UvData.XmlData{1},'Time') 2089 [NbField,NbField_j]=size(UvData.XmlData{1}.Time); 2090 j1=mod(i1_mod,NbField_j-1)+1; 2091 i1_mod=floor(i1_mod/(NbField_j -1))+1; 2092 end 2093 set(handles.i1,'String',num2str(i1_mod));%update the counters 2094 set(handles.j1,'String',num2str(j1));%update the counters 2095 check_index=true; 2096 end 2097 end 2098 end 2099 if ~check_index 2098 2100 set(handles.i1,'String',num2str(i1));%update the counters 2099 2101 set(handles.i2,'String',num2str(i2)); 2100 2102 set(handles.j1,'String',num2str(j1)); 2101 2103 set(handles.j2,'String',num2str(j2)); 2102 2104 end 2103 2105 2104 2106 %------------------------------------------------------------------------ … … 2106 2108 function NomType_Callback(hObject, eventdata, handles) 2107 2109 %------------------------------------------------------------------------ 2108 i1=str2 num(get(handles.i1,'String'));2109 i2=str2 num(get(handles.i2,'String'));2110 j1=str2 num(get(handles.j1,'String'));2111 j2=str2 num(get(handles.j2,'String'));2110 i1=str2double(get(handles.i1,'String')); 2111 i2=str2double(get(handles.i2,'String')); 2112 j1=str2double(get(handles.j1,'String')); 2113 j2=str2double(get(handles.j2,'String')); 2112 2114 NomType=get(hObject,'String'); 2113 2115 if strcmp(NomType,'level') 2114 FileIndex=str2 num(get(handles.i1,'String'));2116 FileIndex=str2double(get(handles.i1,'String')); 2115 2117 else 2116 2118 FileIndex=fullfile_uvmat('','','','',get(handles.NomType,'String'),i1,i2,j1,j2); … … 2124 2126 function NomType_1_Callback(hObject, eventdata, handles) 2125 2127 %------------------------------------------------------------------------ 2126 i1=str2 num(get(handles.i1,'String'));2127 i2=str2 num(get(handles.i2,'String'));2128 j1=str2 num(get(handles.j1,'String'));2129 j2=str2 num(get(handles.j2,'String'));2128 i1=str2double(get(handles.i1,'String')); 2129 i2=str2double(get(handles.i2,'String')); 2130 j1=str2double(get(handles.j1,'String')); 2131 j2=str2double(get(handles.j2,'String')); 2130 2132 NomType=get(hObject,'String'); 2131 2133 if strcmp(NomType,'level') 2132 FileIndex=str2 num(get(handles.i1,'String'));2134 FileIndex=str2double(get(handles.i1,'String')); 2133 2135 else 2134 2136 FileIndex=fullfile_uvmat('','','','',get(handles.NomType_1,'String'),i1,i2,j1,j2); … … 2148 2150 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 2149 2151 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 2150 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);2152 %[RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]); 2151 2153 errormsg=''; 2152 2154 if isempty(RootFile) … … 2165 2167 else 2166 2168 % initiate the input file series and refresh the current field view: 2167 errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,1); 2169 [FileInfo,VideoObject]=get_file_info(fullfile(RootPath,SubDir,[RootFile FileIndices FileExt])); 2170 errormsg=update_rootinfo(handles,RootPath,SubDir,[RootFile FileIndices FileExt],FileInfo,VideoObject,1); 2168 2171 end 2169 2172 … … 2188 2191 else 2189 2192 % initiate the input file series and refresh the current field view: 2190 errormsg=update_rootinfo(handles, i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,2);2193 errormsg=update_rootinfo(handles,RootPath,SubDir,FileName,FileInfo,MovieObject,2); 2191 2194 end 2192 2195 end … … 2200 2203 function errormsg=display_file_name(handles,fileinput,input_line) 2201 2204 %------------------------------------------------------------------------ 2202 %% look for the input file existence 2205 %% look for the input file existence and properties in the structure FileInfo 2203 2206 errormsg='';%default 2204 2207 if isempty(regexp(fileinput,'^http')) && ~exist(fileinput,'file') … … 2206 2209 msgbox_uvmat('ERROR',errormsg) 2207 2210 return 2211 end 2212 [FileInfo,MovieObject]=get_file_info(fileinput); 2213 FieldType=FileInfo.FieldType; 2214 2215 %% case of isolated input files without series 2216 switch FieldType 2217 case '' 2218 msgbox_uvmat('ERROR','invalid input file type') 2219 return 2220 case 'txt' 2221 edit(fileinput) 2222 return 2223 case 'figure' %display matlab figure 2224 hfig=open(fileinput); 2225 set(hfig,'WindowButtonMotionFcn','mouse_motion')%set mouse action functio 2226 set(hfig,'WindowButtonUpFcn','mouse_up')%set mouse click action function 2227 set(hfig,'WindowButtonUpFcn','mouse_down')%set mouse click action function 2228 return 2229 case 'xml' % edit xml files 2230 t=xmltree(fileinput); 2231 % the xml file marks a project or project link, open datatree_browser 2232 if strcmp(get(t,1,'name'),'Project')&& exist(regexprep(fileinput,'.xml$',''),'dir') 2233 datatree_browser(fileinput) 2234 else % other xml file, open the xml editor 2235 editxml(fileinput); 2236 end 2237 return 2238 case 'xls'% Excel file opended by editxml 2239 editxml(fileinput); 2240 return 2208 2241 end 2209 2242 … … 2239 2272 drawnow 2240 2273 2274 [RootPath,SubDir,RootFile,i1,i2,j1,j2,~,NomType]=fileparts_uvmat(fileinput); 2275 [~,FileName,FileExt]=fileparts(fileinput); 2276 2277 2241 2278 %% detect root name, nomenclature and indices in the input file name: 2242 [FilePath,FileName,FileExt]=fileparts(fileinput);2279 %[FilePath,FileName,FileExt]=fileparts(fileinput); 2243 2280 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 2244 2281 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists 2245 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileInfo,MovieObject,i1,i2,j1,j2]=... 2246 find_file_series(FilePath,[FileName FileExt]); 2247 2248 %% open the file or fill the GUI uvmat according to the detected file type 2249 FieldType=FileInfo.FieldType; 2250 switch FieldType 2251 case '' 2252 msgbox_uvmat('ERROR','invalid input file type') 2253 return 2254 case 'txt' 2255 edit(fileinput) 2256 return 2257 case 'figure' %display matlab figure 2258 hfig=open(fileinput); 2259 set(hfig,'WindowButtonMotionFcn','mouse_motion')%set mouse action functio 2260 set(hfig,'WindowButtonUpFcn','mouse_up')%set mouse click action function 2261 set(hfig,'WindowButtonUpFcn','mouse_down')%set mouse click action function 2262 return 2263 case 'xml' % edit xml files 2264 t=xmltree(fileinput); 2265 % the xml file marks a project or project link, open datatree_browser 2266 if strcmp(get(t,1,'name'),'Project')&& exist(regexprep(fileinput,'.xml$',''),'dir') 2267 datatree_browser(fileinput) 2268 else % other xml file, open the xml editor 2269 editxml(fileinput); 2270 end 2271 return 2272 case 'xls'% Excel file opended by editxml 2273 editxml(fileinput); 2274 return 2275 otherwise 2276 set(handles_RootPath,'String',RootPath); 2277 set(handles_SubDir,'String',['/' SubDir]); 2278 set(handles_RootFile,'String',['/' RootFile]); %display the separator 2279 if isempty(regexp(RootPath,'^http://', 'once')) 2280 rootname=fullfile(RootPath,SubDir,RootFile); 2282 2283 set(handles_RootPath,'String',RootPath); 2284 set(handles_SubDir,'String',['/' SubDir]); 2285 set(handles_RootFile,'String',['/' RootFile]); %display the separator 2286 if isempty(regexp(RootPath,'^http://', 'once')) 2287 rootname=fullfile(RootPath,SubDir,RootFile); 2288 else 2289 rootname=[RootPath '/' SubDir '/' RootFile]; 2290 end 2291 indices=fileinput(length(rootname)+1:end); 2292 indices(end-length(FileExt)+1:end)=[]; %remove extension 2293 set(handles_FileIndex,'String',indices); 2294 set(handles_NomType,'String',NomType); 2295 set(handles_FileExt,'String',FileExt); 2296 if input_line==1 2297 % fill file index counters if the first file series is opened 2298 set(handles.i1,'String',num2str(i1)); 2299 set(handles.i2,'String',num2str(i2)); 2300 set(handles.j1,'String',num2stra(j1,NomType)); 2301 set(handles.j2,'String',num2stra(j2,NomType)); 2302 if isfield(FileInfo,'MaskFile') 2303 if exist(FileInfo.MaskFile) 2304 set(handles.CheckMask,'Value',1) 2281 2305 else 2282 rootname=[RootPath '/' SubDir '/' RootFile]; 2283 end 2284 indices=fileinput(length(rootname)+1:end); 2285 indices(end-length(FileExt)+1:end)=[]; %remove extension 2286 set(handles_FileIndex,'String',indices); 2287 set(handles_NomType,'String',NomType); 2288 set(handles_FileExt,'String',FileExt); 2289 if input_line==1 2290 % fill file index counters if the first file series is opened 2291 set(handles.i1,'String',num2str(i1)); 2292 set(handles.i2,'String',num2str(i2)); 2293 set(handles.j1,'String',num2stra(j1,NomType)); 2294 set(handles.j2,'String',num2stra(j2,NomType)); 2295 if isfield(FileInfo,'MaskFile') 2296 if exist(FileInfo.MaskFile) 2297 set(handles.CheckMask,'Value',1) 2298 else 2299 set(handles.CheckMask,'Value',0) 2300 end 2301 Mask.File=FileInfo.MaskFile; 2302 if isfield(FileInfo,'MaskNbSlice') 2303 Mask.NbSlice=FileInfo.MaskNbSlice; 2304 elseif isfield(FileInfo,'VolumeScan') 2305 Mask.VolumeScan=FileInfo.VolumeScan; 2306 end 2307 set(handles.CheckMask,'UserData', Mask) 2308 else 2309 set(handles.CheckMask,'Value',0) 2310 CheckMask_Callback(handles.CheckMask, [], handles) 2311 end 2312 else %read the current field index to synchronise with the first series 2313 i1_s=str2num(get(handles.i1,'String')); 2314 i2_0=str2num(get(handles.i2,'String')); 2315 if ~isempty(i2_0) 2316 i2_s=i2_0; 2317 else 2318 i2_s=i2; 2319 end 2320 j1_0=stra2num(get(handles.j1,'String')); 2321 if ~isempty(j1_0) 2322 j1_s=j1_0; 2323 else 2324 j1_s=j1; 2325 end 2326 j2_0=stra2num(get(handles.j2,'String')); 2327 if ~isempty(j2_0) 2328 j2_s=j2_0; 2329 else 2330 j2_s=j2; 2331 end 2332 end 2333 2334 % synchronise indices of the second input file if it exists 2335 if get(handles.SubField,'Value')==1% if the subfield button is activated, update the field numbers 2336 Input=read_GUI(handles.InputFile); 2337 if ~isfield(Input,'RootPath_1')||strcmp(Input.RootPath_1,'"') 2338 Input.RootPath_1=Input.RootPath; 2339 end 2340 if ~isfield(Input,'SubDir_1')||strcmp(Input.SubDir_1,'"') 2341 Input.SubDir_1=Input.SubDir; 2342 end 2343 if ~isfield(Input,'RootFile_1')||strcmp(Input.RootFile_1,'"') 2344 Input.RootFile_1=Input.RootFile; 2345 end 2346 if ~isfield(Input,'FileExt_1')||strcmp(Input.FileExt_1,'"') 2347 Input.FileExt_1=Input.FileExt; 2348 end 2349 if ~isfield(Input,'NomType_1')||strcmp(Input.NomType_1,'"') 2350 Input.NomType_1=Input.NomType; 2351 end 2352 %updtate the indices of the second field series to correspond to the newly opened one 2353 FileName_1=fullfile_uvmat(Input.RootPath_1,Input.SubDir_1,Input.RootFile_1,Input.FileExt_1,Input.NomType_1,i1_s,i2_s,j1_s,j2_s); 2354 if exist(FileName_1,'file') 2355 FileIndex_1=fullfile_uvmat('','','','',Input.NomType_1,i1_s,i2_s,j1_s,j2_s); 2356 else 2357 FileIndex_1=fullfile_uvmat('','','','',Input.NomType_1,i1,i2,j1,j2); 2358 % msgbox_uvmat('WARNING','unable to synchronise the indices of the two series') 2359 end 2360 set(handles.FileIndex_1,'String',FileIndex_1) 2361 end 2362 2363 %enable other menus 2364 set(handles.MenuExport,'Enable','on') 2365 set(handles.MenuExportFigure,'Enable','on') 2366 set(handles.MenuExportMovie,'Enable','on') 2367 set(handles.MenuTools,'Enable','on') 2368 2369 % initiate input file series and inputfilerefresh the current field view: 2370 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,input_line); 2371 end 2306 set(handles.CheckMask,'Value',0) 2307 end 2308 Mask.File=FileInfo.MaskFile; 2309 if isfield(FileInfo,'MaskNbSlice') 2310 Mask.NbSlice=FileInfo.MaskNbSlice; 2311 elseif isfield(FileInfo,'VolumeScan') 2312 Mask.VolumeScan=FileInfo.VolumeScan; 2313 end 2314 set(handles.CheckMask,'UserData', Mask) 2315 else 2316 set(handles.CheckMask,'Value',0) 2317 CheckMask_Callback(handles.CheckMask, [], handles) 2318 end 2319 else %read the current field index to synchronise with the first series 2320 i1_s=str2double(get(handles.i1,'String')); 2321 i2_0=str2double(get(handles.i2,'String')); 2322 if ~isempty(i2_0) 2323 i2_s=i2_0; 2324 else 2325 i2_s=i2; 2326 end 2327 j1_0=stra2num(get(handles.j1,'String')); 2328 if ~isempty(j1_0) 2329 j1_s=j1_0; 2330 else 2331 j1_s=j1; 2332 end 2333 j2_0=stra2num(get(handles.j2,'String')); 2334 if ~isempty(j2_0) 2335 j2_s=j2_0; 2336 else 2337 j2_s=j2; 2338 end 2339 end 2340 2341 % synchronise indices of the second input file if it exists 2342 if get(handles.SubField,'Value')==1% if the subfield button is activated, update the field numbers 2343 Input=read_GUI(handles.InputFile); 2344 if ~isfield(Input,'RootPath_1')||strcmp(Input.RootPath_1,'"') 2345 Input.RootPath_1=Input.RootPath; 2346 end 2347 if ~isfield(Input,'SubDir_1')||strcmp(Input.SubDir_1,'"') 2348 Input.SubDir_1=Input.SubDir; 2349 end 2350 if ~isfield(Input,'RootFile_1')||strcmp(Input.RootFile_1,'"') 2351 Input.RootFile_1=Input.RootFile; 2352 end 2353 if ~isfield(Input,'FileExt_1')||strcmp(Input.FileExt_1,'"') 2354 Input.FileExt_1=Input.FileExt; 2355 end 2356 if ~isfield(Input,'NomType_1')||strcmp(Input.NomType_1,'"') 2357 Input.NomType_1=Input.NomType; 2358 end 2359 %updtate the indices of the second field series to correspond to the newly opened one 2360 FileName_1=fullfile_uvmat(Input.RootPath_1,Input.SubDir_1,Input.RootFile_1,Input.FileExt_1,Input.NomType_1,i1_s,i2_s,j1_s,j2_s); 2361 if exist(FileName_1,'file') 2362 FileIndex_1=fullfile_uvmat('','','','',Input.NomType_1,i1_s,i2_s,j1_s,j2_s); 2363 else 2364 FileIndex_1=fullfile_uvmat('','','','',Input.NomType_1,i1,i2,j1,j2); 2365 % msgbox_uvmat('WARNING','unable to synchronise the indices of the two series') 2366 end 2367 set(handles.FileIndex_1,'String',FileIndex_1) 2368 end 2369 2370 %enable other menus 2371 set(handles.MenuExport,'Enable','on') 2372 set(handles.MenuExportFigure,'Enable','on') 2373 set(handles.MenuExportMovie,'Enable','on') 2374 set(handles.MenuTools,'Enable','on') 2375 2376 % initiate input file series and inputfilerefresh the current field view: 2377 update_rootinfo(handles,RootPath,SubDir,[FileName FileExt],FileInfo, MovieObject,input_line); 2378 2372 2379 2373 2380 %% update list of recent files in the menubar and save it for future opening … … 2396 2403 % --- Update information about a new field series (indices to scan, timing, 2397 2404 % calibration from an xml file, then inputfilerefresh current plots 2398 function errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,VideoObject,input_line) 2405 %function errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,VideoObject,input_line) 2406 function errormsg=update_rootinfo(handles,RootPath,SubDir,FileName,FileInfo,VideoObject,input_line) 2399 2407 %------------------------------------------------------------------------ 2400 2408 errormsg=''; %default error msg … … 2410 2418 end 2411 2419 set(handles.FixVelType,'Value',0); %desactivate fixed veltype by default 2420 2421 %% look for the xml file and read it 2422 XmlFileName=find_imadoc(RootPath,SubDir); 2423 [~,XmlName]=fileparts(XmlFileName); 2424 warntext='';%default warning message 2425 NbSlice=1;%default 2426 %CheckImaDoc=false; 2427 TimeUnit='';%default 2428 TimeName='';%default 2429 CheckIndexing=false;%default 2430 if isempty(XmlFileName) 2431 set(handles.view_xml,'Visible','off') 2432 else 2433 set(handles.view_xml,'Visible','on') 2434 set(handles.view_xml,'BackgroundColor',[1 1 0])% paint to yellow color to indicate reading of the xml file 2435 set(handles.view_xml,'String','view xml') 2436 drawnow 2437 [XmlData,warntext]=imadoc2struct(XmlFileName); 2438 if ~isempty(warntext) 2439 msgbox_uvmat('WARNING',warntext) 2440 end 2441 if ~isempty(XmlData) 2442 %CheckImaDoc=true; 2443 if isfield(XmlData,'TimeUnit')&& ~isempty(XmlData.TimeUnit) 2444 TimeUnit=XmlData.TimeUnit; 2445 end 2446 if isfield(XmlData,'Time')&& ~isempty(XmlData.Time) 2447 TimeName='xml';% 2448 if XmlData.Time(1,:)==XmlData.Time(2,:)% case starting with index 1 2449 sizDti=size(XmlData.Time,1)-1;%size of the time vector explicitly defined in the xml file 2450 ind_start=1; 2451 else 2452 sizDti=size(XmlData.Time,1);% case starting with index 0 2453 ind_start=0; 2454 end 2455 if isfield(XmlData,'FileSeries') 2456 if strcmp(XmlName,SubDir)% frame indexing documented from the xml file (case PCO) 2457 CheckIndexing=true; 2458 else 2459 XmlData=rmfield(XmlData,'FileSeries');%desactivate file indexing option for derived file series 2460 end 2461 end 2462 end 2463 end 2464 set(handles.view_xml,'BackgroundColor',[1 1 1])% paint back to white 2465 set(handles.view_xml,'String','view xml')% indicate that a xml file has been detected 2466 drawnow 2467 if isfield(XmlData,'Slice') && isfield(XmlData.Slice,'CheckVolumeScan') && isequal(XmlData.Slice.CheckVolumeScan,1) 2468 set (handles.slices,'String','volume') 2469 end 2470 end 2471 2472 %% get the file series 2473 MovieObject=[]; 2474 if strcmp(TimeName,'xml') && strcmp(XmlName,SubDir)% get the image series info from the xml file 2475 [nbfield,nbfield_j]=size(XmlData.Time); 2476 nbfield=nbfield-1; %remove the possible index 0 2477 nbfield_j=nbfield_j-1; %remove the possible index 0 2478 i1_series=zeros(nbfield,nbfield_j,1); 2479 i1_series(:,:,1)=(1:nbfield)'*ones(1,nbfield_j); 2480 i2_series=i1_series; 2481 if nbfield_j==1 2482 j1_series=[]; 2483 else 2484 j1_series(:,:,1)=ones(nbfield,1)*(1:nbfield_j); 2485 end 2486 j2_series=j1_series; 2487 else % scan the input folder to get the list of existing files 2488 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileInfo,MovieObject,i1,i2,j1,j2]=... 2489 find_file_series(fullfile(RootPath,SubDir),FileName); 2490 nbfield=max(max(max(i2_series)));% total number of fields (i index) 2491 if isempty(nbfield) 2492 nbfield=max(max(max(i1_series))); 2493 end 2494 nbfield_j=max(max(max(j2_series)));% number of fields along j index 2495 if isempty(nbfield_j) 2496 nbfield_j=max(max(max(j1_series))); 2497 end 2498 if input_line==1 2499 set(handles.NomType,'String',NomType) 2500 else 2501 set(handles.NomType_1,'String',NomType) 2502 end 2503 end 2504 if CheckIndexing 2505 i1=str2double(get(handles.FileIndex,'String')); 2506 if isnan(i1) 2507 i1=1; 2508 else 2509 i1=(i1-XmlData.FileSeries.FirstFileIndex)*XmlData.FileSeries.NbFramePerFile+1;%frame index deduced from input file index 2510 end 2511 if strcmp(TimeName,'xml')% indices i and j 2512 j1=mod(i1-1,nbfield_j)+1; 2513 i1=floor((i1-1)/nbfield_j)+1; 2514 set(handles.j1,'String',num2str(j1)) 2515 end 2516 set(handles.i1,'String',num2str(i1)) 2517 end 2518 2412 2519 2413 2520 %% record info in UserData of the figure uvmat … … 2417 2524 %UvData.FileType{input_line}=FileInfo.FileType; 2418 2525 UvData.FileInfo{input_line}=FileInfo; 2419 UvData.MovieObject{input_line}= VideoObject;2526 UvData.MovieObject{input_line}=MovieObject; 2420 2527 UvData.i1_series{input_line}=i1_series; 2421 2528 UvData.i2_series{input_line}=i2_series; 2422 2529 UvData.j1_series{input_line}=j1_series; 2423 2530 UvData.j2_series{input_line}=j2_series; 2424 nbfield=max(max(max(i2_series)));% total number of fields (i index) 2425 if isempty(nbfield) 2426 nbfield=max(max(max(i1_series))); 2427 end 2428 nbfield_j=max(max(max(j2_series)));% number of fields along j index 2429 if isempty(nbfield_j) 2430 nbfield_j=max(max(max(j1_series))); 2431 end 2531 2432 2532 2433 2533 %% read timing and total frame number from the current file (e.g. movie files) 2434 TimeUnit='';%default2435 TimeName='';%default2436 XmlData.Time=[];%default2437 2534 ColorType='falsecolor'; %default 2438 2535 if isfield(FileInfo,'FrameRate')% frame rate given in the file (case of video data) … … 2468 2565 else 2469 2566 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles); 2470 end2471 XmlFileName=find_imadoc(RootPath,SubDir);2472 [tild,tild,DocExt]=fileparts(XmlFileName);2473 warntext='';%default warning message2474 NbSlice=1;%default2475 ImaDoc_str='';2476 if ~isempty(XmlFileName)2477 set(handles.view_xml,'Visible','on')2478 set(handles.view_xml,'BackgroundColor',[1 1 0])% paint to yellow color to indicate reading of the xml file2479 set(handles.view_xml,'String','view .xml')2480 drawnow2481 [XmlDataRead,warntext]=imadoc2struct(XmlFileName);2482 if ~isempty(warntext)2483 msgbox_uvmat('WARNING',warntext)2484 end2485 if ~isempty(XmlDataRead)2486 ImaDoc_str=['view ' DocExt]; % DocExt= '.xml' or .civ (obsolete case)2487 if isfield(XmlDataRead,'TimeUnit')&& ~isempty(XmlDataRead.TimeUnit)2488 TimeUnit=XmlDataRead.TimeUnit;2489 end2490 if isfield(XmlDataRead,'Time')&& ~isempty(XmlDataRead.Time)2491 XmlData.Time=XmlDataRead.Time;2492 if XmlDataRead.Time(1,:)==XmlDataRead.Time(2,:)% case starting with index 12493 sizDti=size(XmlDataRead.Time,1)-1;%size of the time vector explicitly defined in the xml file2494 ind_start=1;2495 else2496 sizDti=size(XmlDataRead.Time,1);% case starting with index 02497 ind_start=0;2498 end2499 end2500 set(handles.view_xml,'BackgroundColor',[1 1 1])% paint back to white2501 drawnow2502 if isfield(XmlDataRead, 'GeometryCalib') && ~isempty(XmlDataRead.GeometryCalib)2503 XmlData.GeometryCalib=XmlDataRead.GeometryCalib;2504 end2505 XmlData.Slice=XmlData.GeometryCalib;%default2506 if isfield(XmlDataRead, 'Slice') && ~isempty(XmlDataRead.Slice)2507 XmlData.Slice=XmlDataRead.Slice;2508 end2509 if isfield(XmlData.Slice,'CheckVolumeScan') && isequal(XmlData.Slice.CheckVolumeScan,1)2510 set (handles.slices,'String','volume')2511 end2512 if isfield(XmlDataRead, 'LIFCalib')2513 XmlData.LIFCalib=XmlDataRead.LIFCalib;2514 end2515 end2516 end2517 if isempty(ImaDoc_str)2518 set(handles.view_xml,'Visible','off') % no .xml (or .civ) file detected2519 else2520 set(handles.view_xml,'String',ImaDoc_str)% indicate that a xml file has been detected2521 2567 end 2522 2568 … … 2540 2586 2541 2587 %% store last index in handles.MaxIndex_i and .MaxIndex_j 2542 if isfield(XmlData,'Time')&& ~isempty(XmlData.Time)2543 %transform .Time to a column vector if it is a line vector the nomenclature uses a single index2544 if isequal(size(XmlData.Time,1),1)2545 XmlData.Time=(XmlData.Time)';2546 end2547 end2548 2588 last_i_cell=get(handles.MaxIndex_i,'String'); 2549 2589 if isempty(nbfield) … … 2794 2834 2795 2835 NomType=get(handles.NomType,'String'); 2836 UvData=get(handles.uvmat,'UserData'); 2796 2837 2797 2838 if strcmp(NomType,'level') 2798 indices=get(handles.i1,'String'); 2799 else 2800 indices=get(handles.FileIndex,'String'); 2801 [tild,tild,tild,i1,i2,j1,j2]=fileparts_uvmat(indices);% the indices for the second series taken from FileIndex 2802 switch index_rank 2803 case 1 2804 indices=fullfile_uvmat('','','','',NomType,stra2num(get(handles.i1,'String')),i2,j1,j2); 2805 case 2 2806 indices=fullfile_uvmat('','','','',NomType,i1,stra2num(get(handles.i2,'String')),j1,j2); 2807 case 3 2808 indices=fullfile_uvmat('','','','',NomType,i1,i2,stra2num(get(handles.j1,'String')),j2); 2809 case 4 2810 indices=fullfile_uvmat('','','','',NomType,i1,i2,j1,stra2num(get(handles.j2,'String'))); 2811 end 2812 end 2813 set(handles.FileIndex,'String',indices) 2839 index_string=get(handles.i1,'String'); 2840 else 2841 index_string=get(handles.FileIndex,'String'); 2842 if isfield(UvData,'XmlData')&& isfield(UvData.XmlData{1},'FileSeries') 2843 i1=str2double(get(handles.i1,'String')); 2844 j1=str2double(get(handles.j1,'String')); 2845 NbField_j_cell=get(handles.MaxIndex_j,'String'); 2846 NbField_j=str2double(NbField_j_cell{1}); 2847 [RootFile,index_string,FrameIndex]=index2filename(UvData.XmlData{1}.FileSeries,i1,j1,NbField_j); 2848 set(handles.RootFile,'String',RootFile) 2849 else 2850 [tild,tild,tild,i1,i2,j1,j2]=fileparts_uvmat(index_string);% the index_string for the second series taken from FileIndex 2851 switch index_rank 2852 case 1 2853 index_string=fullfile_uvmat('','','','',NomType,stra2num(get(handles.i1,'String')),i2,j1,j2); 2854 case 2 2855 index_string=fullfile_uvmat('','','','',NomType,i1,stra2num(get(handles.i2,'String')),j1,j2); 2856 case 3 2857 index_string=fullfile_uvmat('','','','',NomType,i1,i2,stra2num(get(handles.j1,'String')),j2); 2858 case 4 2859 index_string=fullfile_uvmat('','','','',NomType,i1,i2,j1,stra2num(get(handles.j2,'String'))); 2860 end 2861 end 2862 end 2863 set(handles.FileIndex,'String',index_string) 2814 2864 2815 2865 % update the second index if relevant 2816 2866 if strcmp(get(handles.FileIndex_1,'Visible'),'on') 2817 2867 NomType_1=get(handles.NomType_1,'String'); 2818 ind ices_1=get(handles.FileIndex_1,'String');2819 [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(ind ices_1);% the indicesfor the second series taken from FileIndex_12868 index_string_1=get(handles.FileIndex_1,'String'); 2869 [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(index_string_1);% the index_string for the second series taken from FileIndex_1 2820 2870 switch index_rank 2821 2871 case 1 2822 ind ices_1=fullfile_uvmat('','','','',NomType_1,stra2num(get(handles.i1,'String')),i2_1,j1_1,j2_1);2872 index_string_1=fullfile_uvmat('','','','',NomType_1,stra2num(get(handles.i1,'String')),i2_1,j1_1,j2_1); 2823 2873 case 2 2824 ind ices_1=fullfile_uvmat('','','','',NomType_1,i1_1,stra2num(get(handles.i2,'String')),j1_1,j2_1);2874 index_string_1=fullfile_uvmat('','','','',NomType_1,i1_1,stra2num(get(handles.i2,'String')),j1_1,j2_1); 2825 2875 case 3 2826 ind ices_1=fullfile_uvmat('','','','',NomType_1,i1_1,i2_1,stra2num(get(handles.j1,'String')),j2_1);2876 index_string_1=fullfile_uvmat('','','','',NomType_1,i1_1,i2_1,stra2num(get(handles.j1,'String')),j2_1); 2827 2877 case 4 2828 ind ices_1=fullfile_uvmat('','','','',NomType_1,i1_1,i2_1,j1_1,stra2num(get(handles.j2,'String')));2829 end 2830 set(handles.FileIndex_1,'String',ind ices_1)2878 index_string_1=fullfile_uvmat('','','','',NomType_1,i1_1,i2_1,j1_1,stra2num(get(handles.j2,'String'))); 2879 end 2880 set(handles.FileIndex_1,'String',index_string_1) 2831 2881 set(handles.FileIndex_1,'BackgroundColor',[0.7 0.7 0.7])% mark the edit box in grey, then RUN0 will mark it in white for confirmation 2832 2882 end … … 2884 2934 end 2885 2935 option=get(handles.view_xml,'String'); 2886 if isequal(option,'view .xml')2936 if isequal(option,'view xml') 2887 2937 FileXml=fullfile(RootPath,[SubDir '.xml']); 2888 2938 if ~exist(FileXml,'file')% case of civ files , removes the extension for subdir … … 2982 3032 if isfield(MaskInfo,'NbSlice')&& ~isempty(MaskInfo.NbSlice) 2983 3033 if isfield(MaskInfo,'VolumeScan') && MaskInfo.VolumeScan 2984 MaskIndex_i=str2 num(get(handles.j1,'String'));3034 MaskIndex_i=str2double(get(handles.j1,'String')); 2985 3035 else 2986 MaskIndex_i=mod(str2 num(get(handles.i1,'String'))-1,MaskInfo.NbSlice)+1;3036 MaskIndex_i=mod(str2double(get(handles.i1,'String'))-1,MaskInfo.NbSlice)+1; 2987 3037 end 2988 3038 MaskName=[MaskInfo.File '_' num2str(MaskIndex_i) '.png']; … … 3174 3224 %------------------------------------------------------------------------ 3175 3225 errormsg='';%default 3176 %% check for movie pair status3177 % movie_status=get(handles.movie_pair,'Value');3178 % if movie_status3179 % STOP_Callback(hObject, eventdata, handles)%interrupt movie pair if active3180 % end3181 3226 3182 3227 %% read the current input file name(s) and field indices … … 3186 3231 FileExt=InputFile.FileExt; 3187 3232 NomType=InputFile.NomType; 3188 [tild,tild,tild,i1,i2,j1,j2]=fileparts_uvmat(InputFile.FileIndex);% check back the indices used 3189 if isempty(i1)% no i index set by the input file name 3190 i1=str2double(get(handles.i1,'String'));%read the field indices (for movie, it is not given by the file name) 3191 elseif isempty(j1) && strcmp(get(handles.j1,'Visible'),'on') 3192 j1=str2double(get(handles.j1,'String'));%case of indexed movie 3193 end 3194 % if movie_status% we read the second index from the edit box 3195 % i2=str2num(get(handles.i2,'String'));%read the field indices (for movie, it is not given by the file name) 3196 % if strcmp(get(handles.j2,'Visible'),'on') 3197 % j2=str2num(get(handles.j2,'String'));% 3198 % end 3199 % end 3233 UvData=get(handles.uvmat,'UserData'); 3234 if isfield(UvData,'XmlData') && isfield(UvData.XmlData{1},'FileSeries')% case of indexing documented by the xml file 3235 i1=str2double(get(handles.i1,'String')); 3236 j1=str2double(get(handles.j1,'String'));%read the field indices (for movie, it is not given by the file name) 3237 i2=[];j2=[]; 3238 else 3239 [tild,tild,tild,i1,i2,j1,j2]=fileparts_uvmat(InputFile.FileIndex);% check back the indices used 3240 if isempty(i1)% no i index set by the input file name 3241 i1=str2double(get(handles.i1,'String'));%read the field indices (for movie, it is not given by the file name) 3242 elseif isempty(j1) && strcmp(get(handles.j1,'Visible'),'on') 3243 j1=str2double(get(handles.j1,'String'));%case of indexed movie 3244 end 3245 end 3200 3246 sub_value= get(handles.SubField,'Value'); 3201 3247 if sub_value % a second input file has been entered … … 3203 3249 [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(InputFile.FileIndex_1);% the indices for the second series taken from FileIndex_1 3204 3250 if isempty(i1_1) 3205 i1_1=str2 num(get(handles.i1,'String'));%read the field indices (for movie, it is not given by the file name)3251 i1_1=str2double(get(handles.i1,'String'));%read the field indices (for movie, it is not given by the file name) 3206 3252 elseif isempty(j1_1) && strcmp(get(handles.j1,'Visible'),'on') 3207 j1_1=str2 num(get(handles.j1,'String'));%case of indexed movie3253 j1_1=str2double(get(handles.j1,'String'));%case of indexed movie 3208 3254 end 3209 3255 else … … 3234 3280 end 3235 3281 end 3236 3282 3237 3283 % the pair i1-i2 or j1-j2 is free (check box CheckFixPair not selected): the list of existing indices recorded in UvData is used 3238 3284 else 3239 UvData=get(handles.uvmat,'UserData');3240 3285 ref_i=i1; 3241 3286 if ~isempty(i2) … … 3249 3294 end 3250 3295 end 3251 if isnumeric(increment) 3252 if get(handles.scan_i,'Value')==1% case of scanning along index i 3253 ref_i=ref_i+increment;% increment the current reference index i 3254 else % case of scanning along index j (burst numbers) 3255 ref_j=ref_j+increment;% increment the current reference index j if scan_j option is used 3256 end 3257 else % free increment 3258 if strcmp(increment,'+')% if runplus or movie is activated 3259 step=1; 3260 else 3261 step=-1; 3262 end 3263 if get(handles.scan_i,'Value')==1% case of scanning along index i 3296 3297 if strcmp(increment,'+')% if runplus or movie is activated 3298 step=1; 3299 else 3300 step=-1; 3301 end 3302 if get(handles.scan_i,'Value')==1% case of scanning along index i 3303 ref_i=ref_i+step; 3304 while ref_i>=0 && size(UvData.i1_series{1},3)>=ref_i+1 && UvData.i1_series{1}(1,ref_j+1,ref_i+1)==0 3264 3305 ref_i=ref_i+step; 3265 while ref_i>=0 && size(UvData.i1_series{1},3)>=ref_i+1 && UvData.i1_series{1}(1,ref_j+1,ref_i+1)==03266 ref_i=ref_i+step;3267 end3268 else % case of scanning along index j (burst numbers)3306 end 3307 else % case of scanning along index j (burst numbers) 3308 ref_j=ref_j+step; 3309 while ref_j>=0 && size(UvData.i1_series{1},2)>=ref_j+1 && UvData.i1_series{1}(1,ref_j+1,ref_i+1)==0 3269 3310 ref_j=ref_j+step; 3270 while ref_j>=0 && size(UvData.i1_series{1},2)>=ref_j+1 && UvData.i1_series{1}(1,ref_j+1,ref_i+1)==03271 ref_j=ref_j+step;3272 end3273 3311 end 3274 3312 end … … 3304 3342 j2=UvData.j2_series{1}(ref_indices(end)); 3305 3343 end 3306 3344 3307 3345 % case of a second file series 3308 3346 if sub_value … … 3340 3378 elseif ref_i_1+1>size(UvData.i1_series{2},3)&&~isempty(InputFile.NomType_1) 3341 3379 errormsg='maximum i index reached for the second series (reload the input file to update the index bound)'; 3342 %elseif ref_j_1+1>size(UvData.i1_series{2},2)&&~isempty(InputFile.NomType_1)3343 % errormsg='maximum j index reached for the second series(reload the input file to update the index bound)';3380 %elseif ref_j_1+1>size(UvData.i1_series{2},2)&&~isempty(InputFile.NomType_1) 3381 % errormsg='maximum j index reached for the second series(reload the input file to update the index bound)'; 3344 3382 end 3345 3383 if ~isempty(errormsg),return,end … … 3402 3440 if strcmp(NomType,'level') 3403 3441 indices=num2str(i1); 3442 elseif isfield(UvData,'XmlData') && isfield(UvData.XmlData{1},'FileSeries') 3443 NbField_j_cell=get(handles.MaxIndex_j,'String'); 3444 NbField_j=str2double(NbField_j_cell{1}); 3445 [RootFile,indices,FrameIndex]=index2filename(UvData.XmlData{1}.FileSeries,i1,j1,NbField_j); 3446 set(handles.RootFile,'String',RootFile) 3404 3447 else 3405 3448 indices=fullfile_uvmat('','','','',NomType,i1,i2,j1,j2); … … 3534 3577 3535 3578 %% determine the main input file information for action 3536 if isempty(regexp(FileName,'^http://', 'once')) &&~exist(FileName,'file')3537 errormsg=['input file ' FileName ' does not exist'];3538 return3539 end3579 % if isempty(regexp(FileName,'^http://', 'once')) &&~exist(FileName,'file') 3580 % errormsg=['input file ' FileName ' does not exist']; 3581 % return 3582 % end 3540 3583 NomType=get(handles.NomType,'String'); 3541 % NomType_1='';3542 % if strcmp(get(handles.NomType_1,'Visible'),'on')3543 % NomType_1=get(handles.NomType_1,'String');3544 % end3545 3584 %update the z position index 3546 3585 mode_slice=get(handles.slices,'String'); … … 3564 3603 for iobj=1:numel(UvData.ProjObject) 3565 3604 if isfield(UvData.ProjObject{iobj},'ProjMode')&& strcmp(UvData.ProjObject{iobj}.ProjMode,'interp_tps') 3566 check_proj_tps=1;% tps projection proposed 3605 check_proj_tps=1;% tps projection proposedUvData.XmlData 3567 3606 break 3568 3607 end … … 3598 3637 ParamIn=UvData.MovieObject{1}; 3599 3638 end 3639 end 3640 %% case of special file series (PCO) 3641 if isfield(UvData,'XmlData') && isfield(UvData.XmlData{1},'FileSeries') 3642 [RootName,~,Ext]=fileparts(FileName); 3643 NbField_j_cell=get(handles.MaxIndex_j,'String'); 3644 NbField_j=str2double(NbField_j_cell{1}); 3645 if num_j1>NbField_j 3646 errormsg=['index j exceeds upper bound ' num2str(NbField_j)]; 3647 return 3648 elseif num_j1<1 3649 errormsg='index j smaller that 1'; 3650 return 3651 end 3652 [FNameMulti,FileIndexString,frame_index]=index2filename(UvData.XmlData{1}.FileSeries,num_i1,num_j1,NbField_j); 3653 FileName=fullfile(RootName,[FNameMulti FileIndexString Ext]); 3600 3654 end 3601 3655 switch UvData.FileInfo{1}.FieldType … … 3885 3939 % TODO: look for time unit attribute 3886 3940 elseif ~isempty(regexp(TimeName,'^dim:')) 3887 abstime=str2 num(get(handles.i1,'String'));3941 abstime=str2double(get(handles.i1,'String')); 3888 3942 TimeUnit='index'; 3889 3943 end … … 5111 5165 if ~isempty(errormsg) 5112 5166 msgbox_uvmat('ERROR',errormsg); 5113 else5114 % set(handles.i1,'BackgroundColor',[1 1 1])5115 % set(handles.i2,'BackgroundColor',[1 1 1])5116 % set(handles.j1,'BackgroundColor',[1 1 1])5117 % set(handles.j2,'BackgroundColor',[1 1 1])5118 % set(handles.FileIndex,'BackgroundColor',[1 1 1])5119 % set(handles.FileIndex_1,'BackgroundColor',[1 1 1])5120 5167 end 5121 5168 set(handles.InputFileREFRESH,'BackgroundColor',[1 0 0]) … … 5139 5186 function VOLUME_Callback(hObject, eventdata, handles) 5140 5187 %----------------------------------------------------------------------- 5141 %errordlg('command VOL not implemented yet')5142 5188 if ishandle(handles.UVMAT_title) 5143 5189 delete(handles.UVMAT_title) … … 5150 5196 edit_vect_Callback(hObject, eventdata, handles) 5151 5197 set(handles.CheckEditObject,'Value',0) 5152 % set(handles.CheckEditObject,'BackgroundColor',[0.7 0.7 0.7])5153 % set(handles.cal,'Value',0)5154 % set(handles.cal,'BackgroundColor',[0 1 0])5155 5198 set(handles.edit_vect,'Value',0) 5156 5199 edit_vect_Callback(hObject, eventdata, handles) … … 5441 5484 drawnow 5442 5485 5443 %% inputfile refresh the current plot5486 %% inputfile refresh the current plot 5444 5487 if isempty(list_path{ichoice}) || nargin(transform_handle)<3 5445 5488 set(handles.SubField,'Value',0) … … 5682 5725 %------------------------------------------------------------------ 5683 5726 slider1=get(handles.Slider1,'Value'); 5684 min_val=str2 num(get(handles.num_MinVec,'String'));5685 max_val=str2 num(get(handles.num_MaxVec,'String'));5727 min_val=str2double(get(handles.num_MinVec,'String')); 5728 max_val=str2double(get(handles.num_MaxVec,'String')); 5686 5729 col=min_val+(max_val-min_val)*slider1; 5687 5730 set(handles.num_ColCode1,'String',num2str(col)) … … 5698 5741 function Slider2_Callback(hObject, eventdata, handles) 5699 5742 slider2=get(handles.Slider2,'Value'); 5700 min_val=str2 num(get(handles.num_MinVec,'String'));5701 max_val=str2 num(get(handles.num_MaxVec,'String'));5743 min_val=str2double(get(handles.num_MinVec,'String')); 5744 max_val=str2double(get(handles.num_MaxVec,'String')); 5702 5745 col=min_val+(max_val-min_val)*slider2; 5703 5746 set(handles.num_ColCode2,'String',num2str(col)) … … 5749 5792 set(handles.CheckFixVecColor,'Value',1) 5750 5793 CheckFixVecColor_Callback(hObject, eventdata, handles) 5751 min_val=str2 num(get(handles.num_MinVec,'String'));5752 max_val=str2 num(get(handles.num_MaxVec,'String'));5794 min_val=str2double(get(handles.num_MinVec,'String')); 5795 max_val=str2double(get(handles.num_MaxVec,'String')); 5753 5796 slider1=get(handles.Slider1,'Value'); 5754 5797 slider2=get(handles.Slider2,'Value'); … … 5774 5817 ichoice=get(handles.ColorCode,'Value'); 5775 5818 colcode.ColorCode=list{ichoice}; 5776 colcode.MinVec=str2 num(get(handles.num_MinVec,'String'));5777 colcode.MaxVec=str2 num(get(handles.num_MaxVec,'String'));5819 colcode.MinVec=str2double(get(handles.num_MinVec,'String')); 5820 colcode.MaxVec=str2double(get(handles.num_MaxVec,'String')); 5778 5821 test3color=strcmp(colcode.ColorCode,'rgb') || strcmp(colcode.ColorCode,'bgr'); 5779 5822 if test3color 5780 colcode.ColCode1=str2 num(get(handles.num_ColCode1,'String'));5781 colcode.ColCode2=str2 num(get(handles.num_ColCode2,'String'));5823 colcode.ColCode1=str2double(get(handles.num_ColCode1,'String')); 5824 colcode.ColCode2=str2double(get(handles.num_ColCode2,'String')); 5782 5825 end 5783 5826 vec_C=colcode.MinVec+(colcode.MaxVec-colcode.MinVec)*(0.5:width-0.5)/width;%sample of vec_C values from min to max
Note: See TracChangeset
for help on using the changeset viewer.