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

Last change on this file since 184 was 169, checked in by sommeria, 14 years ago

comments added at the head of functions

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