Changeset 1176 for trunk/src/series/civ_input.m
- Timestamp:
- Mar 12, 2025, 12:35:15 PM (2 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.