Changeset 1175 for trunk/src


Ignore:
Timestamp:
Mar 11, 2025, 9:51:39 PM (3 days ago)
Author:
sommeria
Message:

add loglin histogram in uvmat and image rescale in civ_series

Location:
trunk/src
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r1158 r1175  
    409409
    410410%% prepare the string for plot command
     411if isfield(PlotParam,'Type')&& strcmp(PlotParam.Type,'semilogx')
     412   plotstr='hhh=semilogx(';
     413else
    411414plotstr='hhh=plot(';
     415end
    412416xtitle='';
    413417ytitle='';
  • trunk/src/series/civ_series.m

    r1170 r1175  
    5151%% set the input elements needed on the GUI series when the action is selected in the menu ActionName or InputTable refreshed
    5252if isstruct(Param) && isequal(Param.Action.RUN,0)% function activated from the GUI series but not RUN
     53    if 0==1 %never satisfied but trigger compilation with the appropriate transform functions ('eval' inactive for compilation)
     54        ima_rescale
     55    end
    5356    path_series=fileparts(which('series'));
    5457    addpath(fullfile(path_series,'series'))
     
    6669    Data.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
    6770    Data.FieldName='on';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
    68     Data.FieldTransform = 'off';%can use a transform function
     71    Data.FieldTransform = 'on';%can use a transform function
    6972    Data.ProjObject='off';%can use projection object(option 'off'/'on',
    7073    Data.Mask='off';%can use mask option   (option 'off'/'on', 'off' by default)
     
    99102% CheckOutputFile=isfield(Param,'OutputSubDir');%= 1 in test use for TestPatch (no nc file produced)
    100103
    101 %% input files and indexing (skipped in Test mode)
     104%% input files and indexing
    102105hseries=findobj(allchild(0),'Tag','series');
    103106RUNHandle=findobj(hseries,'Tag','RUN');%handle of RUN button in GUI series
     
    112115if isfield(Param,'InputTable')
    113116    [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
    114     %         iview_A=0;% series index (iview) for the first image series
    115117    iview_B=0;% series index (iview) for the second image series (only non zero for option 'shift' comparing two image series )
    116118    if Param.ActionInput.CheckCiv1
     
    119121        iview_A=2;% the second line is used for the input images
    120122    end
    121     %         if iview_A~=0
    122123    RootPath_A=Param.InputTable{iview_A,1};
    123124    RootFile_A=Param.InputTable{iview_A,3};
     
    253254    end
    254255end
    255 % end
     256
     257%% introduce input image transform
     258if isfield(Param,'FieldTransform')&&~isempty(Param.FieldTransform.TransformName)
     259        addpath(Param.FieldTransform.TransformPath)
     260    transform_fct=str2func(Param.FieldTransform.TransformName);
     261    rmpath(Param.FieldTransform.TransformPath)
     262end
     263
    256264
    257265%%%%% MAIN LOOP %%%%%%
     
    276284        end
    277285    end
    278     %     %     if CheckInputFile
    279     %     if CheckOutputFile
    280286    OutputPath=fullfile(Param.OutputPath,Param.Experiment,Param.Device);
    281     %         if iview_A==0 % no nc file has been entered
    282     %             ncfile=fullfile_uvmat(OutputPath,Param.InputTable{1,2},Param.InputTable{1,3},Param.InputTable{1,5},...
    283     %                 NomTypeNc,i1_series_Civ1(ifield),i2_series_Civ1(ifield),j1_series_Civ1(ifield),j2_series_Civ1(ifield));
    284     %         else% an existing nc file has been entered
    285     %             if iview_A==1% if Civ1 is performed
    286     %                 Civ1Dir=OutputDir;
    287     %             else
    288     %                 Civ1Dir=Param.InputTable{1,2};
    289     %             end
     287
    290288    if strcmp(Param.ActionInput.ListCompareMode,'PIV')
    291289        ncfile=fullfile_uvmat(OutputPath,OutputDir,RootFile_A,'.nc',NomTypeNc,i1_series_Civ1(ifield),i2_series_Civ1(ifield),...
     
    295293            j1_series_Civ1(ifield),j2_series_Civ1(ifield));
    296294    end
    297     %         end
    298295    ncfile_out=ncfile;% by default
    299296   
     
    380377            end
    381378            [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ1(ifield));
     379           
    382380        catch ME % display errors in reading input images
    383381            if ~isempty(ME.message)
     
    385383                continue
    386384            end
     385        end
     386        %% user defined image transform
     387        if ~isempty(transform_fct)
     388               par_civ1 =transform_fct(par_civ1,Param);
    387389        end
    388390       
     
    597599            par_civ2.Grid(:,2)=reshape(GridY,[],1);% increases with array index
    598600        end
     601       
     602                %% user defined image transform
     603        if ~isempty(transform_fct)
     604               par_civ2 =transform_fct(par_civ2,Param);
     605        end
     606       
    599607       
    600608        % get the guess from patch1 or patch2 (case 'CheckCiv3')
  • trunk/src/series/sub_background.m

    r1172 r1175  
    151151    end
    152152    BrightnessRankThreshold=0.1;
    153    % CheckSubmedian='No';
    154 %     SaturationCoeff=0;
    155153    if isfield(Param,'ActionInput')
    156154        if isfield(Param.ActionInput,'CheckVolume') && Param.ActionInput.CheckVolume
  • trunk/src/uvmat.m

    r1169 r1175  
    40194019    set(handles.Histogram,'Visible','off')
    40204020    set(handles.HistoMenu,'Visible','off')
     4021    set(handles.LogLinHisto,'Visible','off')
    40214022    set(handles.HistoAxes,'Visible','off')
    40224023    hlegend=findobj(handles.uvmat,'Tag','HistoLegend');
     
    42654266        set(handles.Histogram,'Visible','on')
    42664267        set(handles.HistoMenu,'Visible','on')
     4268        set(handles.LogLinHisto,'Visible','on')
    42674269        set(handles.HistoAxes,'Visible','on')
    42684270        HistoMenu_Callback(handles.HistoMenu, [], handles)% plot first histogram
     
    43834385                C=reshape(double(B),1,nxy(1)*nxy(2));% reshape in a vector
    43844386                Histo.histo(:,col)=hist(C, Histo.(FieldName));  %calculate histogram
    4385             end
    4386         end
    4387         plot_field(Histo,handles.HistoAxes);
     4387                if isequal(get(handles.LogLinHisto,'Value'),2)
     4388                    PlotParam.Type='semilogx';
     4389                else
     4390                    PlotParam.Type='plot';
     4391                end
     4392            end
     4393        end
     4394        plot_field(Histo,handles.HistoAxes,PlotParam);
    43884395        hlegend=findobj(handles.uvmat,'Tag','HistoLegend');
    43894396        if isempty(hlegend)
     
    61806187
    61816188
     6189
     6190
     6191% --- Executes on selection change in LogLinHisto.
     6192function LogLinHisto_Callback(hObject, eventdata, handles)
     6193    HistoMenu_Callback(hObject, eventdata, handles)
     6194% hObject    handle to LogLinHisto (see GCBO)
     6195% eventdata  reserved - to be defined in a future version of MATLAB
     6196% handles    structure with handles and user data (see GUIDATA)
     6197
     6198% Hints: contents = cellstr(get(hObject,'String')) returns LogLinHisto contents as cell array
     6199%        contents{get(hObject,'Value')} returns selected item from LogLinHisto
     6200
     6201
Note: See TracChangeset for help on using the changeset viewer.