- Timestamp:
- Mar 12, 2025, 12:35:15 PM (3 days ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/plot_field.m ¶
r1175 r1176 183 183 else %plot 2D field 184 184 % if ~exist('PosColorbar','var'),PosColorbar=[];end; 185 [ tild,PlotParamOut,PlotType,errormsg]=plot_plane(Data,CellInfo(index_2D),haxes,PlotParamOut);185 [~,PlotParamOut,PlotType,errormsg]=plot_plane(Data,CellInfo(index_2D),haxes,PlotParamOut); 186 186 AxeData.NbDim=2; 187 187 if testzoomaxes && isempty(errormsg) 188 [zoomaxes,PlotParamOut, tild,errormsg]=plot_plane(Data,CellInfo(index_2D),zoomaxes,PlotParamOut);188 [zoomaxes,PlotParamOut,~,errormsg]=plot_plane(Data,CellInfo(index_2D),zoomaxes,PlotParamOut); 189 189 AxeData.ZoomAxes=zoomaxes; 190 190 end … … 409 409 410 410 %% prepare the string for plot command 411 if isfield(PlotParam,'Type')&& strcmp(PlotParam.Type,'semilogx') 412 plotstr='hhh=semilogx('; 413 else 414 plotstr='hhh=plot('; 411 if isfield(PlotParam,'Type') 412 switch PlotParam.Type 413 case 'semilogx' 414 plotstr='hhh=semilogx('; 415 case 'semilogy' 416 plotstr='hhh=semilogy('; 417 case 'loglog' 418 plotstr='hhh=loglog('; 419 otherwise 420 plotstr='hhh=plot('; 421 end 415 422 end 416 423 xtitle=''; -
TabularUnified trunk/src/series/civ_input.m ¶
r1171 r1176 1286 1286 end 1287 1287 % browse for a mask 1288 file mask= uigetfile_uvmat('pick a mask image file:',InputTable{ind_A,1},'image');1289 if ~isempty(file mask)1290 [FilePath,FileName,FileExt]=fileparts(file mask);1288 filebackground= uigetfile_uvmat('pick a mask image file:',InputTable{ind_A,1},'image'); 1289 if ~isempty(filebackground) 1290 [FilePath,FileName,FileExt]=fileparts(filebackground); 1291 1291 [RootPath,SubDir,RootFile,i1_series,i2,j1,j2,NomType]=find_file_series(FilePath,[FileName FileExt]); 1292 1292 if strcmp(NomType,'_1') … … 1297 1297 return 1298 1298 end 1299 set(hObject,'UserData',file mask);%store for future use1299 set(hObject,'UserData',filebackground);%store for future use 1300 1300 testmask=1; 1301 1301 end … … 1303 1303 if testmask 1304 1304 set(handles.Mask,'Visible','on') 1305 set(handles.Mask,'String',file mask)1305 set(handles.Mask,'String',filebackground) 1306 1306 set(handles.CheckMask,'Value',1) 1307 1307 if strcmp(NomType,'_1') … … 1964 1964 1965 1965 1966 % --- Executes on button press in CheckBackground. 1967 function CheckBackground_Callback(hObject, eventdata, handles) 1968 hparent=get(hObject,'parent'); 1969 hchildren=get(hparent,'children'); 1970 handle_txtbox=findobj(hchildren,'tag','Background');% look for the mask name box in the same panel 1971 testmask=0; 1972 if get(hObject,'Value')% if the checkbox is activated 1973 hseries=findobj(allchild(0),'Tag','series'); 1974 hhseries=guidata(hseries); 1975 InputTable=get(hhseries.InputTable,'Data'); 1976 if strcmp(InputTable{1,5},'.nc') 1977 ind_A=2;%case of nc file as input (for civ3), image in second line 1978 else 1979 ind_A=1;% line index of the (first) image series 1980 end 1981 % browse for a mask 1982 filebackground= uigetfile_uvmat('pick a background image file:',InputTable{ind_A,1},'image'); 1983 if ~isempty(filebackground) 1984 [FilePath,FileName,FileExt]=fileparts(filebackground); 1985 [RootPath,SubDir,RootFile,i1_series,i2,j1,j2,NomType]=find_file_series(FilePath,[FileName FileExt]); 1986 if strcmp(NomType,'_1') 1987 NbSlice=i1_series(1,2,end); 1988 set(handles.num_NbSlice,'String',num2str(NbSlice)) 1989 elseif ~strcmp(NomType,'*') 1990 msgbox_uvmat('ERROR','multilevel background images must be labeled with a single index as _1,_2,...'); 1991 return 1992 end 1993 set(hObject,'UserData',filebackground);%store for future use 1994 testmask=1; 1995 end 1996 end 1997 if testmask 1998 set(handles.Background,'Visible','on') 1999 set(handles.Background,'String',filebackground) 2000 set(handles.CheckBackground,'Value',1) 2001 if strcmp(NomType,'_1') 2002 set(handles.num_NbSlice,'Visible','on') 2003 end 2004 else 2005 set(hObject,'Value',0); 2006 set(handle_txtbox,'Visible','off') 2007 set(handles.num_NbSlice,'Visible','off') 2008 end 2009 set(handles.ConfigSource,'String','NEW') 2010 set(handles.ConfigSource,'BackgroundColor',[1 0 1]) 2011 2012 2013 2014 function Background_Callback(hObject, eventdata, handles) 2015 % hObject handle to Background (see GCBO) 2016 % eventdata reserved - to be defined in a future version of MATLAB 2017 % handles structure with handles and user data (see GUIDATA) 2018 2019 % Hints: get(hObject,'String') returns contents of Background as text 2020 % str2double(get(hObject,'String')) returns contents of Background as a double -
TabularUnified trunk/src/series/civ_series.m ¶
r1175 r1176 256 256 257 257 %% introduce input image transform 258 transform_fct=[];%default, no transform 258 259 if isfield(Param,'FieldTransform')&&~isempty(Param.FieldTransform.TransformName) 259 260 addpath(Param.FieldTransform.TransformPath) … … 265 266 %%%%% MAIN LOOP %%%%%% 266 267 maskoldname='';% initiate the mask name 268 backgroundoldname=''; 267 269 FileType_A=''; 268 270 FileType_B=''; … … 384 386 end 385 387 end 388 389 % case of background image to subtract 390 if par_civ1.CheckBackground &&~isempty(par_civ1.Background) 391 [RootPath_background,SubDir_background,RootFile_background,~,~,~,~,Ext_background]=fileparts_uvmat(Param.ActionInput.Civ1.Background); 392 j1=1; 393 if ~isempty(j1_series_Civ1) 394 j1=j1_series_Civ1(ifield); 395 end 396 if ~isempty(i2_series_Civ1)% case of volume,backgrounds act on different j levels 397 backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',j1); 398 elseif isfield(par_civ1,'NbSlice') 399 i1_background=mod(i1-1,par_civ1.NbSlice)+1; 400 backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',i1_background); 401 if strcmp(Param.ActionInput.PairIndices.ListPairMode,'series(Di)')% case of volume, background index refers to j index 402 par_civ1.NbSlice_j=par_civ1.NbSlice; 403 end 404 else 405 backgroundname=Param.ActionInput.Civ1.Background; 406 end 407 if strcmp(backgroundoldname,backgroundname)% background exist, not already read in civ1 408 par_civ1.Background=background; %use background already opened 409 else 410 if ~isempty(regexp(backgroundname,'(^http://)|(^https://)', 'once'))|| exist(backgroundname,'file') 411 try 412 par_civ1.Background=imread(backgroundname);%update the background, an store it for future use 413 catch ME 414 if ~isempty(ME.message) 415 errormsg=['error reading input image: ' ME.message]; 416 disp_uvmat('ERROR',errormsg,checkrun) 417 return 418 end 419 end 420 else 421 par_civ1.Background=[]; 422 end 423 background=par_civ1.Background; 424 backgroundoldname=backgroundname; 425 end 426 par_civ1.ImageA=par_civ1.ImageA-par_civ1.Background; 427 par_civ1.ImageB=par_civ1.ImageB-par_civ1.Background; 428 end 429 430 386 431 %% user defined image transform 387 432 if ~isempty(transform_fct) … … 472 517 end 473 518 end 474 519 475 520 % case of input grid 476 521 if par_civ1.CheckGrid &&~isempty(par_civ1.Grid) -
TabularUnified trunk/src/uvmat.m ¶
r1175 r1176 4385 4385 C=reshape(double(B),1,nxy(1)*nxy(2));% reshape in a vector 4386 4386 Histo.histo(:,col)=hist(C, Histo.(FieldName)); %calculate histogram 4387 if isequal(get(handles.LogLinHisto,'Value'),2) 4388 PlotParam.Type='semilogx'; 4389 else 4390 PlotParam.Type='plot'; 4387 switch get(handles.LogLinHisto,'Value') 4388 case 1 4389 PlotParam.Type='plot'; 4390 case 2 4391 PlotParam.Type='semilogy'; 4392 case 3 4393 PlotParam.Type='semilogx'; 4394 case 4 4395 PlotParam.Type='loglog'; 4391 4396 end 4392 4397 end
Note: See TracChangeset
for help on using the changeset viewer.