Changeset 1177 for trunk/src


Ignore:
Timestamp:
Mar 12, 2025, 8:13:18 PM (2 days ago)
Author:
sommeria
Message:

background image introduced for civ1

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r1176 r1177  
    409409
    410410%% prepare the string for plot command
     411plotstr='hhh=plot(';
    411412if isfield(PlotParam,'Type')
    412413    switch PlotParam.Type
     
    417418        case 'loglog'
    418419            plotstr='hhh=loglog(';
    419         otherwise
    420             plotstr='hhh=plot(';
    421420    end
    422421end
  • trunk/src/series/civ_input.m

    r1176 r1177  
    328328    PairMenu={'series(Di)'};
    329329elseif MaxIndex_j-MinIndex_j==1
    330     PairMenu={'pair j1-j2'};
     330    PairMenu={'pair j1-j2';'series(Di)'};
    331331elseif  MaxIndex_i==MinIndex_i && MaxIndex_j-MinIndex_j>2% simple series in j
    332332    PairMenu={'pair j1-j2';'series(Dj)'};
     
    19681968hparent=get(hObject,'parent');
    19691969hchildren=get(hparent,'children');
    1970 handle_txtbox=findobj(hchildren,'tag','Background');% look for the mask name box in the same panel
    1971 testmask=0;
     1970handle_txtbox=findobj(hchildren,'tag','Background');% look for the background name box in the same panel
     1971testbackground=0;
    19721972if get(hObject,'Value')% if the checkbox is activated
    19731973    hseries=findobj(allchild(0),'Tag','series');
     
    19791979        ind_A=1;% line index of the (first) image series
    19801980    end
    1981     % browse for a mask
     1981    % browse for a background
    19821982    filebackground= uigetfile_uvmat('pick a background image file:',InputTable{ind_A,1},'image');
    19831983    if ~isempty(filebackground)
     
    19921992        end
    19931993        set(hObject,'UserData',filebackground);%store for future use
    1994         testmask=1;
    1995     end
    1996 end
    1997 if testmask
     1994        testbackground=1;
     1995    end
     1996end
     1997if testbackground
    19981998    set(handles.Background,'Visible','on')
    19991999    set(handles.Background,'String',filebackground)
     
    20092009set(handles.ConfigSource,'String','NEW')
    20102010set(handles.ConfigSource,'BackgroundColor',[1 0 1])
    2011 
    2012 
    2013 
    2014 function Background_Callback(hObject, eventdata, handles)
    2015 % hObject    handle to Background (see GCBO)
    2016 % eventdata  reserved - to be defined in a future version of MATLAB
    2017 % handles    structure with handles and user data (see GUIDATA)
    2018 
    2019 % Hints: get(hObject,'String') returns contents of Background as text
    2020 %        str2double(get(hObject,'String')) returns contents of Background as a double
  • trunk/src/series/civ_series.m

    r1176 r1177  
    258258transform_fct=[];%default, no transform
    259259if isfield(Param,'FieldTransform')&&~isempty(Param.FieldTransform.TransformName)
    260         addpath(Param.FieldTransform.TransformPath)
     260       % addpath(Param.FieldTransform.TransformPath)
     261        currentdir=pwd;
     262    cd(Param.FieldTransform.TransformPath)
    261263    transform_fct=str2func(Param.FieldTransform.TransformName);
    262     rmpath(Param.FieldTransform.TransformPath)
    263 end
    264 
     264    cd (currentdir)
     265    %rmpath(Param.FieldTransform.TransformPath)
     266end
    265267
    266268%%%%% MAIN LOOP %%%%%%
     
    772774        end
    773775       
     776        % case of background image to subtract
     777        if par_civ2.CheckBackground &&~isempty(par_civ2.Background)
     778            [RootPath_background,SubDir_background,RootFile_background,~,~,~,~,Ext_background]=fileparts_uvmat(Param.ActionInput.Civ1.Background);
     779            j1=1;
     780            if ~isempty(j1_series_Civ1)
     781                j1=j1_series_Civ1(ifield);
     782            end
     783            if ~isempty(i2_series_Civ1)% case of volume,backgrounds act on different j levels
     784                backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',j1);
     785            elseif isfield(par_civ2,'NbSlice')
     786                i1_background=mod(i1-1,par_civ2.NbSlice)+1;
     787                backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',i1_background);
     788                if strcmp(Param.ActionInput.PairIndices.ListPairMode,'series(Di)')% case of volume, background index refers to j index
     789                    par_civ2.NbSlice_j=par_civ2.NbSlice;
     790                end
     791            else
     792                backgroundname=Param.ActionInput.Civ1.Background;
     793            end
     794            if strcmp(backgroundoldname,backgroundname)% background exist, not already read in civ2
     795                par_civ2.Background=background; %use background already opened
     796            else
     797                if ~isempty(regexp(backgroundname,'(^http://)|(^https://)', 'once'))|| exist(backgroundname,'file')
     798                    try
     799                        par_civ2.Background=imread(backgroundname);%update the background, an store it for future use
     800                    catch ME
     801                        if ~isempty(ME.message)
     802                            errormsg=['error reading input image: ' ME.message];
     803                            disp_uvmat('ERROR',errormsg,checkrun)
     804                            return
     805                        end
     806                    end
     807                else
     808                    par_civ2.Background=[];
     809                end
     810                background=par_civ2.Background;
     811                backgroundoldname=backgroundname;
     812            end
     813            par_civ2.ImageA=par_civ2.ImageA-par_civ2.Background;
     814            par_civ2.ImageB=par_civ2.ImageB-par_civ2.Background;
     815        end
    774816       
    775817        if strcmp(Param.ActionInput.ListCompareMode,'displacement')
Note: See TracChangeset for help on using the changeset viewer.