Changeset 1184 for trunk/src/uvmat.m


Ignore:
Timestamp:
Nov 6, 2025, 7:03:02 PM (4 weeks ago)
Author:
sommeria
Message:

bed-scan updated and many updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r1183 r1184  
    4040%          .FileName_1: name of the current second field (used to detect a  constant field during file scanning)
    4141%          .FileType: current file type, as defined by the fct  get_file_type.m)
    42 %          .i1_series,.i2_series,.j1_series,.j1_series: series of i1,i2,j1,j2 indices detected in the input dir,set by  the fct find_file_series
     42%          .i1_series,.i2_series,.j1_series,.j1_series: series of num_i1,num_i2,num_j1,num_j2 indices detected in the input dir,set by  the fct find_file_series
    4343%          .MovieObject: current movie object
    4444%          .TimeUnit: unit for time
     
    280280        end
    281281        if isfield(input,'TimeIndex')
    282             set(handles.i1,num2str(input.TimeIndex))
     282            set(handles.num_i1,num2str(input.TimeIndex))
    283283        end
    284284        if isfield(input,'FieldsString')
     
    21242124                i1_mod=floor(i1_mod/(NbField_j -1))+1;
    21252125            end
    2126             set(handles.i1,'String',num2str(i1_mod));%update the counters
    2127             set(handles.j1,'String',num2str(j1));%update the counters
     2126            set(handles.num_i1,'String',num2str(i1_mod));%update the counters
     2127            set(handles.num_j1,'String',num2str(j1));%update the counters
    21282128            check_index=true;
    21292129        end
     
    21312131end
    21322132if ~check_index
    2133 set(handles.i1,'String',num2str(i1));%update the counters
    2134 set(handles.i2,'String',num2str(i2));
    2135 set(handles.j1,'String',num2str(j1));
    2136 set(handles.j2,'String',num2str(j2));
     2133set(handles.num_i1,'String',num2str(i1));%update the counters
     2134set(handles.num_i2,'String',num2str(i2));
     2135set(handles.num_j1,'String',num2str(j1));
     2136set(handles.num_j2,'String',num2str(j2));
    21372137end
    21382138
     
    21412141function NomType_Callback(hObject, eventdata, handles)
    21422142%------------------------------------------------------------------------
    2143 i1=str2double(get(handles.i1,'String'));
    2144 i2=str2double(get(handles.i2,'String'));
    2145 j1=str2double(get(handles.j1,'String'));
    2146 j2=str2double(get(handles.j2,'String'));
     2143i1=str2double(get(handles.num_i1,'String'));
     2144i2=str2double(get(handles.num_i2,'String'));
     2145j1=str2double(get(handles.num_j1,'String'));
     2146j2=str2double(get(handles.num_j2,'String'));
    21472147NomType=get(hObject,'String');
    21482148if strcmp(NomType,'level')
    2149     FileIndex=str2double(get(handles.i1,'String'));
     2149    FileIndex=str2double(get(handles.num_i1,'String'));
    21502150else
    21512151FileIndex=fullfile_uvmat('','','','',get(handles.NomType,'String'),i1,i2,j1,j2);
     
    21592159function NomType_1_Callback(hObject, eventdata, handles)
    21602160%------------------------------------------------------------------------
    2161 i1=str2double(get(handles.i1,'String'));
    2162 i2=str2double(get(handles.i2,'String'));
    2163 j1=str2double(get(handles.j1,'String'));
    2164 j2=str2double(get(handles.j2,'String'));
     2161i1=str2double(get(handles.num_i1,'String'));
     2162i2=str2double(get(handles.num_i2,'String'));
     2163j1=str2double(get(handles.num_j1,'String'));
     2164j2=str2double(get(handles.num_j2,'String'));
    21652165NomType=get(hObject,'String');
    21662166if strcmp(NomType,'level')
    2167     FileIndex=str2double(get(handles.i1,'String'));
     2167    FileIndex=str2double(get(handles.num_i1,'String'));
    21682168else
    21692169FileIndex=fullfile_uvmat('','','','',get(handles.NomType_1,'String'),i1,i2,j1,j2);
     
    21742174
    21752175%------------------------------------------------------------------------
    2176 % --- Executes on button press in InputFileREFRESH.
     2176% --- Executes on press in button tagged 'InputFileREFRESH'.
    21772177function InputFileREFRESH_Callback(hObject, eventdata, handles)
    21782178%------------------------------------------------------------------------
     
    21802180set(handles.uvmat,'Pointer','watch') % set the mouse pointer to 'watch'
    21812181drawnow
    2182 % get the current input file name:
    2183 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);
    2184 % detect the file type, get the movie object if relevant, and look for the corresponding file series:
    2185 %[RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);
     2182[RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);% get the current input file name:
    21862183errormsg='';
    2187 if isempty(RootFile)
     2184if isempty(RootFile)% open the file browser if the input file is not defined
    21882185    fileinput=uigetfile_uvmat('pick an input file',fullfile(RootPath,SubDir));
    21892186    hh=dir(fileinput);
     
    21982195        end
    21992196    end
    2200 else
    2201     % initiate the input file series and refresh the current field view:
     2197else      % initiate the input file series and refresh the current field view:
    22022198    [FileInfo,VideoObject]=get_file_info(fullfile(RootPath,SubDir,[RootFile FileIndices FileExt]));
    22032199    errormsg=update_rootinfo(handles,RootPath,SubDir,[RootFile FileIndices FileExt],FileInfo,VideoObject,1);
     
    22082204    [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles);
    22092205    % detect the file type, get the movie object if relevant, and look for the corresponding file series:
    2210     [RootPath,SubDir,~,i1_series,i2_series,j1_series,j2_series,~,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);
     2206    [RootPath,SubDir,~,i1_series,~,~,~,~,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);
    22112207    if isempty(i1_series)
    22122208        fileinput=uigetfile_uvmat('pick an input file for the second line',fullfile(RootPath,SubDir));
     
    23112307%[FilePath,FileName,FileExt]=fileparts(fileinput);
    23122308% detect the file type, get the movie object if relevant, and look for the corresponding file series:
    2313 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists
     2309% the root name and indices may be corrected by including the first index num_i1 if a corresponding xml file exists
    23142310
    23152311set(handles_RootPath,'String',RootPath);
     
    23282324if input_line==1
    23292325    % fill file index counters if the first file series is opened
    2330     set(handles.i1,'String',num2str(i1));
    2331     set(handles.i2,'String',num2str(i2));
    2332     set(handles.j1,'String',num2stra(j1,NomType));
    2333     set(handles.j2,'String',num2stra(j2,NomType));
     2326    set(handles.num_i1,'String',num2str(i1));
     2327    set(handles.num_i2,'String',num2str(i2));
     2328    set(handles.num_j1,'String',num2stra(j1,NomType));
     2329    set(handles.num_j2,'String',num2stra(j2,NomType));
    23342330    if isfield(FileInfo,'MaskFile')
    23352331        if exist(FileInfo.MaskFile,'file')
     
    23502346    end
    23512347else %read the current field index to synchronise with the first series
    2352     i1_s=str2double(get(handles.i1,'String'));
    2353     i2_0=str2double(get(handles.i2,'String'));
     2348    i1_s=str2double(get(handles.num_i1,'String'));
     2349    i2_0=str2double(get(handles.num_i2,'String'));
    23542350    if ~isempty(i2_0)
    23552351        i2_s=i2_0;
     
    23572353        i2_s=i2;
    23582354    end
    2359     j1_0=stra2num(get(handles.j1,'String'));
     2355    j1_0=stra2num(get(handles.num_j1,'String'));
    23602356    if ~isempty(j1_0)
    23612357        j1_s=j1_0;
     
    23632359        j1_s=j1;
    23642360    end
    2365     j2_0=stra2num(get(handles.j2,'String'));
     2361    j2_0=stra2num(get(handles.num_j2,'String'));
    23662362    if ~isempty(j2_0)
    23672363        j2_s=j2_0;
     
    24442440XmlFileName=find_imadoc(RootPath,SubDir);% search the appropriate ImaDoc xml file
    24452441[~,XmlName]=fileparts(XmlFileName);
    2446 
    24472442CheckIndexing=false;% test for virtual indexing of frames different from the file name index, false by default
    24482443if isempty(XmlFileName) %no ImaDoc xml file detected
     
    24532448    set(handles.view_xml,'String','view xml')
    24542449    drawnow
    2455     [XmlData,warntext]=imadoc2struct(XmlFileName);
     2450    [XmlData,warntext]=imadoc2struct(XmlFileName);% open xml file ImaDoc
    24562451    if ~isempty(warntext)
    24572452        msgbox_uvmat('WARNING',warntext)
     
    24742469end
    24752470if CheckIndexing
    2476 set(handles.MenuRelabelFrames,'checked','on')% activate the relabel tool by default
     2471    set(handles.MenuRelabelFrames,'checked','on')% activate the relabel tool by default
    24772472else
    24782473    set(handles.MenuRelabelFrames,'checked','off')
     
    24882483TimeUnit='';%default
    24892484TimeName='';%default
     2485state_j='off'; % no visualisation of the j index by default
    24902486
    24912487%% get the file series
     
    24972493    j1_series=[];
    24982494    j2_series=[];
    2499     nbfield=[];
     2495    nbfield_i=[];
    25002496    nbfield_j=[];
    25012497    FileInfo=XmlData.FileInfo;
    2502     %     if iscell(XmlData.FileSeries.FileName)(handles.i1,'String','1')
    2503     set(handles.i1,'String','1')% the index does not correspond to file name index anymore
    2504     set(handles.j1,'String','1')
     2498    set(handles.num_i1,'String','1')% the index does not correspond to file name index anymore, set i=1, j=1 by default as s start
     2499    set(handles.num_j1,'String','1')
    25052500else % scan the input folder to get the list of existing files and NomType
    25062501    [~,~,~,i1_series,i2_series,j1_series,j2_series,NomType,FileInfo,MovieObject]=...
    25072502        find_file_series(fullfile(RootPath,SubDir),FileName);
    2508     nbfield=max(max(max(i2_series)));% total number of fields (i index)
    2509     if isempty(nbfield)
    2510         nbfield=max(max(max(i1_series)));
     2503    nbfield_i=max(max(max(i2_series)));% total number of fields (i index)
     2504    if isempty(nbfield_i)
     2505        nbfield_i=max(max(max(i1_series)));
    25112506    end
    25122507    nbfield_j=max(max(max(j2_series)));% number of fields along j index
     
    25152510    end
    25162511    if ~isempty(j1_series)&& ~strcmp(NomType,'*')% the j index is used to label the frame in multimage series
    2517         set(handles.j1,'String','1')
     2512        set(handles.num_j1,'String','1')
     2513             state_j='on';
    25182514    elseif strcmp(FileInfo.FieldType,'image') && ~isequal(FileInfo.NumberOfFrames,1)
    2519         set(handles.i1,'String','1')
     2515        set(handles.num_i1,'String','1')
    25202516    end
    25212517end
     
    25252521    set(handles.NomType_1,'String',NomType)
    25262522end
    2527 % if CheckIndexing
    2528 % %     i1=str2double(get(handles.FileIndex,'String'));
    2529 % %     if isnan(i1)
    2530 % %         i1=1;
    2531 % %     else
    2532 % %         i1=(i1-XmlData.FileSeries.FirstFileIndex)*XmlData.FileSeries.NbFramePerFile+1;%frame index deduced from input file index
    2533 % %     end
    2534 % %     if strcmp(TimeName,'xml')% indices i and j
    2535 % %         j1=mod(i1-1,nbfield_j)+1;
    2536 % %         i1=floor((i1-1)/nbfield_j)+1;
    2537 % %         set(handles.j1,'String',num2str(j1))
    2538 % %     end
    2539 % %     set(handles.i1,'String',num2str(i1))
    2540 %
    2541 % end
    25422523
    25432524
     
    25622543            TimeName='xml';%Time possibly documented by the xml file (but priority to the opened file if available)
    25632544end
    2564 
    2565 if ~CheckIndexing && isfield(FileInfo,'FrameRate')% frame rate given in the file (case of video data)
    2566     TimeUnit='s';
    2567     if isempty(j1_series) %frame index along i
    2568         XmlData.Time=zeros(FileInfo.NumberOfFrames+1,2);
    2569         XmlData.Time(:,2)=(0:1/FileInfo.FrameRate:(FileInfo.NumberOfFrames)/FileInfo.FrameRate)';
    2570         set(handles.i1,'String','1')% set the frame index to 1 to start the movie
     2545if CheckIndexing
     2546    i1=str2double(get(handles.FileIndex,'String'));
     2547    if isnan(i1)
     2548        i1=1;
    25712549    else
    2572         XmlData.Time=[0;ones(size(i1_series,3)-1,1)]*(0:1/FileInfo.FrameRate:(FileInfo.NumberOfFrames)/FileInfo.FrameRate);
     2550        FirstFileIndex=1;
     2551        if isfield(XmlData.FileSeries,'FirstFileIndex')
     2552            FirstFileIndex=XmlData.FileSeries.FirstFileIndex;
     2553        end
     2554        i1=(i1-FirstFileIndex)*XmlData.FileSeries.NbFramePerFile+1;%frame index deduced from input file index
     2555    end
     2556    if isfield(XmlData,'Time') && size(XmlData.Time,2)>1%
     2557        nbfield_j=size(XmlData.Time,2)-1;
     2558        nbfield_i=size(XmlData.Time,1)-1;
     2559        j1=mod(i1-1,nbfield_j)+1;
     2560        i1=floor((i1-1)/nbfield_j)+1;
     2561        set(handles.num_j1,'String',num2str(j1))
     2562        state_j='on';
     2563    end
     2564    set(handles.num_i1,'String',num2str(i1))
     2565else
     2566    if isfield(FileInfo,'FrameRate')% frame rate given in the file (case of video data)
     2567        TimeUnit='s';
     2568        if isempty(j1_series) %frame index along i
     2569            XmlData.Time=zeros(FileInfo.NumberOfFrames+1,2);
     2570            XmlData.Time(:,2)=(0:1/FileInfo.FrameRate:(FileInfo.NumberOfFrames)/FileInfo.FrameRate)';
     2571            set(handles.num_i1,'String','1')% set the frame index to 1 to start the movie
     2572        else
     2573            XmlData.Time=[0;ones(size(i1_series,3)-1,1)]*(0:1/FileInfo.FrameRate:(FileInfo.NumberOfFrames)/FileInfo.FrameRate);
     2574            state_j='on';
     2575        end
    25732576    end
    25742577end
     
    26182621%% store last index in handles.MaxIndex_i and .MaxIndex_j
    26192622last_i_cell=get(handles.MaxIndex_i,'String');
    2620 if isempty(nbfield)
     2623if isempty(nbfield_i)
    26212624    last_i_cell{input_line}='';
    26222625else
    2623     last_i_cell{input_line}=num2str(nbfield);
     2626    last_i_cell{input_line}=num2str(nbfield_i);
    26242627end
    26252628set(handles.MaxIndex_i,'String',last_i_cell)
     
    26292632else
    26302633     last_j_cell{input_line}=num2str(nbfield_j);
     2634
    26312635end
    26322636set(handles.MaxIndex_j,'String',last_j_cell);
     
    27452749        end
    27462750    otherwise
    2747         set(handles_Fields,'Value',1) % set menu to 'image'
     2751        set(handles_Fields,'Value',1) % set menu to 'image'j1_series
    27482752        set(handles_Fields,'String',{'image'})
    27492753        %set(handles.Coord_x,'Value',1);
     
    27572761%% set index navigation options
    27582762scan_option='i';%default
    2759 state_j='off'; %default
     2763%state_j='off'; %default
    27602764if input_line==2
    27612765    if get(handles.scan_j,'Value')
    27622766        scan_option='j'; %keep the scan option for the second file series
    27632767    end
    2764     if strcmp(get(handles.j1,'Visible'),'on')
     2768    if strcmp(get(handles.num_j1,'Visible'),'on')
    27652769        state_j='on';
    27662770    end
     
    27992803end
    28002804set(handles.scan_j,'Visible',state_j)
    2801 set(handles.j1,'Visible',state_j)
    2802 set(handles.j2,'Visible',state_j)
     2805set(handles.num_j1,'Visible',state_j)
     2806set(handles.num_j2,'Visible',state_j)
    28032807set(handles.MaxIndex_j,'Visible',state_j);
    28042808set(handles.j_text,'Visible',state_j);
     
    28502854
    28512855%------------------------------------------------------------------------
    2852 function i1_Callback(hObject, eventdata, handles)
     2856function num_i1_Callback(hObject, eventdata, handles)
    28532857%------------------------------------------------------------------------
    28542858update_ij(handles,1)
    28552859
    28562860%------------------------------------------------------------------------
    2857 function i2_Callback(hObject, eventdata, handles)
     2861function num_i2_Callback(hObject, eventdata, handles)
    28582862%------------------------------------------------------------------------
    28592863update_ij(handles,2)
    28602864
    28612865%------------------------------------------------------------------------
    2862 function j1_Callback(hObject, eventdata, handles)
     2866function num_j1_Callback(hObject, eventdata, handles)
    28632867%------------------------------------------------------------------------
    28642868update_ij(handles,3)
    28652869
    28662870%------------------------------------------------------------------------
    2867 function j2_Callback(hObject, eventdata, handles)
     2871function num_j2_Callback(hObject, eventdata, handles)
    28682872%------------------------------------------------------------------------
    28692873update_ij(handles,4)
    28702874
    28712875%------------------------------------------------------------------------
    2872 %--- update the index display after action on edit boxes i1, i2, j1 or j2
     2876%--- update the index display after action on edit boxes num_i1, num_i2, num_j1 or num_j2
    28732877%------------------------------------------------------------------------
    28742878function update_ij(handles,index_rank)
     
    28782882
    28792883if strcmp(NomType,'level')
    2880     index_string=get(handles.i1,'String');
     2884    index_string=get(handles.num_i1,'String');
    28812885else
    28822886    index_string=get(handles.FileIndex,'String');
    28832887    if isfield(UvData,'XmlData')&& isfield(UvData.XmlData{1},'FileSeries')
    2884         i1=str2double(get(handles.i1,'String'));
    2885         j1=str2double(get(handles.j1,'String'));
     2888        i1=str2double(get(handles.num_i1,'String'));
     2889        j1=str2double(get(handles.num_j1,'String'));
    28862890        NbField_j_cell=get(handles.MaxIndex_j,'String');
    28872891        NbField_j=str2double(NbField_j_cell{1});
    2888         [RootFile,index_string,FrameIndex]=index2filename(UvData.XmlData{1}.FileSeries,i1,j1,NbField_j);
     2892        RootFile=index2filename(UvData.XmlData{1}.FileSeries,i1,j1,NbField_j);
     2893        index_string='';
    28892894        set(handles.RootFile,'String',RootFile)
    28902895    else
     
    28922897        switch index_rank
    28932898            case 1
    2894                 index_string=fullfile_uvmat('','','','',NomType,stra2num(get(handles.i1,'String')),i2,j1,j2);
     2899                index_string=fullfile_uvmat('','','','',NomType,stra2num(get(handles.num_i1,'String')),i2,j1,j2);
    28952900            case 2
    2896                 index_string=fullfile_uvmat('','','','',NomType,i1,stra2num(get(handles.i2,'String')),j1,j2);
     2901                index_string=fullfile_uvmat('','','','',NomType,i1,stra2num(get(handles.num_i2,'String')),j1,j2);
    28972902            case 3
    2898                 index_string=fullfile_uvmat('','','','',NomType,i1,i2,stra2num(get(handles.j1,'String')),j2);
     2903                index_string=fullfile_uvmat('','','','',NomType,i1,i2,stra2num(get(handles.num_j1,'String')),j2);
    28992904            case 4
    2900                 index_string=fullfile_uvmat('','','','',NomType,i1,i2,j1,stra2num(get(handles.j2,'String')));
     2905                index_string=fullfile_uvmat('','','','',NomType,i1,i2,j1,stra2num(get(handles.num_j2,'String')));
    29012906        end
    29022907    end
     
    29082913    NomType_1=get(handles.NomType_1,'String');
    29092914    index_string_1=get(handles.FileIndex_1,'String');
    2910     [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
     2915    [~,~,~,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(index_string_1);% the index_string for the second series taken from FileIndex_1
    29112916    switch index_rank
    29122917        case 1
    2913             index_string_1=fullfile_uvmat('','','','',NomType_1,stra2num(get(handles.i1,'String')),i2_1,j1_1,j2_1);
     2918            index_string_1=fullfile_uvmat('','','','',NomType_1,stra2num(get(handles.num_i1,'String')),i2_1,j1_1,j2_1);
    29142919        case 2
    2915             index_string_1=fullfile_uvmat('','','','',NomType_1,i1_1,stra2num(get(handles.i2,'String')),j1_1,j2_1);
     2920            index_string_1=fullfile_uvmat('','','','',NomType_1,i1_1,stra2num(get(handles.num_i2,'String')),j1_1,j2_1);
    29162921        case 3
    2917             index_string_1=fullfile_uvmat('','','','',NomType_1,i1_1,i2_1,stra2num(get(handles.j1,'String')),j2_1);
     2922            index_string_1=fullfile_uvmat('','','','',NomType_1,i1_1,i2_1,stra2num(get(handles.num_j1,'String')),j2_1);
    29182923        case 4
    2919             index_string_1=fullfile_uvmat('','','','',NomType_1,i1_1,i2_1,j1_1,stra2num(get(handles.j2,'String')));
     2924            index_string_1=fullfile_uvmat('','','','',NomType_1,i1_1,i2_1,j1_1,stra2num(get(handles.num_j2,'String')));
    29202925    end
    29212926    set(handles.FileIndex_1,'String',index_string_1)
     
    29472952%------------------------------------------------------------------------
    29482953mode=get(handles.slices,'String');
    2949 nb_slice_str=get(handles.num_NbSlice,'String');
    29502954if strcmp(mode,'volume')
    2951     z=stra2num(get(handles.j1,'String'));
    2952 else
    2953     num=str2double(get(handles.i1,'String'));
     2955    z=stra2num(get(handles.num_j1,'String'));
     2956else
     2957    num=str2double(get(handles.num_i1,'String'));
    29542958    nbslice=str2double(get(handles.num_NbSlice,'String'));
    29552959    z=mod(num-1,nbslice)+1;
     
    29802984        FileXml=fullfile(RootPath,[regexprep(SubDir,'\..+$','') '.xml']);
    29812985    end
    2982     heditxml=editxml(FileXml);
     2986    editxml(FileXml);
    29832987end
    29842988
     
    29902994if isequal(get(handles.CheckMask,'Value'),1)
    29912995    [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles);
    2992     if isempty(regexp(RootPath,'^http://'))
     2996    if isempty(regexp(RootPath,'^http://', 'once'))% not opendap input file
    29932997        fileinput=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];% build the input file name (first line)
    29942998    else
     
    30293033        [MaskPath,FileName,FileExt]=fileparts(filemask);
    30303034        Mask.File=filemask;
    3031         [RootPath,SubDir,RootFile,i1_series,i2,j1,j2,NomType]=find_file_series(MaskPath,[FileName FileExt]);
     3035        [~,~,~,i1_series,~,~,~,NomType]=find_file_series(MaskPath,[FileName FileExt]);
    30323036        Mask.NbSlice=[];%default
    30333037        Mask.VolumeScan=0;% TO UPDATE ***
     
    30453049            msgbox_uvmat(['ERROR','error in displaying mask, ' errormsg]);
    30463050        end
    3047         testmask=1;
    30483051    end
    30493052else % desactivate mask display
     
    30733076    if isfield(MaskInfo,'NbSlice')&& ~isempty(MaskInfo.NbSlice)
    30743077        if isfield(MaskInfo,'VolumeScan') &&  MaskInfo.VolumeScan
    3075             MaskIndex_i=str2double(get(handles.j1,'String'));
     3078            MaskIndex_i=str2double(get(handles.num_j1,'String'));
    30763079        else
    3077             MaskIndex_i=mod(str2double(get(handles.i1,'String'))-1,MaskInfo.NbSlice)+1;
     3080            MaskIndex_i=mod(str2double(get(handles.num_i1,'String'))-1,MaskInfo.NbSlice)+1;
    30783081        end
    30793082        MaskName=[MaskInfo.File '_' num2str(MaskIndex_i) '.png'];
     
    32743277UvData=get(handles.uvmat,'UserData');
    32753278if isfield(UvData,'XmlData') && isfield(UvData.XmlData{1},'FileSeries')% case of indexing documented by the xml file
    3276     i1=str2double(get(handles.i1,'String'));
    3277     j1=str2double(get(handles.j1,'String'));%read the field indices (for movie, it is not given by the file name)
     3279    i1=str2double(get(handles.num_i1,'String'));
     3280    j1=str2double(get(handles.num_j1,'String'));%read the field indices (for movie, it is not given by the file name)
    32783281    i2=[];j2=[];
    32793282else
    32803283    [~,~,~,i1,i2,j1,j2]=fileparts_uvmat(InputFile.FileIndex);% check back the indices used
    32813284    if isempty(i1)% no i index set by the input file name
    3282         i1=str2double(get(handles.i1,'String'));%read the field indices (for movie, it is not given by the file name)
    3283     elseif isempty(j1) && strcmp(get(handles.j1,'Visible'),'on')
    3284         j1=str2double(get(handles.j1,'String'));%case of indexed movie
     3285        i1=str2double(get(handles.num_i1,'String'));%read the field indices (for movie, it is not given by the file name)
     3286    elseif isempty(j1) && strcmp(get(handles.num_j1,'Visible'),'on')
     3287        j1=str2double(get(handles.num_j1,'String'));%case of indexed movie
    32853288    end
    32863289end
     
    32903293    [~,~,~,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(InputFile.FileIndex_1);% the indices for the second series taken from FileIndex_1
    32913294    if isempty(i1_1)
    3292         i1_1=str2double(get(handles.i1,'String'));%read the field indices (for movie, it is not given by the file name)
    3293     elseif isempty(j1_1) && strcmp(get(handles.j1,'Visible'),'on')
    3294         j1_1=str2double(get(handles.j1,'String'));%case of indexed movie
     3295        i1_1=str2double(get(handles.num_i1,'String'));%read the field indices (for movie, it is not given by the file name)
     3296    elseif isempty(j1_1) && strcmp(get(handles.num_j1,'Visible'),'on')
     3297        j1_1=str2double(get(handles.num_j1,'String'));%case of indexed movie
    32953298    end
    32963299else
     
    33023305    set(handles.CheckFixPair,'Value',0)
    33033306end
    3304 %CheckFixPair=get(handles.CheckFixPair,'Value')||(isempty(i2)&& isempty(j2));
    3305 
    3306 % the pair i1-i2 or j1-j2 is imposed (check box CheckFixPair selected)
     3307%CheckFixPair=get(handles.CheckFixPair,'Value')||(isempty(num_i2)&& isempty(num_j2));
     3308
     3309% the pair num_i1-num_i2 or num_j1-num_j2 is imposed (check box CheckFixPair selected)
    33073310if isnumeric(increment)
    33083311    if get(handles.scan_i,'Value')==1  % case of scanning along index i
     
    33223325    end
    33233326
    3324     % the pair i1-i2 or j1-j2 is free (check box CheckFixPair not selected): the list of existing indices recorded in UvData is used
     3327    % the pair num_i1-num_i2 or num_j1-num_j2 is free (check box CheckFixPair not selected): the list of existing indices recorded in UvData is used
    33253328else
    33263329    ref_i=i1;
     
    34653468
    34663469%% update the index counters if the index move is successfull
    3467 
    34683470if isempty(errormsg)
    3469     set(handles.i1,'String',num2stra(i1,NomType,1));
     3471    set(handles.num_i1,'String',num2stra(i1,NomType,1));
    34703472    if isequal(i2,i1)
    3471         set(handles.i2,'String','');
     3473        set(handles.num_i2,'String','');
    34723474    else
    3473         set(handles.i2,'String',num2stra(i2,NomType,1));
    3474     end
    3475     set(handles.j1,'String',num2stra(j1,NomType,2));
     3475        set(handles.num_i2,'String',num2stra(i2,NomType,1));
     3476    end
     3477    set(handles.num_j1,'String',num2stra(j1,NomType,2));
    34763478    if isequal(j2,j1)
    3477         set(handles.j2,'String','');
     3479        set(handles.num_j2,'String','');
    34783480    else
    3479         set(handles.j2,'String',num2stra(j2,NomType,2));
     3481        set(handles.num_j2,'String',num2stra(j2,NomType,2));
    34803482    end
    34813483    if strcmp(NomType,'level')
     
    34963498        set(handles.FileIndex_1,'String',indices_1);
    34973499    end
    3498     if isempty(i2), set(handles.i2,'String',''); end % suppress the second index display if not used
    3499     if isempty(j2), set(handles.j2,'String',''); end
     3500    if isempty(i2), set(handles.num_i2,'String',''); end % suppress the second index display if not used
     3501    if isempty(j2), set(handles.num_j2,'String',''); end
    35003502end
    35013503
     
    35083510if ~get(handles.movie_pair,'value')
    35093511    set(handles.movie_pair,'BusyAction','Cancel')%stop movie pair if button is 'off'
    3510     set(handles.i2,'String','')% the second i index display is suppressed
    3511     set(handles.j2,'String','')% the second j index display is suppressed
     3512    set(handles.num_i2,'String','')% the second i index display is suppressed
     3513    set(handles.num_j2,'String','')% the second j index display is suppressed
    35123514    set(handles.Dt_txt,'String','')% the time interval indication is suppressed
    35133515    return
     
    35233525
    35243526%% make movie until movie speed is set to 0 or STOP is activated
    3525 hima=findobj(handles.PlotAxes,'Tag','ima');% %handles.PlotAxes =main plotting window (A GENERALISER)
    35263527set(handles.STOP,'Visible','on')
    35273528set(handles.speed,'Visible','on')
     
    35413542    end
    35423543    pause(1.02-get(handles.speed,'Value'));% wait for next image
    3543     get(handles.speed,'Value')~=0 && isequal(get(handles.movie_pair,'BusyAction'),'queue')
    35443544end
    35453545set(handles.movie_pair,'BackgroundColor',[1 0 0])%paint the command button in red
    35463546set(handles.movie_pair,'Value',0)
    35473547set(handles.Dt_txt,'String','')
    3548 
    35493548set(handles.runplus,'BackgroundColor',[1 0 0])%paint the command button back in red
    35503549
    35513550
    35523551%------------------------------------------------------------------------
    3553 % --- Executes on button press in InputFileREFRESH.
     3552% --- Executes on press in button tagged 'REFRESH'.
    35543553function REFRESH_Callback(hObject, eventdata, handles)
    35553554%------------------------------------------------------------------------
     
    35583557[RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles);%read the features of the input file name (first line)
    35593558[~,~,~,~,i2,~,j2]=fileparts_uvmat(FileIndex);% check back the indices used
    3560 if isempty(i2), set(handles.i2,'String',''); end % suppress the second i index display if not used
    3561 if isempty(j2), set(handles.j2,'String',''); end % suppress the second j index display if not used
    3562 if isempty(regexp(RootPath,'^http://','once'))
     3559if isempty(i2), set(handles.num_i2,'String',''); end % suppress the second i index display if not used
     3560if isempty(j2), set(handles.num_j2,'String',''); end % suppress the second j index display if not used
     3561if isempty(regexp(RootPath,'^http://','once'))% if the input is not opendap
    35633562    filename=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];% build the input file name (first line)
    35643563else
     
    35713570    filename_1=[fullfile(RootPath_1,SubDir_1,RootFile_1) FileIndex_1 FileExt_1]; %build the input file name (second line)
    35723571end
    3573 num_i1=stra2num(get(handles.i1,'String'));
    3574 num_i2=stra2num(get(handles.i2,'String'));
    3575 num_j1=stra2num(get(handles.j1,'String'));
    3576 num_j2=stra2num(get(handles.j2,'String'));
    3577 [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(FileIndex_1);% get the indices of the second series from the string FileIndex_1
     3572num_i1=stra2num(get(handles.num_i1,'String'));
     3573num_i2=stra2num(get(handles.num_i2,'String'));
     3574num_j1=stra2num(get(handles.num_j1,'String'));
     3575num_j2=stra2num(get(handles.num_j2,'String'));
     3576[~,~,~,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(FileIndex_1);% get the indices of the second series from the string FileIndex_1
    35783577if isempty(j1_1)% case of movies, the index is not given by file index
    35793578    j1_1=num_j1;
    35803579end
    3581 % in case of movies the index is set by edit boxes i1 or j1 (case of movies indexed by index i)
     3580% in case of movies the index is set by edit boxes num_i1 or num_j1 (case of movies indexed by index i)
    35823581errormsg=refresh_field(handles,filename,filename_1,num_i1,num_i2,num_j1,num_j2,i1_1,i2_1,j1_1,j2_1);
    35833582ResizeFcn(handles.uvmat,[],handles)
     
    36613660    frame_index=1;%default
    36623661    if UvData.FileInfo{1}.NumberOfFrames>1
     3662        % if strcmp(NomType,'*')
     3663        %     if num_i1>UvData.FileInfo{1}.NumberOfFrames
     3664        %         errormsg='specified frame index exceeds file content';
     3665        %         return
     3666        %     else
     3667        %         frame_index=num_i1;%frame index from a single movies or multimage
     3668        %     end
     3669        % else
     3670        %     if num_j1>UvData.FileInfo{1}.NumberOfFrames
     3671        %         errormsg='specified frame index exceeds file content';
     3672        %         return
     3673        %     else
     3674        %         frame_index=num_j1;% frame index from a set of indexed movies
     3675        %     end
     3676        % end
    36633677        if strcmp(NomType,'*')
    3664             if num_i1>UvData.FileInfo{1}.NumberOfFrames
    3665                 errormsg='specified frame index exceeds file content';
    3666                 return
    3667             else
    3668                 frame_index=num_i1;%frame index from a single movies or multimage
    3669             end
     3678             frame_index=num_i1;%frame index from a single movies or multimage
    36703679        else
    3671             if num_j1>UvData.FileInfo{1}.NumberOfFrames
    3672                 errormsg='specified frame index exceeds file content';
    3673                 return
    3674             else
    3675                 frame_index=num_j1;% frame index from a set of indexed movies
    3676             end
     3680              frame_index=num_j1;% frame index from a set of indexed movies
    36773681        end
    36783682    end
     
    39883992            % TODO: look for time unit attribute
    39893993        elseif ~isempty(regexp(TimeName,'^dim:', 'once'))
    3990             abstime=str2double(get(handles.i1,'String'));
     3994            abstime=str2double(get(handles.num_i1,'String'));
    39913995            TimeUnit='index';
    39923996        end
     
    48734877                    set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])% put file index in the root name
    48744878                    set(handles.NomType,'String','')
    4875                     set(handles.i1,'String','1')% set counter to 1 (now the time index in the input matrix)
     4879                    set(handles.num_i1,'String','1')% set counter to 1 (now the time index in the input matrix)
    48764880                    MaxIndex_i=get(handles.MaxIndex_i,'String');
    48774881                    MaxIndex_i{1}=num2str(GetFieldData.Time.TimeDimension);
     
    48854889                    set(handles.NomType,'String','*')
    48864890                    set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])
    4887                     set(handles.i1,'String','1')% set counter to 1 (now the time index in the input matrix)
     4891                    set(handles.num_i1,'String','1')% set counter to 1 (now the time index in the input matrix)
    48884892                    MaxIndex_i=get(handles.MaxIndex_i,'String');
    48894893                    MaxIndex_i{1}=num2str(GetFieldData.Time.TimeDimension);
     
    52085212    UvData.FileName_1='';% desactivate the use of a constant second file
    52095213    set(handles.uvmat,'UserData',UvData)
    5210     num_i1=stra2num(get(handles.i1,'String'));
    5211     num_i2=stra2num(get(handles.i2,'String'));
    5212     num_j1=stra2num(get(handles.j1,'String'));
    5213     num_j2=stra2num(get(handles.j2,'String'));
     5214    num_i1=stra2num(get(handles.num_i1,'String'));
     5215    num_i2=stra2num(get(handles.num_i2,'String'));
     5216    num_j1=stra2num(get(handles.num_j1,'String'));
     5217    num_j2=stra2num(get(handles.num_j2,'String'));
    52145218    [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(['xx' FileIndex_1]);
    52155219    errormsg=refresh_field(handles,FileName,FileName_1,num_i1,num_i2,num_j1,num_j2,i1_1,i2_1,j1_1,j2_1);
     
    62976301% Hints: contents = cellstr(get(hObject,'String')) returns LogLinHisto contents as cell array
    62986302%        contents{get(hObject,'Value')} returns selected item from LogLinHisto
    6299 
    6300 
    6301 
    6302 
Note: See TracChangeset for help on using the changeset viewer.