source: trunk/src/series/time_series.m @ 442

Last change on this file since 442 was 442, checked in by sommeria, 12 years ago

functions updated in series for the new file configuration

File size: 24.8 KB
Line 
1%'time_series': extract a time series, used with series.fig
2%------------------------------------------------------------------------
3% function GUI_input=time_series(Param)
4%
5%OUTPUT
6% GUI_input=list of options in the GUI series.fig needed for the function
7%
8%INPUT:
9%num_i1: series of first indices i (given from the series interface as first_i:incr_i:last_i, mode and list_pair_civ)
10%i2_series: series of second indices i (given from the series interface as first_i:incr_i:last_i, mode and list_pair_civ)
11%num_j1: series of first indices j (given from the series interface as first_j:incr_j:last_j, mode and list_pair_civ )
12%num_j2: series of second indices j (given from the series interface as first_j:incr_j:last_j, mode and list_pair_civ)
13%Series: Matlab structure containing information set by the series interface
14%
15function GUI_input=time_series(Param)
16
17%% requests for the visibility of input windows in the GUI series  (activated directly by the selection in the menu ACTION)
18if ~exist('Param','var')
19    GUI_input={'RootPath';'two';...%nbre of possible input series (options 'on'/'two'/'many', default:'one')
20        'SubDir';'on';... % subdirectory of derived files (PIV fields), ('on' by default)
21        'RootFile';'on';... %root input file name ('on' by default)
22        'FileExt';'on';... %input file extension ('on' by default)
23        'NomType';'on';...%type of file indexing ('on' by default)
24        'NbSlice';'on'; ...%nbre of slices ('off' by default)
25        'VelTypeMenu';'two';...% menu for selecting the velocity type (civ1,..) options 'off'/'one'/'two', 'off' by default)
26        'FieldMenu';'two';...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
27        'CoordType';'on';...%can use a transform function 'off' by default
28        'GetObject';'on';...%can use projection object ,'off' by default
29        %'GetMask';'on'...%can use mask option   ,'off' by default
30        %'PARAMETER'; options: name of the user defined parameter',repeat a line for each parameter
31               ''};
32    return %exit the function
33end
34
35%% input parameters
36% read the xml file for batch case
37if ischar(Param) && ~isempty(find(regexp('Param','.xml$')))
38    Param=xml2struct(Param);
39    checkrun=0;
40else %  RUN case: parameters introduced as the input structure Param
41    hseries=guidata(Param.hseries);%handles of the GUI series
42    WaitbarPos=get(hseries.waitbar_frame,'Position');
43    checkrun=1;
44end
45[filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
46
47%% coordinate transform or other user defined transform
48transform_fct='';%default
49if isfield(Param,'FieldTransform')&&isfield(Param.FieldTransform,'fct_handle')
50    transform_fct=Param.FieldTransform.fct_handle;
51end
52
53%% projection object
54test_object=get(hseries.GetObject,'Value');
55if test_object
56    hset_object=findobj(allchild(0),'tag','set_object');
57    ProjObject=read_GUI(hset_object);
58    answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' ProjObject.Type]);
59    if ~isequal(answeryes,'Yes')
60        return
61    end
62else
63    msgbox_uvmat('ERROR','a projection object is needed');
64    return
65end
66
67%% features of the input fields
68RootPath=Param.InputTable(:,1);
69RootFile=Param.InputTable(:,3);
70% SubDir=Param.InputTable(:,2);
71NomType=Param.InputTable(:,4);
72FileExt=Param.InputTable(:,5);
73% ext=FileExt{1};
74% form=imformats(ext(2:end));%test valid Matlab image formats
75nbfield=size(i1_series{1},1)*size(i1_series{1},2); %number of fields in the time series
76
77%% determine image type
78hhh=which('mmreader');
79testnetcdf=0;
80nbview=length(RootPath);%Number of input series: this function  accepts only one or two input file series (sub_field is used in the latter case)
81for iview=1:nbview
82    if isequal(FileExt{iview},'.nc')||isequal(FileExt{iview},'.cdf')
83        FileType{iview}='netcdf';
84        testnetcdf=1;
85    elseif isequal(lower(FileExt{iview}),'.avi')
86        if ~isequal(hhh,'')%&& mmreader.isPlatformSupported()
87            MovieObject{iview}=mmreader(fullfile(RootPath{iview},[RootFile{iview} FileExt{iview}]));
88            FileType{iview}='movie';
89        else
90            FileType{iview}='avi';
91        end
92    elseif isequal(lower(FileExt{iview}),'.vol')
93        FileType{iview}='vol';
94    else
95       form=imformats(FileExt{iview}(2:end));
96       if ~isempty(form)% if the extension corresponds to an image format recognized by Matlab
97           if isequal(NomType{iview},'*');
98               FileType{iview}='multimage';
99           else
100               FileType{iview}='image';
101           end
102       end
103    end
104end
105filebase{1}=fullfile(RootPath{1},RootFile{1});
106
107%% number of slices
108NbSlice=Param.NbSlice;
109
110%% Field and velocity type (the same for the two views)
111FieldName={''};
112
113if isfield(Param,'InputFields')&&isfield(Param.InputFields,'FieldMenu') 
114    FieldName=Param.InputFields.FieldMenu;%the same set of fields for all views
115    VelType{1}=Param.InputFields.VelTypeMenu;
116end
117if isempty(FieldName) && testnetcdf
118    msgbox_uvmat('ERROR','A field must be defined as input')
119    return
120end
121if isequal(FieldName,'get_field...')
122    hget_field=findobj(allchild(0),'name','get_field');%find the get_field... GUI
123    if numel(hget_field)>1
124        delete(hget_field(2:end)) % delete multiple occurerence of the GUI get_fioeld
125    elseif isempty(hget_field)
126        filename=filecell{1,1};
127      % filename=name_generator(filebase{1},i1_series{1}(1),j1_series{1}(1),FileExt{1},NomType{1},1,i2_series{1}(1),num_j2{1}(1),SubDir{1});
128       idetect(iview)=exist(filename,'file');
129       hget_field=get_field(filename);
130       return
131    end
132    SubField=read_get_field(hget_field); %read the names of the variables to plot in the get_field GUI
133    if isempty(SubField)
134        delete(hget_field)
135        filename=filecell{1,1};
136       %filename=name_generator(filebase{1},i1_series{1}(1),j1_series{1}(1),FileExt{1},NomType{1},1,i2_series{1}(1),j2_series{1}(1),SubDir{1});
137        hget_field=get_field(filename);
138        SubField=read_get_field(hget_field); %read the names of the variables to plot in the get_field GUI
139    end
140end
141
142%% detect whether the two files are 'images' or 'netcdf'
143testcivx=0;
144% FileExt=get(hseries.FileExt,'String');
145if ~isequal(FieldName,{'get_field...'})
146    testcivx=isequal(FileType{1},'netcdf');
147end
148% VelType_str=get(hseries.VelTypeMenu,'String');
149% VelType_val=get(hseries.VelTypeMenu,'Value');
150% VelType{1}=VelType_str{VelType_val};
151% if nbview==2
152%     VelType_str=get(hseries.VelTypeMenu_1,'String');
153%     VelType_val=get(hseries.VelTypeMenu_1,'Value');
154%     VelType{2}=VelType_str{VelType_val};
155% end
156
157%% Calibration data and timing: read the ImaDoc files
158% mode=''; %default
159timecell={};
160XmlData={};
161itime=0;
162NbSlice_calib={};
163for iview=1:nbview%Loop on views
164    XmlData{iview}=[];%default
165    filebase{iview}=fullfile(RootPath{iview},RootFile{iview});
166    if exist([filebase{iview} '.xml'],'file')
167        [XmlData{iview},error]=imadoc2struct([filebase{iview} '.xml']);
168        if isfield(XmlData{iview},'Time')
169            itime=itime+1;
170            timecell{itime}=XmlData{iview}.Time;
171        end
172        if isfield(XmlData{iview},'GeometryCalib') && isfield(XmlData{iview}.GeometryCalib,'SliceCoord')
173            NbSlice_calib{iview}=size(XmlData{iview}.GeometryCalib.SliceCoord,1);%nbre of slices for Zindex in phys transform
174            if ~isequal(NbSlice_calib{iview},NbSlice_calib{1})
175                msgbox_uvmat('WARNING','inconsistent number of Z indices for the field series');
176            end
177        end
178    elseif exist([filebase{iview} '.civ'],'file')%old convention .civ text file
179        [error,time,TimeUnit,mode,npx,npy,pxcmx,pxcmy]=read_imatext([filebase{iview} '.civ']);
180        itime=itime+1;
181        timecell{itime}=time;
182        XmlData{iview}.Time=time;
183        GeometryCalib.R=[pxcmx 0 0; 0 pxcmy 0;0 0 0];
184        GeometryCalib.Tx=0;
185        GeometryCalib.Ty=0;
186        GeometryCalib.Tz=1;
187        GeometryCalib.dpx=1;
188        GeometryCalib.dpy=1;
189        GeometryCalib.sx=1;
190        GeometryCalib.Cx=0;
191        GeometryCalib.Cy=0;
192        GeometryCalib.f=1;
193        GeometryCalib.kappa1=0;
194        GeometryCalib.CoordUnit='cm';
195        XmlData{iview}.GeometryCalib=GeometryCalib;
196        if error==1
197            msgbox_uvmat('WARNING','inconsistent number of fields in the .civ file');
198        end
199    end
200end
201time=[];%default
202if ~isempty(timecell)
203    if numel(timecell{1})<nbfield
204       msgbox_uvmat('WARNING','time array from ImaDoc to short')
205    else
206        time=timecell{1}; %time defined from ImaDoc file (image series)
207    end
208end
209
210%% check coincidence in time
211if length(timecell)>1
212    for icell=2:length(timecell)
213        if isequal(size(timecell{icell}),size(time))
214            diff_time=max(abs(timecell{icell}-time));
215            if diff_time>0
216                msgbox_uvmat('WARNING',['times of series differ by more than ' num2str(diff_time)])
217                break
218            end
219        else
220            msgbox_uvmat('WARNING','inconsistent time array dimensions in ImaDoc fields, the time for the first series is used')
221            break
222        end
223    end
224end
225if ~isempty(time)
226    display(['time is read from ' filebase{iview} '.xml'])
227end
228
229%%  Root name of output files (TO GENERALISE FOR TWO INPUT SERIES)
230subdir_result='time_series';
231pathdir=fullfile(RootPath{1},subdir_result);
232while exist(pathdir,'dir')
233    subdir_result=[subdir_result '.0'];
234    pathdir=fullfile(RootPath{1},subdir_result);
235end
236[m1,m2,m3]=mkdir(pathdir);
237if ~isequal(m2,'')
238     msgbox_uvmat('CONFIRMATION',m2);%error message for directory creation
239end
240[xx,msg2] = fileattrib(pathdir,'+w','g'); %yield writing access (+w) to user group (g)
241if ~strcmp(msg2,'')
242    msgbox_uvmat('ERROR',['pb of permission for ' pathdir ': ' msg2])%error message for directory creation
243    return
244end
245filebase_out=filebase{1};
246 i21=i1_series{end}(end);
247 if ~isempty(i2_series{end})
248     i21=i2_series{end}(end)-i1_series{1}(1);
249 end
250 j21=1;
251 if ~isempty(j1_series{1})
252     j21=j1_series{end}(end);
253      if ~isempty(j2_series{end})
254          j21=j2_series{end}(end)-j21;
255      end
256 end
257NomTypeOut=nomtype2pair(NomType{1},i21,j21);
258
259
260%% velocity type
261VelType_str=get(hseries.VelTypeMenu,'String');
262VelType_val=get(hseries.VelTypeMenu,'Value');
263VelType{1}=VelType_str{VelType_val};
264if nbview==2
265    VelType_str=get(hseries.VelTypeMenu_1,'String');
266    VelType_val=get(hseries.VelTypeMenu_1,'Value');
267    VelType{2}=VelType_str{VelType_val};
268end
269
270%% LOOP ON SLICES
271nbmissing=0; %number of undetected files
272for i_slice=1:NbSlice
273    dt=[];
274    %%%%%%%%%%%%%%%%%%%%%%%%%%%%  LOOP ON FIELDS WITHIN  A SLICE
275    filecounter=0;
276    for ifile=i_slice:NbSlice:nbfield
277        if checkrun
278            update_waitbar(hseries.waitbar_frame,WaitbarPos,ifile/nbfield)
279            stopstate=get(hseries.RUN,'BusyAction');
280        else
281            stopstate='queue';
282        end
283        errormsg='';
284        if isequal(stopstate,'queue')% enable STOP command
285            % loop on views (in case of multiple input series)
286            for iview=1:nbview
287                filename=filecell{iview,ifile};
288               % filename=name_generator(filebase{iview},...
289                %    i1_series{iview}(ifile),j1_series{iview}(ifile),FileExt{iview},NomType{iview},1,i2_series{iview}(ifile),j2_series{iview}(ifile),SubDir{iview});
290                if exist(filename,'file')
291                    try
292                        Data{iview}=[]; %default
293                        if ~isequal(FileType{iview},'netcdf')
294                            Data{iview}.ListVarName={'A'};
295                            Data{iview}.AName='image';
296                            switch FileType{iview}
297                                case 'movie'
298                                    A=read(MovieObject{iview},i1_series{iview}(ifile));
299                                case 'avi'
300                                    mov=aviread(filename,i1_series{iview}(ifile));
301                                    A=frame2im(mov(1));
302                                case 'vol'
303                                    A=imread(filename);
304                                case 'multimage'
305                                    A=imread(filename,i1_series{iview}(ifile));
306                                case 'image'
307                                    A=imread(filename);
308                            end
309                            Data{iview}.ListVarName={'AY','AX','A'}; %
310                            npy=size(A,1);
311                            npx=size(A,2);
312                            nbcolor=size(A,3);
313                            if nbcolor==3
314                                Data{iview}.VarDimName={'AY','AX',{'AY','AX','rgb'}};
315                            else
316                                Data{iview}.VarDimName={'AY','AX',{'AY','AX'}};
317                            end
318                            Data{iview}.AY=[npy-0.5 0.5];
319                            Data{iview}.AX=[0.5 npx-0.5];
320                            Data{iview}.A=double(A);
321                            Data{iview}.CoordUnit='pixel';
322                        elseif testcivx
323                            [Data{iview},VelTypeOut]=read_civxdata(filename,FieldName,VelType);
324                            if ~isequal(FieldName,{''})
325                                Data{iview}=calc_field(FieldName,Data{iview});%calculate field (vort..)
326                            end
327                        else
328                            [Data{iview},var_detect]=nc2struct(filename,SubField.ListVarName); %read the corresponding input data
329                            Data{iview}.VarAttribute=SubField.VarAttribute;
330                        end
331                        if ~isempty(NbSlice_calib)  % z index
332                            Data{iview}.ZIndex=mod(i1_series{iview}(ifile)-1,NbSlice_calib{1})+1;
333                        end
334                    catch ME
335                        errormsg=ME.message;
336                    end
337                else
338                    errormsg=[filename ' is missing'];
339                end
340                if isempty(errormsg)
341                    % coordinate transform (or other user defined transform)
342                    if ~isempty(transform_fct)
343                        if nbview==2
344                            [Data{1},Data{2}]=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2});
345                            if isempty(Data{2})
346                                Data(2)=[];
347                            end
348                        else
349                            Data{1}=transform_fct(Data{1},XmlData{1});
350                        end
351                    end
352                    if length(Data)==2
353                        [Field,errormsg]=sub_field(Data{1},Data{2}); %substract the two fields
354                    else
355                        Field=Data{1};
356                    end
357                    if test_object
358                        [Field,errormsg]=proj_field(Field,ProjObject);
359                    end
360                end
361                filecounter=filecounter+1;
362               
363                % initiate the time series at the first iteration
364                if filecounter==1
365                    % stop program if the first field reading is in error
366                    if ~isempty(errormsg)
367                        msgbox_uvmat('ERROR',['error in time_series/sub_field:' errormsg])
368                        return
369                    end
370                    RecordData=Field;%default
371                    RecordData.NbDim=Field.NbDim+1; %add the time dimension for plots
372                    nbvar=length(Field.ListVarName);
373                    if nbvar==0
374                        msgbox_uvmat('ERROR','no input variable selected in get_field')
375                        return
376                    end
377                    testsum=2*ones(1,nbvar);%initiate flag for action on each variable
378                    if isfield(Field,'VarAttribute') % look for coordinate and flag variables
379                        for ivar=1:nbvar
380                            if length(Field.VarAttribute)>=ivar && isfield(Field.VarAttribute{ivar},'Role')
381                                var_role=Field.VarAttribute{ivar}.Role;%'role' of the variable
382                                if isequal(var_role,'errorflag')
383                                    msgbox_uvmat('ERROR','do not handle error flags in time series')
384                                    return
385                                end
386                                if isequal(var_role,'warnflag')
387                                    testsum(ivar)=0;  % not recorded variable
388                                    eval(['RecordData=rmfield(RecordData,''' Field.ListVarName{ivar} ''');']);%remove variable
389                                end
390                                if isequal(var_role,'coord_x')| isequal(var_role,'coord_y')|...
391                                        isequal(var_role,'coord_z')|isequal(var_role,'coord')
392                                    testsum(ivar)=1; %constant coordinates, record without time evolution
393                                end
394                            end
395                            % check whether the variable ivar is a dimension variable
396                            DimCell=Field.VarDimName{ivar};
397                            if ischar(DimCell)
398                                DimCell={DimCell};
399                            end
400                            if numel(DimCell)==1 && isequal(Field.ListVarName{ivar},DimCell{1})%detect dimension variables
401                                testsum(ivar)=1;
402                            end
403                        end
404                    end
405                    for ivar=1:nbvar
406                        if testsum(ivar)==2
407                            eval(['RecordData.' Field.ListVarName{ivar} '=[];'])
408                        end
409                    end
410                    RecordData.ListVarName=[{'Time'} RecordData.ListVarName];
411                end
412               
413                % add data to the current field
414                for ivar=1:length(Field.ListVarName)
415                    VarName=Field.ListVarName{ivar};
416                    VarVal=Field.(VarName);
417                    if testsum(ivar)==2% test for recorded variable
418                        if isempty(errormsg)
419                            if isequal(ProjObject.ProjMode,'inside')% take the average in the domain for 'inside' mode
420                                if isempty(VarVal)
421                                    msgbox_uvmat('ERROR',['empty result at frame index ' num2str(i1_series{iview}(ifile))])
422                                    return
423                                end
424                                VarVal=mean(VarVal,1);
425                            end
426                            VarVal=shiftdim(VarVal,-1); %shift dimension
427                            RecordData.(VarName)=cat(1,RecordData.(VarName),VarVal);%concanete the current field to the time series
428                        else
429                            RecordData.(VarName)=cat(1,RecordData.(VarName),0);% put each variable to 0 in case of input reading error
430                        end
431                    elseif testsum(ivar)==1% variable representing fixed coordinates
432                        eval(['VarInit=RecordData.' VarName ';']);
433                        if isempty(errormsg) && ~isequal(VarVal,VarInit)
434                            msgbox_uvmat('ERROR',['time series requires constant coordinates ' VarName])
435                            return
436                        end
437                    end
438                end
439               
440                % record the time:
441                if isempty(time)% time read in ncfiles
442                    if isfield(Field,'Time')
443                        RecordData.Time(filecounter,1)=Field.Time;
444                    else
445                        RecordData.Time(filecounter,1)=ifile;%default
446                    end
447                else % time from ImaDoc prevails  TODO: correct
448                  %  RecordData.Time(filecounter,1)=time{1}(i1_series{1})(ifile),j1_series{1}(ifile))+time(end,i2_series{end}(ifile),j2_series{end}(ifile)))/2;
449                  RecordData.Time(filecounter,1)=i1_series{1}(ifile);% TODO : generalise
450                end
451               
452                % record the number of missing input fields
453                if ~isempty(errormsg)
454                    nbmissing=nbmissing+1;
455                    display(['ifile=' num2str(ifile) ':' errormsg])
456                end
457            end
458        end
459    end
460    %%%%%%% END OF LOOP WITHIN A SLICE
461   
462    %remove time for global attributes if exists
463    Time_index=find(strcmp('Time',RecordData.ListGlobalAttribute));
464    if ~isempty(Time_search)
465        RecordData.ListGlobalAttribute(Time_index)=[];
466    end
467    RecordData.Conventions='uvmat';
468%     for iattr=1:numel(RecordData.ListGlobalAttribute)
469%         if strcmp(RecordData.ListGlobalAttribute{iattr},'Time')
470%             RecordData.ListGlobalAttribute(iattr)=[];
471%             break
472%         end
473%     end
474    for ivar=1:numel(RecordData.ListVarName)
475        VarName=RecordData.ListVarName{ivar};
476        eval(['RecordData.' VarName '=squeeze(RecordData.' VarName ');']) %remove singletons
477    end
478   
479    % add time dimension
480    for ivar=1:length(Field.ListVarName)
481        DimCell=Field.VarDimName(ivar);
482        if testsum(ivar)==2%variable used as time series
483            RecordData.VarDimName{ivar}=[{'Time'} DimCell];
484        elseif testsum(ivar)==1
485            RecordData.VarDimName{ivar}=DimCell;
486        end
487    end
488    indexremove=find(~testsum);
489    if ~isempty(indexremove)
490        RecordData.ListVarName(1+indexremove)=[];
491        RecordData.VarDimName(indexremove)=[];
492        if isfield(RecordData,'Role') && ~isempty(RecordData.Role{1})%generaliser aus autres attributs
493            RecordData.Role(1+indexremove)=[];
494        end
495    end
496   
497    %shift variable attributes
498    if isfield(RecordData,'VarAttribute')
499        RecordData.VarAttribute=[{[]} RecordData.VarAttribute];
500    end
501    RecordData.VarDimName=[{'Time'} RecordData.VarDimName];
502    RecordData.Action=Param.Action;%name of the processing programme
503    test_time=diff(RecordData.Time)>0;% test that the readed time is increasing (not constant)
504    if ~test_time
505        RecordData.Time=[1:filecounter];
506    end
507   
508    % display nbmissing
509    if ~isequal(nbmissing,0)
510        msgbox_uvmat('WARNING',[num2str(nbmissing) ' files skipped: missing files or bad input, see command window display'])
511    end
512   
513    %name of result file
514   % [filemean]=...
515    %    name_generator(filebase_out,i1_series{1}(i_slice),j1_series{1}(i_slice),'.nc','_i1-i2_j1-j2',1,i2_series{end}(ifile),j2_series{end}(ifile),subdir_result);
516    filemean=fullfile_uvmat(RootPath{1},subdir_result,RootFile{1},'.nc','_1',i1_series{1}(i_slice));
517    errormsg=struct2nc(filemean,RecordData); %save result file
518    if isempty(errormsg)
519        display([filemean ' written'])
520    else
521        msgbox_uvmat('ERROR',['error in Series/struct2nc: ' errormsg])
522    end
523end
524
525%% plot the time series (the last one in case of multislices)
526figure
527haxes=axes;
528plot_field(RecordData,haxes)
529
530%% display the result file using the GUI get_field
531hget_field=findobj(allchild(0),'name','get_field');
532if ~isempty(hget_field)
533    delete(hget_field)
534end
535get_field(filemean,RecordData)
536   
537%------------------------------------------------------------------------
538% --- Executes on selection change in CoordType.
539function CoordType_Callback(hObject, eventdata, handles)
540%------------------------------------------------------------------------
541menu_str=get(handles.CoordType,'String');
542ind_coord=get(handles.CoordType,'Value');
543coord_option=menu_str{ind_coord};
544if isequal(coord_option,'more...');
545    fct_name='';
546    if exist('./TMP/current_usr_fct.mat','file')% if a file is found
547        h=load('./TMP/current_usr_fct.mat');
548        if isfield(h,'fct_name');
549            fct_name=h.fct_name;
550        end
551    end
552    prompt = {'Enter the name of the transform function'};
553    dlg_title = 'user defined transform';
554    num_lines= 1;
555    [FileName, PathName, filterindex] = uigetfile( ...
556       {'*.m', ' (*.m)';
557        '*.m',  '.m files '; ...
558        '*.*', 'All Files (*.*)'}, ...
559        'Pick a file', fct_name);
560    fct_name=fullfile(PathName,FileName);
561    addpath(PathName);%add the path to the selected fct
562    [errormsg,date_str]=check_functions;%check whether new functions can oversed the uvmat package A UTILISER
563    if ~exist(fct_name,'file')
564           warndlg(['image procesing fct ' fct_name ' not found'])
565    else
566        transform=FileName(1:end-2);%
567        update_menu(handles.CoordType,transform)%add the selected fct to the menu
568  %      set(handles.mouse_coord,'String',menu([1:end-1])')%update the mouse coord menu
569      %save ('./TMP/current_usr_fct.mat','fct_name');
570    end   
571end
572ind_coord=get(handles.CoordType,'Value');   
573
574%---------------------------------------------------------------------
575% % --- Executes on selection change in ProjObject.
576% function ProjObject_Callback(hObject, eventdata, handles)
577%
578% list_object=get(handles.ProjObject,'String');
579% index=get(handles.ProjObject,'Value');
580% hseries=get(handles.ProjObject,'Parent');
581% SeriesData=get(hseries,'UserData');
582% Obj=SeriesData.ProjObject{index};
583% [SeriesData.hset_object,SeriesData.sethandles]=set_object(SeriesData.ProjObject{index});
584% set(hseries,'UserData',SeriesData);
585
Note: See TracBrowser for help on using the repository browser.