Changeset 326 for trunk/src/uvmat.m


Ignore:
Timestamp:
Dec 8, 2011, 8:28:38 AM (13 years ago)
Author:
sommeria
Message:

bug corrected in patch matlab. regexrep introduced in uvmat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r323 r326  
    17781778%% read the current input file name(s) and field indices
    17791779InputFile=read_GUI(handles.InputFile);
    1780 filebase=InputFile.RootPath; %default
    1781 if ~isempty(InputFile.SubDir)
    1782     InputFile.SubDir=regexprep(InputFile.SubDir,'/|\','');
    1783 %    FileName=fullfile(InputFile.RootPath,InputFile.SubDir);
    1784 end
    1785 if ~isempty(InputFile.RootFile)
    1786     InputFile.RootFile=regexprep(InputFile.RootFile,'/|\','');
    1787     filebase=fullfile(filebase,InputFile.RootFile);
     1780InputFile.RootFile=regexprep(InputFile.RootFile,'\<[\\/]|[\\/]\>','');%suppress possible / or \ separator at the beginning or the end of the string
     1781InputFile.SubDir=regexprep(InputFile.SubDir,'\<[\\/]|[\\/]\>','');%suppress possible / or \ separator at the beginning or the end of the string
     1782if isempty(InputFile.RootFile)
     1783    filebase=InputFile.RootPath;
     1784else
     1785    filebase=fullfile(InputFile.RootPath,InputFile.RootFile);
    17881786end
    17891787FileExt=InputFile.FileExt;
    1790 subdir=InputFile.SubDir;
    17911788% [FileName,RootPath,filebase,FileIndices,FileExt,subdir]=read_file_boxes(handles);
    17921789NomType=get(handles.NomType,'String');
     
    18151812     i1=i1+increment;
    18161813     i2=i2+increment;
    1817      [filename,i1,j1,i2,j2]=name_generator(filebase,i1,j1,FileExt,NomType,comp_input,i2,j2,subdir);
     1814     [filename,i1,j1,i2,j2]=name_generator(filebase,i1,j1,FileExt,NomType,comp_input,i2,j2,InputFile.SubDir);
    18181815     if sub_value% set the second field name and indices
    18191816        i1_1=i1_1+increment;
     
    18241821    j1=j1+increment;
    18251822    j2=j2+increment;
    1826     [filename,i1,j1,i2,j2]=name_generator(filebase,i1,j1,FileExt,NomType,comp_input,i2,j2,subdir);
     1823    [filename,i1,j1,i2,j2]=name_generator(filebase,i1,j1,FileExt,NomType,comp_input,i2,j2,InputFile.SubDir);
    18271824    if sub_value
    18281825        j1_1=j1_1+increment;
     
    30953092    SubDir_1=get(handles.SubDir,'String');
    30963093end
    3097 if numel(SubDir_1)>=1
    3098     if (isequal(SubDir_1(1),'/')|| isequal(SubDir_1(1),'\'))
    3099         SubDir_1(1)=[]; %suppress possible / or \ separator
    3100     end
    3101     FileName_1=fullfile(RootPath_1,SubDir_1);
    3102 end
    31033094RootFile_1=get(handles.RootFile_1,'String');
     3095SubDir_1=regexprep(SubDir_1,'\<[\\/]|[\\/]\>','');%suppress possible / or \ separator at the beginning or the end of the string
     3096FileName_1=fullfile(RootPath_1,SubDir_1);
    31043097if isequal(get(handles.RootFile_1,'Visible'),'off') || isequal(RootFile_1,'"')
    31053098    RootFile_1=get(handles.RootFile,'String');
    31063099end
     3100RootFile_1=regexprep(RootFile_1,'\<[\\/]|[\\/]\>','');%suppress possible / or \ separator at the beginning or the end of the string
    31073101if numel(RootFile_1)>=1
    3108     if ~(isequal(RootFile_1(1),'/')||isequal(RootFile_1(1),'\'))
    3109         RootFile_1(1)=[];%suppress possible / or \ separator
    3110     end
    31113102    FileName_1=fullfile(FileName_1,RootFile_1);
    31123103end
     
    32803271    % transform netc type to the corresponding image type
    32813272    if isequal(NomType_1,'_i1-i2_j')||isequal(NomType_1,'_i_j1-j2')|| isequal(NomType_1,'#_ab')|| isequal(NomType_1,'_i1-i2')
    3282         UvData.SubDir_1=get(handles.SubDir_1,'String'); %preserve the subdir in memory   
     3273        UvData.SubDir_1=get(handles.SubDir_1,'String'); %preserve the InputFile.SubDir in memory   
    32833274        if isequal(NomType_1,'_i1-i2_j')||isequal(NomType_1,'_i_j1-j2')
    32843275            NomTypeNew='_i_j';
     
    36423633RootPath=get(handles.RootPath,'String');
    36433634RootFile=get(handles.RootFile,'String');
    3644 if ~isempty(RootFile)&&(isequal(RootFile(1),'/')|| isequal(RootFile(1),'\'))
    3645         RootFile(1)=[];
    3646 end
     3635RootFile=regexprep(RootFile,'\<[\\/]|[\\/]\>','');%suppress possible / or \ separator at the beginning or the end of the string
    36473636filebase=fullfile(RootPath,RootFile);
    36483637list=get(handles.masklevel,'String');
     
    36573646
    36583647%display the mask
    3659 %update_mask(handles,num_i1,num_j1)
    36603648figure;
    36613649vec=linspace(0,1,256);%define a linear greyscale colormap
     
    36713659%------------------------------------------------------------------
    36723660
    3673 
    3674 
    36753661%------------------------------------------------------------------
    36763662% --- Executes on selection change in ListColorScalar: choice of the color code.
    3677 %
    36783663function ListColorScalar_Callback(hObject, eventdata, handles)
    36793664%------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.