Changeset 844


Ignore:
Timestamp:
Dec 15, 2014, 10:03:23 PM (10 years ago)
Author:
sommeria
Message:

various bugs repaired

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r842 r844  
    279279            Param.HiddenData.FileInfo{2},Param.HiddenData.MovieObject{2},2)
    280280    end
     281    %% enable field and veltype menus, in accordance with the current action
     282ActionName_Callback([],[], handles)
     283
     284%% set length of waitbar
     285displ_time(handles)
     286
    281287else
    282288    set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refresh is needed
     
    592598    end
    593599end
     600%% enable field and veltype menus, in accordance with the current action
     601ActionName_Callback([],[], handles)
     602
     603%% set length of waitbar
     604displ_time(handles)
     605
    594606set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH  button to red color (indicate activation finished)
    595607set(handles.series,'Pointer','arrow') % set the mouse pointer to 'watch'
     
    764776%% initiate input file series and refresh the current field view:     
    765777update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,iview);
     778%% enable field and veltype menus, in accordance with the current action
     779ActionName_Callback([],[], handles)
     780
     781%% set length of waitbar
     782displ_time(handles)
     783
    766784set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH  button to red color (end of activation)
    767785
     
    10421060CData=cat(3,zeros(size(CData)),CData,zeros(size(CData)));%make color images r=0,g,b=0
    10431061set(handles.FileStatus,'CData',CData);
    1044 
    1045 %% enable field and veltype menus, in accordance with the current action
    1046 ActionName_Callback([],[], handles)
    1047 
    1048 %% set length of waitbar
    1049 displ_time(handles)
    1050 
    10511062
    10521063%-----------------------------------------------------------guide -------------
     
    21752186
    21762187%% definition of the directory containing the output files
    2177 SubDirOut='';%default
    2178 OutputDirExt='.series'; %default
    2179 if isfield(ParamOut,'OutputDirExt')&&~isempty(ParamOut.OutputDirExt)
    2180     OutputDirExt=ParamOut.OutputDirExt;
    2181 end
    2182 set(handles.OutputDirExt,'String',OutputDirExt)
    2183 OutputDirVisible='off';
    2184 OutputSubDirMode='auto';%default
    2185 if isfield(ParamOut,'OutputSubDirMode')
    2186     OutputSubDirMode=ParamOut.OutputSubDirMode;
    2187 end
    2188 switch OutputSubDirMode
    2189     case 'auto';%default
    2190         OutputDirVisible='on';
    2191         SubDir=InputTable(1:end,2); %set of subdirectories
    2192         SubDirOut=SubDir{1};
    2193         if numel(SubDir)>1
    2194             for ilist=2:numel(SubDir)
    2195                 SubDirOut=[SubDirOut '-' SubDir{ilist}];
     2188if  ~(isfield(SeriesData,'ActionName') && strcmp(ActionName,SeriesData.ActionName))
     2189    OutputDirExt='.series'; %default
     2190    if isfield(ParamOut,'OutputDirExt')&&~isempty(ParamOut.OutputDirExt)
     2191        OutputDirExt=ParamOut.OutputDirExt;
     2192    end
     2193    set(handles.OutputDirExt,'String',OutputDirExt)
     2194    OutputDirVisible='off';
     2195    OutputSubDirMode='auto';%default
     2196    SubDirOut='';
     2197    if isfield(ParamOut,'OutputSubDirMode')
     2198        OutputSubDirMode=ParamOut.OutputSubDirMode;
     2199    end
     2200    switch OutputSubDirMode
     2201        case 'auto';%default
     2202            OutputDirVisible='on';
     2203            SubDir=InputTable(1:end,2); %set of subdirectories
     2204            SubDirOut=SubDir{1};
     2205            if numel(SubDir)>1
     2206                for ilist=2:numel(SubDir)
     2207                    SubDirOut=[SubDirOut '-' SubDir{ilist}];
     2208                end
    21962209            end
    2197         end
    2198     case 'first'
    2199         OutputDirVisible='on';
    2200         SubDirOut=InputTable{1,2}; %use the first subdir name (+OutputDirExt) as output  subdirectory
    2201     case 'last'
    2202         OutputDirVisible='on';
    2203         SubDirOut=InputTable{end,2}; %use the last subdir name (+OutputDirExt) as output  subdirectory
    2204 end
    2205 set(handles.OutputSubDir,'String',SubDirOut)
    2206 set(handles.OutputDirExt,'Visible',OutputDirVisible)
    2207 set(handles.OutputSubDir,'Visible',OutputDirVisible)
    2208 set(handles.OutputDir_title,'Visible',OutputDirVisible)
    2209 
    2210 %% visibility of the run mode (local or background or cluster)
    2211 if strcmp(OutputSubDirMode,'none')
    2212     RunModeVisible='off';% only local mode available if no output file is produced
    2213 else
    2214      RunModeVisible='on';
    2215 end
    2216 set(handles.RunMode,'Visible',RunModeVisible)
    2217 set(handles.ActionExt,'Visible',RunModeVisible)
    2218 set(handles.RunMode_title,'Visible',RunModeVisible)
    2219 set(handles.ActionExt_title,'Visible',RunModeVisible)
    2220 
     2210        case 'first'
     2211            OutputDirVisible='on';
     2212            SubDirOut=InputTable{1,2}; %use the first subdir name (+OutputDirExt) as output  subdirectory
     2213        case 'last'
     2214            OutputDirVisible='on';
     2215            SubDirOut=InputTable{end,2}; %use the last subdir name (+OutputDirExt) as output  subdirectory
     2216    end
     2217    set(handles.OutputSubDir,'String',SubDirOut)
     2218    set(handles.OutputDirExt,'Visible',OutputDirVisible)
     2219    set(handles.OutputSubDir,'Visible',OutputDirVisible)
     2220    set(handles.OutputDir_title,'Visible',OutputDirVisible)
     2221    SeriesData.ActionName=ActionName;%record ActionName for next use
     2222   
     2223   
     2224    %% visibility of the run mode (local or background or cluster)
     2225    if strcmp(OutputSubDirMode,'none')
     2226        RunModeVisible='off';% only local mode available if no output file is produced
     2227    else
     2228        RunModeVisible='on';
     2229    end
     2230    set(handles.RunMode,'Visible',RunModeVisible)
     2231    set(handles.ActionExt,'Visible',RunModeVisible)
     2232    set(handles.RunMode_title,'Visible',RunModeVisible)
     2233    set(handles.ActionExt_title,'Visible',RunModeVisible)
     2234end
    22212235
    22222236%% Expected nbre of output files
  • trunk/src/series/extract_rdvision.m

    r843 r844  
    361361NbBinFile=0;
    362362BinSize=0;
     363fid=0;
    363364errormsg='';
    364365classname=sprintf('uint%d',SeqData.bytesperpixel*8);
  • trunk/src/series/stereo_civ.m

    r834 r844  
    8787[tild,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
    8888for iview=1:size(Param.InputTable,1)
    89     XmlFileName=find_imadoc(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},Param.InputTable{1,5});
     89    XmlFileName=find_imadoc(Param.InputTable{iview,1},Param.InputTable{iview,2},Param.InputTable{iview,3},Param.InputTable{iview,5});
    9090    if isempty(XmlFileName)
    9191        disp_uvmat('ERROR', [XmlFileName ' not found'],checkrun)
     
    285285        end
    286286        [A,Rangx,Rangy]=phys_ima(A,XmlData,1);
     287       
     288
     289        PhysImageA=fullfile_uvmat(RootPath_A,Civ1Dir,RootFile_A,'.png','_1a',i1_series_Civ1(ifield),[],1);
     290        PhysImageB=fullfile_uvmat(RootPath_A,Civ1Dir,RootFile_A,'.png','_1a',i1_series_Civ1(ifield),[],2);
     291        imwrite(A{1},PhysImageA)
     292        imwrite(A{2},PhysImageB)
    287293        par_civ1.ImageA=A{1};
    288294        par_civ1.ImageB=A{2};
     
    414420    if isfield (Param.ActionInput,'Civ2')
    415421        par_civ2=Param.ActionInput.Civ2;
    416         par_civ2.ImageA=[];
    417         par_civ2.ImageB=[];
     422        par_civ2.ImageA=par_civ1.ImageA;
     423        par_civ2.ImageB=par_civ1.ImageB;
    418424        %         if ~isfield(Param.Civ1,'ImageA')
    419425        i1=i1_series_Civ2(ifield);
     
    430436            j2=j2_series_Civ2(ifield);
    431437        end
    432         ImageName_A_Civ2=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1,[],j1);
    433        
    434         if strcmp(ImageName_A_Civ2,ImageName_A) && isequal(FrameIndex_A_Civ1(ifield),FrameIndex_A_Civ2(ifield))
    435             par_civ2.ImageA=par_civ1.ImageA;
    436         else
    437             [par_civ2.ImageA,VideoObject_A] = read_image(ImageName_A_Civ2,FileType_A,VideoObject_A,FrameIndex_A_Civ2(ifield));
    438         end
    439         ImageName_B_Civ2=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2,[],j2);
    440         if strcmp(ImageName_B_Civ2,ImageName_B) && isequal(FrameIndex_B_Civ1(ifield),FrameIndex_B_Civ2)
    441             par_civ2.ImageB=par_civ1.ImageB;
    442         else
    443             [par_civ2.ImageB,VideoObject_B] = read_image(ImageName_B_Civ2,FileType_B,VideoObject_B,FrameIndex_B_Civ2(ifield));
    444         end
    445        
    446         ncfile=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1,i2,...
    447             j1,j2);
    448438        par_civ2.ImageWidth=FileInfo_A.Width;
    449439        par_civ2.ImageHeight=FileInfo_A.Height;
     
    498488        ibx2=ceil(par_civ2.CorrBoxSize(1)/2);
    499489        iby2=ceil(par_civ2.CorrBoxSize(2)/2);
    500         par_civ2.SearchBoxSize(1)=2*ibx2+9;% search ara +-4 pixels around the guess
    501         par_civ2.SearchBoxSize(2)=2*iby2+9;
    502         Civ2_Dt=time(i2+1,j2+1)-time(i1+1,j1+1);
    503         par_civ2.SearchBoxShift=(Civ2_Dt/Data.Civ1_Dt)*[Shiftx(nbval>=1)./nbval(nbval>=1) Shifty(nbval>=1)./nbval(nbval>=1)];
     490%         par_civ2.SearchBoxSize(1)=2*ibx2+9;% search ara +-4 pixels around the guess
     491%         par_civ2.SearchBoxSize(2)=2*iby2+9;
     492        par_civ2.SearchBoxShift=[Shiftx(nbval>=1)./nbval(nbval>=1) Shifty(nbval>=1)./nbval(nbval>=1)];
    504493        par_civ2.Grid=[par_civ2.Grid(nbval>=1,1)-par_civ2.SearchBoxShift(:,1)/2 par_civ2.Grid(nbval>=1,2)-par_civ2.SearchBoxShift(:,2)/2];% grid taken at the extrapolated origin of the displacement vectors
    505494        if par_civ2.CheckDeformation
     
    509498            par_civ2.DVDY=DVDY./nbval;
    510499        end
    511         % caluclate velocity data (y and v in indices, reverse to y component)
     500        % calculate velocity data (y and v in indices, reverse to y component)
    512501        [xtable ytable utable vtable ctable F] = civ (par_civ2);
    513502        list_param=(fieldnames(Param.ActionInput.Civ2))';
     
    518507        Data.Civ2_ImageB=ImageName_B;
    519508        Data.Civ2_Time=(time(i2+1,j2+1)+time(i1+1,j1+1))/2;
    520         Data.Civ2_Dt=Civ2_Dt;
    521         %         Data.Civ2_Time=1;
    522         %         Data.Civ2_Dt=1;
     509        Data.Civ2_Dt=0;
    523510        for ilist=1:length(list_param)
    524511            Data.(Civ2_param{4+ilist})=Param.ActionInput.Civ2.(list_param{ilist});
  • trunk/src/uvmat.m

    r837 r844  
    12171217GeometryCalib.SliceCoord=Z_plane'*[0 0 1];
    12181218GeometryCalib.SliceAngle=zeros(GeometryCalib.NbSlice,3);
    1219 GeometryCalib.SliceAngle(:,1)=SliceData.SliceAngle(1)*ones(GeometryCalib.NbSlice,1);%rotation around x axis (to generalise)
    1220 GeometryCalib.SliceAngle(:,2)=SliceData.SliceAngle(2)*ones(GeometryCalib.NbSlice,1);%rotation around y axis (to generalise)
     1219Angle_1=linspace(SliceData.SliceAngle_1(1),SliceData.SliceAngle_1(2),SliceData.NbSlice);
     1220Angle_2=linspace(SliceData.SliceAngle_2(1),SliceData.SliceAngle_2(2),SliceData.NbSlice);
     1221GeometryCalib.SliceAngle(:,1)=Angle_1';%rotation around x axis (to generalise)
     1222GeometryCalib.SliceAngle(:,2)=Angle_2';%rotation around y axis (to generalise)
    12211223GeometryCalib.SliceAngle(:,3)=0;
    12221224if SliceData.CheckRefraction
Note: See TracChangeset for help on using the changeset viewer.