Changeset 1187 for trunk/src/series


Ignore:
Timestamp:
Dec 3, 2025, 6:18:13 PM (8 days ago)
Author:
sommeria
Message:

mask accessory updated

Location:
trunk/src/series
Files:
2 edited

Legend:

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

    r1181 r1187  
    9191if isfield(SeriesData,'FileInfo')
    9292    FileType=SeriesData.FileInfo{1}.FileType;% info on the first input file series
    93     %FieldType=SeriesData.FileInfo{1}.FieldType;% info on the first input file series
    9493else
    9594    set(hhseries.REFRESH,'BackgroundColor',[1 0 1])% indicate that the file input in series needs to be refreshed
     
    281280
    282281    if isfield(Param.ActionInput,'Civ1')&& isfield(Param.ActionInput.Civ1,'SearchBoxSize')%transform from SearchBoxSize to SearchRange (old to new convention)
    283                SearchRange=round((Param.ActionInput.Civ1.SearchBoxSize-Param.ActionInput.Civ1.CorrBoxSize)/2);
    284                 set(handles.num_SearchRange_1(1),'String',num2str(SearchRange(1)))
    285                 set(handles.num_SearchRange_2(1),'String',num2str(SearchRange(2)))
    286             end
    287             if isfield(Param.ActionInput,'Civ2')&& isfield(Param.ActionInput.Civ2,'SearchBoxSize')
    288                SearchRange=round((Param.ActionInput.Civ2.SearchBoxSize-Param.ActionInput.Civ2.CorrBoxSize)/2);
    289                 set(handles.num_SearchRange_1(2),'String',num2str(SearchRange(1)))
    290                 set(handles.num_SearchRange_2(2),'String',num2str(SearchRange(2)))
    291             end
     282        SearchRange=round((Param.ActionInput.Civ1.SearchBoxSize-Param.ActionInput.Civ1.CorrBoxSize)/2);
     283        set(handles.num_SearchRange_1(1),'String',num2str(SearchRange(1)))
     284        set(handles.num_SearchRange_2(1),'String',num2str(SearchRange(2)))
     285    end
     286    if isfield(Param.ActionInput,'Civ2')&& isfield(Param.ActionInput.Civ2,'SearchBoxSize')
     287        SearchRange=round((Param.ActionInput.Civ2.SearchBoxSize-Param.ActionInput.Civ2.CorrBoxSize)/2);
     288        set(handles.num_SearchRange_1(2),'String',num2str(SearchRange(1)))
     289        set(handles.num_SearchRange_2(2),'String',num2str(SearchRange(2)))
     290    end
    292291    hcheckgrid=findobj(handles.civ_input,'Tag','CheckGrid');
    293292    for ilist=1:numel(hcheckgrid)
     
    16131612    end
    16141613    j2=j1;
    1615     str_civ=Param.ActionInput.PairIndices.ListPairCiv1;
    1616     r=regexp(str_civ,'^\D(?<ind>[i|j])=( -| )(?<num1>\d+)\|(?<num2>\d+)','names');
    1617     if ~isempty(r)
    1618         if strcmp(r.ind,'i')
    1619             i1=i1-str2num(r.num1);
    1620             i2=i2 +str2num(r.num2);
    1621         elseif strcmp(r.ind,'j')
    1622             j1=j1-str2num(r.num1);
    1623             j2=j2 +str2num(r.num2);
    1624         end
    1625     else % mode='j1-j2';
    1626         r=regexp(str_civ,'^j= (?<num1>[a-z])-(?<num2>[a-z])','names');
    1627         if isempty(r)
    1628             r=regexp(str_civ,'^j= (?<num1>[A-Z])-(?<num2>[A-Z])','names');
     1614    if isfield(Param.ActionInput,'PairIndices')
     1615        str_civ=Param.ActionInput.PairIndices.ListPairCiv1;
     1616        r=regexp(str_civ,'^\D(?<ind>[i|j])=( -| )(?<num1>\d+)\|(?<num2>\d+)','names');
     1617        if ~isempty(r)
     1618            if strcmp(r.ind,'i')
     1619                i1=i1-str2num(r.num1);
     1620                i2=i2 +str2num(r.num2);
     1621            elseif strcmp(r.ind,'j')
     1622                j1=j1-str2num(r.num1);
     1623                j2=j2 +str2num(r.num2);
     1624            end
     1625        else % mode='j1-j2';
     1626            r=regexp(str_civ,'^j= (?<num1>[a-z])-(?<num2>[a-z])','names');
    16291627            if isempty(r)
    1630                 r=regexp(str_civ,'^j= (?<num1>\d+)-(?<num2>\d+)','names');
     1628                r=regexp(str_civ,'^j= (?<num1>[A-Z])-(?<num2>[A-Z])','names');
     1629                if isempty(r)
     1630                    r=regexp(str_civ,'^j= (?<num1>\d+)-(?<num2>\d+)','names');
     1631                end
    16311632            end
    1632         end
    1633         if isempty(r)
    1634             disp('wrong pair mode input option')
    1635         else
    1636             j1=stra2num(r.num1);
    1637             j2=stra2num(r.num2);
    1638         end
    1639     end
    1640    
     1633            if isempty(r)
     1634                disp('wrong pair mode input option')
     1635            else
     1636                j1=stra2num(r.num1);
     1637                j2=stra2num(r.num2);
     1638            end
     1639        end
     1640    end
    16411641    par_civ1=Param.ActionInput.Civ1;
    1642      
     1642    RootPath_A=Param.InputTable{1,1};
     1643    SubDir_A=Param.InputTable{1,2};
     1644    RootFile_A=Param.InputTable{1,3};
     1645    NomType_A=Param.InputTable{1,4};
     1646    FileExt_A=Param.InputTable{1,5};
    16431647    if strcmp(Param.ActionInput.ListCompareMode,'displacement')
    16441648        ImageName_A=Param.ActionInput.RefFile;
    16451649    else
    1646         RootPath_A=Param.InputTable{1,1};
    1647         SubDir_A=Param.InputTable{1,2};
    1648         RootFile_A=Param.InputTable{1,3};
    1649         NomType_A=Param.InputTable{1,4};
    1650         FileExt_A=Param.InputTable{1,5};
    16511650        ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1,[],j1);
    1652         ImageName_B=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i2,[],j2);
    1653     end
     1651    end
     1652    ImageName_B=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i2,[],j2);
    16541653    par_civ1.ImageA = read_image(ImageName_A);
    16551654    par_civ1.ImageB = read_image(ImageName_B);
  • trunk/src/series/civ_series.m

    r1183 r1187  
    341341            if strcmp(Param.ActionInput.ListCompareMode,'displacement')
    342342                ImageName_A=Param.ActionInput.RefFile;
     343                FrameIndex_A=1;
    343344            elseif CheckRelabel
    344345            [RootFile,FrameIndex_A]=index2filename(Param.FileSeries,i1_series_Civ1(ifield),j1_series_Civ1(ifield),MaxIndex_j);
     
    356357                    [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A);
    357358                    FileType_A=FileInfo_A.FileType;
    358                     if isempty(Time) && ~isempty(find(strcmp(FileType_A,{'mmreader','video','cine_phantom','telopsIR'}), 1))% case of video input
     359                    if isempty(Time) && ~isempty(find(strcmp(FileType_A,{'mmreader','video','cine_phantom','telopsIR'}), 1))% case of video inputFrameIndex_A
    359360                        Time=zeros(FileInfo_A.NumberOfFrames+1,2);
    360361                        Time(:,2)=(0:1/FileInfo_A.FrameRate:(FileInfo_A.NumberOfFrames)/FileInfo_A.FrameRate)';
     
    529530                else
    530531                    par_civ1.Mask=[];
     532                    disp_uvmat('ERROR',[maskname ' does not exist'],checkrun);
     533                    return
    531534                end
    532535                mask=par_civ1.Mask;
     
    785788                par_civ2.Mask=mask; %use mask already opened
    786789            else
    787                 if exist(maskname,'file')
     790                if exist(maskname,'file')|| ~isempty(regexp(maskname,'(^http://)|(^https://)', 'once'))
    788791                    try
    789792                        par_civ2.Mask=imread(maskname);%update the mask, an store it for future use
     
    797800                else
    798801                    par_civ2.Mask=[];
     802                    disp_uvmat('ERROR',[maskname ' does not exist'],checkrun);
     803                    return
    799804                end
    800805                mask=par_civ2.Mask;
Note: See TracChangeset for help on using the changeset viewer.