Changeset 599 for trunk/src/series.m


Ignore:
Timestamp:
Apr 3, 2013, 10:21:53 AM (11 years ago)
Author:
sommeria
Message:

various bug corrections. Steps further for civ_series (still development needed)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r598 r599  
    282282     oldfile=fullfile(RootPathCell{1},SubDirCell{1},RootFileCell{1});
    283283 end
    284 [FileName, PathName, filterindex] = uigetfile( ...
     284[FileName, PathName] = uigetfile( ...
    285285       {'*.xml;*.xls;*.png;*.tif;*.avi;*.AVI;*.nc', ' (*.xml,*.xls, *.png,*.tif, *.avi,*.nc)';
    286286       '*.xml',  '.xml files '; ...
     
    304304            set_object(Param.ProjObject)
    305305        end
    306         set(handles.REFRESH,'UserData',[1:size(Param.InputTable,1)])
     306        set(handles.REFRESH,'UserData',1:size(Param.InputTable,1))
    307307        REFRESH_Callback([],[], handles)
    308308        return
     
    456456        RootPath=fileparts(RootPath); %will try the upped forldr
    457457    else
    458         [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,MovieObject]=...
     458        [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,FileInfo,MovieObject]=...
    459459            find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]);
    460460    end
     
    475475        display_file_name(handles,fileinput,iview)
    476476    else
    477         update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,iview)
     477        update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,FileInfo,MovieObject,iview)
    478478    end
    479479end
     
    514514% detect the file type, get the movie object if relevant, and look for the corresponding file series:
    515515% the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists
    516 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]);
     516[RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,FileInfo,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]);
    517517if isempty(RootFile)&&isempty(i1_series)
    518518    errormsg='no input file in the series';
     
    581581
    582582%% initiate input file series and refresh the current field view:     
    583 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,iview);
     583update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,FileInfo,MovieObject,iview);
    584584
    585585%------------------------------------------------------------------------
    586586% --- Update information about a new field series (indices to scan, timing,
    587587%     calibration from an xml file
    588 function update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,VideoObject,iview)
     588function update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,FileInfo,VideoObject,iview)
    589589%------------------------------------------------------------------------
    590590%% update the output dir
     
    708708NbSlice_calib={};
    709709XmlFileName=find_imadoc(InputTable{iview,1},InputTable{iview,2},InputTable{iview,3},InputTable{iview,5});
     710TimeUnit='';
    710711if ~isempty(XmlFileName)
    711712        [XmlData,warntext]=imadoc2struct(XmlFileName);
     
    769770%% number of slices
    770771NbSlice=1;%default
    771 if isfield(XmlData,'GeometryCalib') && isfield(XmlData.GeometryCalib,'SliceCoord')
     772heck_calib=0;
     773if isfield(XmlData,'GeometryCalib')
     774    check_calib=1;
     775    if isfield(XmlData.GeometryCalib,'SliceCoord')
    772776    siz=size(XmlData.GeometryCalib.SliceCoord);
    773777    if siz(1)>1
    774778        NbSlice=siz(1);
     779    end
    775780    end
    776781end
     
    793798SeriesData.j2_series{iview}=j2_series;
    794799SeriesData.FileType{iview}=FileType;
     800SeriesData.FileInfo{iview}=FileInfo;
    795801SeriesData.Time{iview}=time;
     802if ~isempty(TimeUnit)
     803    SeriesData.TimeUnit=TimeUnit;
     804end
     805if check_calib
     806SeriesData.GeometryCalib{iview}=XmlData.GeometryCalib;
     807end
    796808set(handles.series,'UserData',SeriesData)
    797809
     
    13131325[Series,OutputDir,errormsg]=prepare_jobs(handles);% get parameters form the GUI series
    13141326if ~isempty(errormsg)
     1327    if ~strcmp(errormsg,'Cancel')
    13151328    msgbox_uvmat('ERROR',errormsg)
     1329    end
     1330    STOP_Callback([],[], handles)
    13161331    return
    13171332end
     
    16811696    while detect
    16821697        answer=msgbox_uvmat('INPUT_Y-N',['use existing ouput directory: ' fullfile(Series.InputTable{1,1},SubDirOutNew) ', possibly delete previous data']);
    1683         if isequal(answer,'Yes')
     1698        if strcmp(answer,'Cancel')
     1699            errormsg='Cancel';
     1700            return
     1701        elseif strcmp(answer,'Yes')
    16841702            detect=0;
    16851703            check_create=0;
     
    18491867[Series,tild,errormsg]=prepare_jobs(handles);% read the parameters from the GUI series
    18501868if ~isempty(errormsg)
     1869    if ~strcmp(errormsg,'Cancel')
    18511870    msgbox_uvmat('ERROR',errormsg)
     1871    end
    18521872    return
    18531873end
     
    23862406    Param=read_GUI(handles.series);
    23872407    RootPath=Param.InputTable{1,1};
     2408    if ~isfield(Param,'OutputSubDir')   
     2409        msgbox_uvmat('ERROR','no directory defined for output files')
     2410        return
     2411    end
    23882412    OutputSubDir=[Param.OutputSubDir Param.OutputDirExt];% subdirectory for output files
    23892413    OutputDir=fullfile(RootPath,OutputSubDir);
Note: See TracChangeset for help on using the changeset viewer.