Changeset 1167
- Timestamp:
- Nov 29, 2024, 8:09:33 PM (3 weeks ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ_input.m
r1164 r1167 217 217 set(handles.dt_unit,'String',['dt in m' TimeUnit]);%display dt in unit 10-3 of the time (e.g ms) 218 218 set(handles.TimeUnit,'String',TimeUnit); 219 set(handles.SearchRange,'UserData', pxcm_search);219 % set(handles.SearchRange,'UserData', pxcm_search); 220 220 221 221 … … 231 231 if isempty(index_max),index_max=1;end 232 232 for index=1:index_max 233 set(handles.(ListOptions{index}),'Value',1)% select all operations starting from CIV1 233 set(handles.(ListOptions{index}),'Value',1)% select all operations starting from CIV1 234 update_CivOptions(handles,0) 235 update_frame(handles,ListOptions{index}) 234 236 end 235 237 else %case of netcdf file opening, start with the stage read in the file if the input file is being refreshed … … 277 279 fill_GUI(Param.ActionInput,hObject);%fill the GUI with the parameters retrieved from the input Param 278 280 279 if isfield(Param.ActionInput,'Civ1')&& isfield(Param.ActionInput.Civ1,'SearchBoxSize') 281 if isfield(Param.ActionInput,'Civ1')&& isfield(Param.ActionInput.Civ1,'SearchBoxSize')%transform from SearchBoxSize to SearchRange (old to new convention) 280 282 SearchRange=round((Param.ActionInput.Civ1.SearchBoxSize-Param.ActionInput.Civ1.CorrBoxSize)/2); 281 283 set(handles.num_SearchRange_1(1),'String',num2str(SearchRange(1))) … … 413 415 %Param.CheckCiv1=1; 414 416 Param.Civ1.CorrBoxSize=[31 31 1]; 415 Param.Civ1.SearchRange=[15 15 2];417 Param.Civ1.SearchRange=[15 15]; 416 418 Param.Civ1.SearchBoxShift=[0 0]; 417 419 Param.Civ1.CorrSmooth=1; … … 1915 1917 % Hints: get(hObject,'String') returns contents of num_SearchRange_3 as text 1916 1918 % str2double(get(hObject,'String')) returns contents of num_SearchRange_3 as a double 1919 1920 1921 1922 function edit108_Callback(hObject, eventdata, handles) 1923 % hObject handle to edit108 (see GCBO) 1924 % eventdata reserved - to be defined in a future version of MATLAB 1925 % handles structure with handles and user data (see GUIDATA) 1926 1927 % Hints: get(hObject,'String') returns contents of edit108 as text 1928 % str2double(get(hObject,'String')) returns contents of edit108 as a double 1929 1930 -
trunk/src/uvmat.m
r1164 r1167 2894 2894 %case of view mask selection 2895 2895 if isequal(get(handles.CheckMask,'Value'),1) 2896 [RootPath,SubDir]=read_file_boxes(handles); 2897 MaskSubDir=regexprep(SubDir,'\..*','');%take the root part of SubDir, before the first dot '.' 2898 MaskPath=fullfile(RootPath,[MaskSubDir '.mask']); 2896 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles); 2897 % if isempty(regexp(RootPath,'^http://')) 2898 % fileinput=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];% build the input file name (first line) 2899 % else 2900 % fileinput=[RootPath '/' SubDir '/' RootFile FileIndex FileExt];% 2901 % end 2902 % FileInfo=get_file_info(fileinput); 2903 2904 % MaskSubDir=regexprep(SubDir,'\..*','');%take the root part of SubDir, before the first dot '.' 2905 % MaskPath=fullfile(RootPath,[MaskSubDir '.mask']); 2899 2906 mdetect=0; 2900 if exist(MaskPath,'dir') 2901 ListStruct=dir(MaskPath);%look for a mask file 2902 ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray 2903 check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files 2904 ListFiles=ListCells(1,:);%list of file and dri names 2905 ListFiles=ListFiles(~check_dir);%list of file names (excluding dir) 2906 if ~isempty(ListFiles) 2907 for ifile=1:numel(ListFiles) 2908 [tild,tild,MaskExt]=fileparts(ListFiles{1}); 2909 [tild,tild,MaskFile{ifile},i1_series,i2_series,j1_series,j2_series,MaskNomType,MaskFileInfo]=find_file_series(MaskPath,ListFiles{ifile},0); 2910 MaskFileType=MaskFileInfo.FileType; 2911 if strcmp(MaskFileType,'image') && isempty(i2_series) && isempty(j2_series) 2912 mdetect=1; 2913 end 2914 if ~strcmp(MaskFile{ifile},MaskFile{1}) 2915 mdetect=0;% cancel detection test in case of multiple masks, use the brower for selection 2916 break 2917 end 2918 end 2919 end 2920 RootPath=MaskPath; 2921 end 2922 if mdetect==0 % if no mask is detected in the current folder 2923 filemask= uigetfile_uvmat('pick a mask image file:',RootPath,'image'); 2907 % if exist(MaskPath,'dir') 2908 % ListStruct=dir(MaskPath);%look for a mask file 2909 % ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray 2910 % check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files 2911 % ListFiles=ListCells(1,:);%list of file and dri names 2912 % ListFiles=ListFiles(~check_dir);%list of file names (excluding dir) 2913 % if ~isempty(ListFiles) 2914 % for ifile=1:numel(ListFiles) 2915 % [tild,tild,MaskExt]=fileparts(ListFiles{1}); 2916 % [tild,tild,MaskFile{ifile},i1_series,i2_series,j1_series,j2_series,MaskNomType,MaskFileInfo]=find_file_series(MaskPath,ListFiles{ifile},0); 2917 % MaskFileType=MaskFileInfo.FileType; 2918 % if strcmp(MaskFileType,'image') && isempty(i2_series) && isempty(j2_series) 2919 % mdetect=1; 2920 % end 2921 % if ~strcmp(MaskFile{ifile},MaskFile{1}) 2922 % mdetect=0;% cancel detection test in case of multiple masks, use the brower for selection 2923 % break 2924 % end 2925 % end 2926 % end 2927 % RootPath=MaskPath; 2928 % end 2929 filemask= uigetfile_uvmat('pick a mask image file:',RootPath,'image'); 2924 2930 if ~isempty(filemask) 2925 [FilePath,FileName,FileExt]=fileparts(filemask); 2926 [RootPath,SubDir,RootFile,i1_series,i2,j1,j2,NomType]=find_file_series(FilePath,[FileName FileExt]); 2931 [MaskPath,FileName,FileExt]=fileparts(filemask); 2932 Mask.File=filemask; 2933 [RootPath,SubDir,RootFile,i1_series,i2,j1,j2,NomType]=find_file_series(MaskPath,[FileName FileExt]); 2934 Mask.NbSlice=1;%default 2935 Mask.VolumeScan=0;% TO UPDATE *** 2927 2936 if strcmp(NomType,'_1') 2928 NbSlice=i1_series(1,2,end);2929 set(handles.num_NbSlice,'String',num2str( NbSlice))2937 Mask.NbSlice=i1_series(1,2,end); 2938 set(handles.num_NbSlice,'String',num2str(Mask.NbSlice)) 2930 2939 elseif ~strcmp(NomType,'*') 2931 2940 msgbox_uvmat('ERROR','multilevel masks must be labeled with a single index as _1,_2,...'); 2932 2941 return 2933 2942 end 2934 set(hObject,'UserData',filemask);%store for future use 2943 %set(hObject,'UserData',filemask);%store for future use 2944 set(handles.CheckMask,'UserData',Mask); 2945 errormsg=update_mask(handles); 2935 2946 testmask=1; 2936 2947 end 2937 2938 %TO COMPLEMENT......................2939 2940 2941 % MaskFullName=uigetfile_uvmat('pick a mask image file:',RootPath,'image');2942 % if isempty(MaskFullName)2943 % set(handles.CheckMask,'Value',0)2944 % end2945 %2946 % [MaskPath,MaskName,MaskExt]=fileparts(MaskFullName);2947 % [tild,tild,MaskFile,i1_series,i2,j1,j2,MaskNomType]=find_file_series(MaskPath,[MaskName MaskExt],0);2948 % if strcmp(MaskNomType,'_1')2949 % NbSlice=i1_series(1,2,end);2950 % set(handles.num_NbSlice,'String',num2str(NbSlice))2951 % end2952 end2953 % Mask.Path=MaskPath;2954 % if isempty(MaskFile)2955 % Mask.File='';2956 % elseif ischar(MaskFile)2957 % Mask.File=MaskFile;2958 % else2959 % Mask.File=MaskFile{1};2960 % end2961 % Mask.NbSlice_i=1;2962 % Mask.NbSlice_j=1;2963 % if isempty(j1_series)2964 % if isempty(i1_series)2965 % MaskNomType='*';2966 % else2967 % Mask.NbSlice_i=i1_series(1,2,end);2968 % end2969 % else2970 % Mask.NbSlice_j=j1_series(1,end,2);2971 % end2972 % Mask.Ext=MaskExt;2973 % Mask.NomType=MaskNomType;2974 set(handles.CheckMask,'UserData',Mask);2975 errormsg=update_mask(handles);2976 2948 else % desactivate mask display 2977 2949 MaskData=get(handles.CheckMask,'UserData'); … … 3006 2978 else 3007 2979 MaskIndex_i=1; 3008 MaskName=MaskInfo. MaskFile;2980 MaskName=MaskInfo.File; 3009 2981 end 3010 2982 … … 3015 2987 set(handles.uvmat,'UserData',UvData); 3016 2988 if ~exist(MaskName,'file') 3017 if isfield(Mask ,'maskhandle')&& ishandle(Mask.maskhandle)3018 delete(Mask .maskhandle)2989 if isfield(MaskInfo,'maskhandle')&& ishandle(Mask.maskhandle) 2990 delete(MaskInfo.maskhandle) 3019 2991 end 3020 2992 else … … 3488 3460 drawnow 3489 3461 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles);%read the features of the input file name (first line) 3490 [ tild,tild,tild,i1,i2,j1,j2]=fileparts_uvmat(FileIndex);% check back the indices used3462 [~,~,~,~,i2,~,j2]=fileparts_uvmat(FileIndex);% check back the indices used 3491 3463 if isempty(i2), set(handles.i2,'String',''); end % suppress the second i index display if not used 3492 3464 if isempty(j2), set(handles.j2,'String',''); end % suppress the second j index display if not used 3493 if isempty(regexp(RootPath,'^http://' ))3465 if isempty(regexp(RootPath,'^http://','once')) 3494 3466 filename=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];% build the input file name (first line) 3495 3467 else
Note: See TracChangeset
for help on using the changeset viewer.