Changeset 1167 for trunk


Ignore:
Timestamp:
Nov 29, 2024, 8:09:33 PM (4 weeks ago)
Author:
sommeria
Message:

mask display fixed

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/civ_input.m

    r1164 r1167  
    217217set(handles.dt_unit,'String',['dt in m' TimeUnit]);%display dt in unit 10-3 of the time (e.g ms)
    218218set(handles.TimeUnit,'String',TimeUnit);
    219 set(handles.SearchRange,'UserData', pxcm_search);
     219% set(handles.SearchRange,'UserData', pxcm_search);
    220220
    221221
     
    231231    if isempty(index_max),index_max=1;end
    232232    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})
    234236    end
    235237else  %case of netcdf file opening, start with the stage read in the file if the input file is being refreshed
     
    277279    fill_GUI(Param.ActionInput,hObject);%fill the GUI with the parameters retrieved from the input Param
    278280
    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)
    280282               SearchRange=round((Param.ActionInput.Civ1.SearchBoxSize-Param.ActionInput.Civ1.CorrBoxSize)/2);
    281283                set(handles.num_SearchRange_1(1),'String',num2str(SearchRange(1)))
     
    413415%Param.CheckCiv1=1;
    414416Param.Civ1.CorrBoxSize=[31 31 1];
    415 Param.Civ1.SearchRange=[15 15 2];
     417Param.Civ1.SearchRange=[15 15];
    416418Param.Civ1.SearchBoxShift=[0 0];
    417419Param.Civ1.CorrSmooth=1;
     
    19151917% Hints: get(hObject,'String') returns contents of num_SearchRange_3 as text
    19161918%        str2double(get(hObject,'String')) returns contents of num_SearchRange_3 as a double
     1919
     1920
     1921
     1922function 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  
    28942894%case of view mask selection
    28952895if 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']);
    28992906    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');
    29242930    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 ***
    29272936        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))
    29302939        elseif ~strcmp(NomType,'*')
    29312940            msgbox_uvmat('ERROR','multilevel masks must be labeled with a single index as _1,_2,...');
    29322941            return
    29332942        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);
    29352946        testmask=1;
    29362947    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 %         end
    2945 %
    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 %         end
    2952     end
    2953     % Mask.Path=MaskPath;
    2954     % if isempty(MaskFile)
    2955     %     Mask.File='';
    2956     % elseif ischar(MaskFile)
    2957     %     Mask.File=MaskFile;
    2958     % else
    2959     %     Mask.File=MaskFile{1};
    2960     % end
    2961     % Mask.NbSlice_i=1;
    2962     % Mask.NbSlice_j=1;
    2963     % if isempty(j1_series)
    2964     %     if isempty(i1_series)
    2965     %         MaskNomType='*';
    2966     %     else
    2967     %     Mask.NbSlice_i=i1_series(1,2,end);
    2968     %     end
    2969     % else
    2970     %     Mask.NbSlice_j=j1_series(1,end,2);
    2971     % end
    2972     % Mask.Ext=MaskExt;
    2973     % Mask.NomType=MaskNomType;
    2974     set(handles.CheckMask,'UserData',Mask);
    2975     errormsg=update_mask(handles);
    29762948else % desactivate mask display
    29772949    MaskData=get(handles.CheckMask,'UserData');
     
    30062978    else
    30072979        MaskIndex_i=1;
    3008         MaskName=MaskInfo.MaskFile;
     2980        MaskName=MaskInfo.File;
    30092981    end
    30102982   
     
    30152987        set(handles.uvmat,'UserData',UvData);
    30162988        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)
    30192991            end
    30202992        else
     
    34883460drawnow
    34893461[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 used
     3462[~,~,~,~,i2,~,j2]=fileparts_uvmat(FileIndex);% check back the indices used
    34913463if isempty(i2), set(handles.i2,'String',''); end % suppress the second i index display if not used
    34923464if isempty(j2), set(handles.j2,'String',''); end % suppress the second j index display if not used
    3493 if isempty(regexp(RootPath,'^http://'))
     3465if isempty(regexp(RootPath,'^http://','once'))
    34943466    filename=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];% build the input file name (first line)
    34953467else
Note: See TracChangeset for help on using the changeset viewer.