Changeset 783 for trunk


Ignore:
Timestamp:
Jun 5, 2014, 10:39:28 PM (7 years ago)
Author:
sommeria
Message:

-pb of mulitple tiff reading solved
-modif of output parma in get-file_type and find_file_series

  • introduction of transform/ima_noise_rms
Location:
trunk/src
Files:
1 added
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r662 r783  
    433433% detect the file type, get the movie object if relevant, and look for the corresponding file series:
    434434% the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists
    435 [RootPath,SubDirImages,RootFile,i1_series,tild,j1_series,tild,NomTypeIma,FileType,FileInfo,MovieObject]=find_file_series(FilePath,[FileName ImaExt]);
     435[RootPath,SubDirImages,RootFile,i1_series,tild,j1_series,tild,NomTypeIma,FileInfo,MovieObject]=find_file_series(FilePath,[FileName ImaExt]);
     436FileType=FileInfo.FileType;
    436437switch FileType
    437438    case {'image','multimage','video','mmreader'}
     
    12041205% if strcmp(Param.Program,'civ_matlab')
    12051206    if Param.CheckCiv1
    1206         [Param.Civ1.FileTypeA,ImageInfoA_civ1,Param.Civ1.ImageA]=get_file_type(filecell.ima1.civ1{1});
    1207         [Param.Civ1.FileTypeB,ImageInfoB_civ1,Param.Civ1.ImageB]=get_file_type(filecell.ima2.civ1{1});
     1207        [ImageInfoA_civ1,Param.Civ1.ImageA]=get_file_type(filecell.ima1.civ1{1});
     1208        Param.Civ1.FileTypeA=ImageInfoA_civ1.FileType;
     1209        [ImageInfoB_civ1,Param.Civ1.ImageB]=get_file_type(filecell.ima2.civ1{1});
     1210        Param.Civ1.FileTypeB=ImageInfoB_civ1.FileType;
    12081211    end
    12091212    if Param.CheckCiv2
    1210         [Param.Civ2.FileTypeA,ImageInfoA_civ2,Param.Civ2.ImageA]=get_file_type(filecell.ima1.civ2{1});
    1211         [Param.Civ2.FileTypeB,ImageInfoB_civ2,Param.Civ2.ImageB]=get_file_type(filecell.ima2.civ2{1});
     1213        [ImageInfoA_civ2,Param.Civ2.ImageA]=get_file_type(filecell.ima1.civ2{1});
     1214        Param.Civ2.FileTypeA=ImageInfoA_civ2.FileType;
     1215        [ImageInfoB_civ2,Param.Civ2.ImageB]=get_file_type(filecell.ima2.civ2{1});
     1216        Param.Civ2.FileTypeB=ImageInfoB_civ2.FileType;
    12121217    end
    12131218% end
     
    23212326    if ~isequal(ext_ima,'.png')
    23222327        if checkbox(1) %if civ1 is performed
    2323              [FileType,FileInfo,MovieObject]=get_file_type(filecell.ima1.civ1{1});
     2328             [FileInfo,MovieObject]=get_file_type(filecell.ima1.civ1{1});
     2329             FileType=FileInfo.FileType;
    23242330            check_j=0;
    23252331            if strcmp(FileType,'mmreader')||strcmp(FileType,'VideoReader')||strcmp(FileType,'multimage')
     
    23602366        end
    23612367        if checkbox(4) %if civ2 is performed
    2362              [FileType,FileInfo,MovieObject]=get_file_type(filecell.ima1.civ2{1});
     2368             [FileInfo,MovieObject]=get_file_type(filecell.ima1.civ2{1});
     2369             FileType=FileInfo.FileType;
    23632370            check_j=0;
    23642371            if strcmp(FileType,'mmreader')||strcmp(FileType,'VideoReader')||strcmp(FileType,'multimage')
     
    25692576            % detect the file type, get the movie object if relevant, and look for the corresponding file series:
    25702577            % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists
    2571             [RootPath,SubDir,RootFile_1,i1_series,i2_series,j1_series,j2_series,nom_type_1,FileType,FileInfo,Object,i1,i2,j1,j2]=find_file_series(FilePath,[FileName Ext]);
    2572            
     2578            [RootPath,SubDir,RootFile_1,i1_series,i2_series,j1_series,j2_series,nom_type_1,FileInfo,Object,i1,i2,j1,j2]=find_file_series(FilePath,[FileName Ext]);
     2579            FileType=FileInfo.FileType;
    25732580            %check image nom type
    25742581            if ~strcmp(nom_type_1,get(handles.NomType,'String'))
     
    37753782    Data.CoordUnit='pixel';% used to set equal scaling for x and y in image dispaly
    37763783    par_civ1=read_GUI(handles.Civ1);
    3777     par_civ1.FileTypeA=get_file_type(filecell.ima1.civ1{1});
     3784    FileInfo=get_file_type(filecell.ima1.civ1{1});
     3785    par_civ1.FileTypeA=FileInfo.FileType;
    37783786    par_civ1.ImageWidth=size(Data.A,2);
    37793787    par_civ1.ImageHeight=size(Data.A,1);
  • trunk/src/find_file_series.m

    r667 r783  
    11%'find_file_series': check the content of an input file and find the corresponding file series
    22%--------------------------------------------------------------------------
    3 % function [RootPath,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object,i1_input,i2_input,j1_input,j2_input]=find_file_series(fileinput)
     3% function [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileInfo,Object,i1_input,i2_input,j1_input,j2_input]=find_file_series(FilePath,fileinput,checkxml)
    44%
    55% OUTPUT:
     6% RootPath: path to the dir containing the input file
     7% SubDir: data dir containing the input file series
    68% RootFile: root file detected in fileinput, possibly modified for movies (indexing is then done on image view, not file)
    79% i1_series(pair,ref_j+1, ref_i+1),i2_series,j1_series,j2_series: set of indices (i1,i2,j1,j2) sorted by ref index ref_i, ref_j, and pairindex in case of multiple pairs with the same ref
    810%  (ref_i+1 is used to deal with the image index zero sometimes used)
    911% NomType: nomenclature type corrected after checking the first file (problem of 0 before the number string)
    10 % FileType: type of file, =
    11 %       = 'image', usual image as recognised by Matlab
    12 %       = 'multimage', image series stored in a single file
    13 %       = 'civx', netcdf file with civx convention
    14 %       = 'civdata', civ data with new convention
    15 %       = 'netcdf' other netcdf files
    16 %       = 'video': movie recognised by VideoReader (e;g. avi)
    17 % MovieObject: video object (=[] otherwise)
     12% FileInfo: structure containing info on the input files (assumed identical on the whole series)
     13    % FileInfo.FileType: type of file, =
     14    %       = 'image', usual image as recognised by Matlab
     15    %       = 'multimage', image series stored in a single file
     16    %       = 'civx', netcdf file with civx convention
     17    %       = 'civdata', civ data with new convention
     18    %       = 'netcdf' other netcdf files
     19    %       = 'video': movie recognised by VideoReader (e;g. avi)
     20% MovieObject: video object (=[] otherwise
     21% i1_input,i2_input,j1_input,j2_input: indices of the input file, or of the first file in the series if the input file does not exist
    1822%
    1923%INPUT
    20 % RootPath: path to the directory to be scanned
     24% FilePath: path to the directory to be scanned
    2125% fileinput: name (without path) of the input file sample
    2226% checkxml: =1(default) take into account xml file existence to possibly include indexes in RootFile
     
    3943%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    4044
    41 function [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,FileInfo,MovieObject,i1_input,i2_input,j1_input,j2_input]=find_file_series(FilePath,fileinput,checkxml)
     45function [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileInfo,MovieObject,i1_input,i2_input,j1_input,j2_input]=find_file_series(FilePath,fileinput,checkxml)
    4246%------------------------------------------------------------------------
    4347
     
    5256j1_series=zeros(1,1,1);
    5357j2_series=zeros(1,1,1);
    54 [FileType,FileInfo,MovieObject]=get_file_type(fullfileinput);
     58[FileInfo,MovieObject]=get_file_type(fullfileinput);
    5559if ~exist(FilePath,'dir')
    5660    return % don't go further if the dir path does not exist
     
    233237        NomType=regexprep(NomType,['^' NomTypePref],'');
    234238        %% update the file type if the input file does not exist (pb of 0001)
    235         if isempty(FileType)
    236             [FileType,FileInfo,MovieObject]=get_file_type(fullfile(FilePath,dirpair(ifile_min).name));
     239        if isempty(FileInfo.FileType)
     240            [FileInfo,MovieObject]=get_file_type(fullfile(FilePath,dirpair(ifile_min).name));
    237241        end
    238242    end
     
    247251%% introduce the frame index in case of movies or multimage type
    248252if isfield(FileInfo,'NumberOfFrames') && FileInfo.NumberOfFrames >1
    249     if isempty(i1_series)
     253    if isempty(i1_series)% if there is no file index, i denotes the frame index
    250254        i1_series=zeros(FileInfo.NumberOfFrames+1,2);% first column =0
    251255        i1_series(:,2)=(0:FileInfo.NumberOfFrames)'; % second column=frame index -1
    252256        i1_input=1;
    253257        NomType='*';
    254     else
    255         i1_series=i1_series(:,2)*ones(1,FileInfo.NumberOfFrames);
    256         i1_series=[zeros(size(i1_series,1),1) i1_series];
    257         j1_series=ones(size(i1_series,1),1)*(1:FileInfo.NumberOfFrames);
    258         j1_series=[zeros(size(i1_series,1),1) j1_series];
    259         %  include the first index in the root name
    260         r=regexp(NomType,'^(?<tiretnum>_?\d+)','names');%look for a number or _1 at the beginning of NomType
    261         if ~isempty(r)
    262             fileinput_end=regexprep(fileinput,['^' RootFile],'');%remove RootFile at the beginning of fileinput
    263             if isempty(regexp(r.tiretnum,'^_','once'))% if a separator '_' is not  detected
    264                 rr=regexp(fileinput_end,'^(?<i1>\d+)','names');
    265             else% if a separator '_' is  detected
    266                 rr=regexp(fileinput_end,'^(?<i1>_\d+)','names');
    267             end
    268             if ~isempty(rr)
    269 %                 RootFile=[RootFile rr.i1];% new root file
    270 %                 NomTypePref=r.tiretnum;
    271 %                 NomType=regexprep(NomType,['^'  NomTypePref],'');
    272               %  i1_input=j1_input;
    273               %  i2_input=j2_input;
    274                 j1_input=1;
    275                 j2_input=[];
     258    else  % if there is a file index, j denotes the frame index while i denotes the file index
     259        if strcmp(NomType(end-1:end),'ab')% recognized as a pair
     260            RootFile=fullfile_uvmat('','',RootFile,'',NomType,i1_input,i2_input,j1_input,j2_input);% restitute the root name without the detected indices       
     261            i1_series=zeros(FileInfo.NumberOfFrames+1,2);% first column =0
     262            i1_series(:,2)=(0:FileInfo.NumberOfFrames)'; % second column=frame index -1
     263            j1_series=[];
     264            i1_input=1;
     265            NomType='*';
     266        else
     267            i1_series=i1_series(:,2)*ones(1,FileInfo.NumberOfFrames);%
     268            i1_series=[zeros(size(i1_series,1),1) i1_series];
     269            j1_series=ones(size(i1_series,1),1)*(1:FileInfo.NumberOfFrames);%
     270            j1_series=[zeros(size(i1_series,1),1) j1_series];
     271            %  include the first index in the root name
     272            r=regexp(NomType,'^(?<tiretnum>_?\d+)','names');%look for a number or _1 at the beginning of NomType
     273            if ~isempty(r)
     274                fileinput_end=regexprep(fileinput,['^' RootFile],'');%remove RootFile at the beginning of fileinput
     275                if isempty(regexp(r.tiretnum,'^_','once'))% if a separator '_' is not  detected
     276                    rr=regexp(fileinput_end,'^(?<i1>\d+)','names');
     277                else% if a separator '_' is  detected
     278                    rr=regexp(fileinput_end,'^(?<i1>_\d+)','names');
     279                end
     280                if ~isempty(rr)
     281                    j1_input=1;
     282                    j2_input=[];
     283                end
    276284            end
    277285        end
  • trunk/src/get_file_series.m

    r757 r783  
    6262        FilePath=fullfile(InputTable{iview,1},InputTable{iview,2});
    6363        fileinput=[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}];
    64         [tild,tild,tild,i1_series{iview},i2_series{iview},j1_series{iview},j2_series{iview},NomType,FileType,FileInfo,MovieObject,...
     64        [tild,tild,tild,i1_series{iview},i2_series{iview},j1_series{iview},j2_series{iview},NomType,FileInfo,MovieObject,...
    6565            i1_input,i2_input,j1_input,j2_input]=find_file_series(FilePath,fileinput);
    6666        i1_series{iview}=squeeze(i1_series{iview}(1,:,:)); %select first  pair index as ordered by find_file_series
  • trunk/src/get_file_type.m

    r781 r783  
    1616% INPUT:
    1717% fileinput: name, including path, of the file to analyse
    18 function [FileType,FileInfo,VideoObject]=get_file_type(fileinput)
    19 %%%% TODO: suppress the output argument FileType, contained in FileInfo %%%%
    20 FileInfo=[];% will remain empty in the absence of input file
     18function [FileInfo,VideoObject]=get_file_type(fileinput)
    2119VideoObject=[];
    2220if exist(fileinput,'file')
    2321    FileInfo.FileName=fileinput;
    2422    FileInfo.FileType='txt'; %default
    25     FileType='txt';%default, text file
    2623else
    27     FileType='';
     24    FileInfo.FileType='';
    2825    return
    2926end
    30 [tild,tild,FileExt]=fileparts(fileinput);
     27[tild,tild,FileExt]=fileparts(fileinput);%get the fiel extension FileExt
    3128
    3229switch FileExt
    3330    case '.fig'
    3431        FileInfo.FileType='figure';
    35         FileType='figure';
    3632    case '.xml'
    3733        FileInfo.FileType='xml';
    38         FileType='xml';
    3934    case '.xls'
    4035        FileInfo.FileType='xls';
    41         FileType='xls';
    4236    case '.dat'
    43         FileInfo.FileType='dat';
    44         FileType='dat';
     37        FileInfo.FileType='dat';;
    4538    otherwise
    4639        if ~isempty(FileExt)% exclude empty extension
     
    5043                    try
    5144                        imainfo=imfinfo(fileinput);
    52                         if length(imainfo) >1 %case of image with multiple frames
    53                             FileType='multimage';
     45                        if length(imainfo) >1 %case of image with multiple frames   
    5446                            FileInfo=imainfo(1);%take info from the first frame
     47                            FileInfo.FileType='multimage';
    5548                            FileInfo.NumberOfFrames=length(imainfo);
    5649                        else
    57                             FileType='image';
    5850                            FileInfo=imainfo;
     51                            FileInfo.FileType='image';
    5952                            FileInfo.NumberOfFrames=1;
    6053                        end
    6154                        FileInfo.FileName=FileInfo.Filename; %correct the info given by imfinfo
    62                         FileInfo.FileType=FileType;
    6355                    end
    6456                else
    6557                    error_nc=0;
    6658                    try
    67                       %  [Data,tild,tild,errormsg]=nc2struct(fileinput,'ListGlobalAttribute','absolut_time_T0','Conventions',...
    68                        %     'CivStage','patch2','fix2','civ2','patch','fix','hart');
    6959                       [Data,tild,tild,errormsg]=nc2struct(fileinput,[]);
    7060                        if ~isempty(errormsg)
     
    8979                            elseif isfield(Data,'Conventions') && strcmp(Data.Conventions,'uvmat/civdata')
    9080                                FileInfo.FileType='civdata'; % test for civx velocity fields
    91                                 FileType='civdata'; % test for civx velocity fields
     81                               % FileType='civdata'; % test for civx velocity fields
    9282                                FileInfo.CivStage=Data.CivStage;
    9383                            else
    9484                                FileInfo.FileType='netcdf';
    95                                 FileType='netcdf';
     85                                %FileType='netcdf';
    9686                                FileInfo.ListVarName=Data.ListVarName;
    9787                            end
     
    10595                                VideoObject=VideoReader(fileinput);
    10696                                FileInfo=get(VideoObject);
    107                                 FileType='video';
     97                                FileInfo.FileType='video';
    10898                            elseif exist('mmreader.m','file')% Matlab 2009a
    10999                                VideoObject=mmreader(fileinput);
    110100                                FileInfo=get(VideoObject);
    111                                 FileType='mmreader';
     101                                FileInfo.FileType='mmreader';
    112102                            end
    113103                            FileInfo.FileName=fileinput;
    114                             FileInfo.FileType=FileType;
    115104                            FileInfo.BitDepth=FileInfo.BitsPerPixel/3;
    116105                        end
  • trunk/src/series.m

    r781 r783  
    424424    if ~isequal(ListStruct(ilist).isdir,1)%look for files, not dir
    425425        FileName=ListStruct(ilist).name;
    426         FileType=get_file_type(fullfile(DirName,FileName));
    427         switch FileType
     426        FileInfo=get_file_type(fullfile(DirName,FileName));
     427        switch FileInfo.FileType
    428428            case {'image','multimage','civx','civdata','netcdf'}
    429429                break
     
    477477    if ~isequal(hdir(ilist).isdir,1)%look for files, not dir
    478478        FileName=hdir(ilist).name;
    479         FileType=get_file_type(fullfile(DirName,FileName));
    480         switch FileType
     479        FileInfo=get_file_type(fullfile(DirName,FileName));
     480        switch FileInfo.FileType
    481481            case {'image','multimage','civx','civdata','netcdf'}
    482482            break
     
    553553        RootPath=fileparts(RootPath); %will try the upper folder
    554554    else %scan the input folder
    555         [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,FileInfo,MovieObject]=...
     555        [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=...
    556556            find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]);
    557557    end
     
    607607% detect the file type, get the movie object if relevant, and look for the corresponding file series:
    608608% the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists
    609 [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]);
     609[RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileInfo,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]);
     610FileType=FileInfo.FileType;
    610611if isempty(RootFile)&&isempty(i1_series)
    611612    errormsg='no input file in the series';
     
    10241025%% set length of waitbar
    10251026displ_time(handles)
    1026 
    1027 
    1028 % look for netcdf data as input
    1029 % switch FileType
    1030 %     case {'civx','civdata'}
    1031 %         FieldList=[set_field_list('U','V');{'C'}];%standard menu for civx data
    1032 %         set(handles.Coord_x,'String','X');
    1033 %         set(handles.Coord_y,'String','Y');
    1034 %     case 'netcdf'
    1035 %         ind_x=find(strcmp(get(handles.Coord_x,'String'),FileInfo.ListVarName));
    1036 %         if isempty(ind_x)
    1037 %             FieldList={};% new kind of file opened, we need to pick variables with get_field...
    1038 %             set(handles.Coord_x,'String','')
    1039 %             set(handles.Coord_y,'String','')
    1040 %         else
    1041 %             FileInfo.ListVarName(ind_x)=[];%remove coord-x from the list of variables to display
    1042 %             ind_y=find(strcmp(get(handles.Coord_y,'String'),FileInfo.ListVarName));
    1043 %             if isempty(ind_y)
    1044 %             FieldList={};% new kind of file opened, we need to pick variables with get_field...
    1045 %             set(handles.Coord_x,'String','')
    1046 %             set(handles.Coord_y,'String','')
    1047 %             else
    1048 %                 FileInfo.ListVarName(ind_y)=[];%remove coord-y from the list of variables to display
    1049 %                 FieldList=(FileInfo.ListVarName)';
    1050 %             end
    1051 %         end 
    1052 %     otherwise
    1053 %         set(handles.FieldName,'Value',1) % set menu to 'image'
    1054 %         set(handles.FieldName,'String',{'image'})
    1055 %         set(handles.Coord_x,'String','AX');
    1056 %         set(handles.Coord_y,'String','AY');
    1057 % end
    1058 % if ismember(FileType,{'civx','civdata','netcdf'})
    1059 %     PrevMenu=get(handles.FieldName,'String');
    1060 %     PrevValue=get(handles.FieldName,'Value');
    1061 %     PrevMenu=PrevMenu(PrevValue(PrevValue<=numel(PrevMenu)));
    1062 %     FieldValue=[];
    1063 %     for ilist=1:numel(PrevMenu)
    1064 %         index_menu=find(strcmp(PrevMenu{ilist},FieldList));
    1065 %         if ~isempty(index_menu)
    1066 %             FieldValue=[FieldValue index_menu];
    1067 %         end
    1068 %     end
    1069 %     if isempty(FieldValue)
    1070 %         FieldValue=1;
    1071 %     end
    1072 %     set(handles.FieldName,'Value',FieldValue)
    1073 %     set(handles.FieldName,'String',[FieldList;{'get_field...'}])
    1074 % end
    10751027
    10761028
     
    30232975    set(htitlebox,'String',FullSelectName)
    30242976elseif exist(FullSelectName,'file')%visualise the vel field if it exists
    3025     FileType=get_file_type(FullSelectName);
    3026     if strcmp(FileType,'txt')
     2977    FileInfo=get_file_type(FullSelectName);   
     2978    if strcmp(FileInfo.FileType,'txt')
    30272979        edit(FullSelectName)
    3028     elseif strcmp(FileType,'xml')
     2980    elseif strcmp(FileInfo.FileType,'xml')
    30292981        editxml(FullSelectName)
    30302982    else
  • trunk/src/series/aver_stat.m

    r751 r783  
    121121        return
    122122    end
    123     [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     123    [FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     124    FileType{iview}=FileInfo{iview}.FileType;
    124125    CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images
    125126    CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files
  • trunk/src/series/aver_synchro.m

    r751 r783  
    9393FileExt=Param.InputTable(:,5);
    9494[filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
    95  [FileType,FileInfo]=get_file_type(filecell{1,1});
     95FileInfo=get_file_type(filecell{1,1});
     96 FileType=FileInfo.FileType;
    9697%%%%%%%%%%%%
    9798% The cell array filecell is the list of input file names, while
  • trunk/src/series/beam_forming.m

    r782 r783  
    8282        return
    8383    end
    84     [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     84    [FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     85    FileType{iview}=FileInfo{iview}.FileType;
    8586    CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images
    8687    CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files
  • trunk/src/series/check_data_files.m

    r649 r783  
    9292NcTypeOptions={'netcdf','civx','civdata'};
    9393for iview=1:nbview
    94     [FileType{iview},FileInfo{iview},Object{iview}]=get_file_type(filecell{iview,1});
     94    [FileInfo{iview},Object{iview}]=get_file_type(filecell{iview,1});
     95    FileType{iview}=FileInfo{iview}.FileType;
    9596    CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images
    9697    CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files
     
    100101for iview=1:nbview
    101102    if isequal(FileType{iview},'mmreader')||isequal(FileType{iview},'video')||isequal(FileType{iview},'multimage')
    102         [tild,FileInfo]=get_file_type(filecell{iview,1});
     103        [FileInfo]=get_file_type(filecell{iview,1});
    103104        Tabchar{1}=filecell{iview,1};%info.Filename;
    104105        Tabchar{2}='';
    105106        Tabchar{3}=[num2str(FileInfo.FrameRate) ' frames/s '];
    106107        message='';
    107         %         Tabchar{4}='';
    108         %         Tabchar{5}=['  compression' FileInfo.VideoCompression];
    109         %         Tabchar{6}=[ 'quality ' num2str(FileInfo.Quality)];
    110108    else
    111109        Tabchar={};
     
    133131                    end
    134132                    lastfield='';
    135                     [FileType{iview},FileInfo,Object]=get_file_type(file);
     133                    [FileInfo,Object]=get_file_type(file);
     134                    FileType{iview}=FileInfo.FileType;
    136135                    if strcmp(FileType{iview},'civx')||strcmp(FileType{iview},'civdata')
    137136                        if isfield(FileInfo,'CivStage')
  • trunk/src/series/check_peaklock.m

    r668 r783  
    113113        return
    114114    end
    115     [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     115    [FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     116    FileType{iview}=FileInfo{iview}.FileType;
    116117    CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images
    117118    CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files
  • trunk/src/series/civ_input.m

    r781 r783  
    20682068 Data.CoordUnit='pixel';% used to set equal scaling for x and y in image dispa=ly
    20692069 par_civ1=read_GUI(handles.Civ1);
    2070  par_civ1.FileTypeA=get_file_type(ImageName_A);
     2070 FileInfo=get_file_type(ImageName_A);
     2071 par_civ1.FileTypeA=FileInfo.FileType;
    20712072 par_civ1.ImageWidth=size(Data.A,2);
    20722073 par_civ1.ImageHeight=size(Data.A,1);
  • trunk/src/series/civ_series.m

    r782 r783  
    220220            return
    221221        end
    222         [FileType_A,FileInfo_A,VideoObject_A]=get_file_type(ImageName_A);
     222        [FileInfo_A,VideoObject_A]=get_file_type(ImageName_A);
     223        FileType_A=FileInfo_A.FileType;
    223224        if strcmp(FileInfo_A.FileType,'netcdf')
    224225            FieldName_A=Param.InputFields.FieldName;
     
    233234            return
    234235        end
    235         [FileType_B,FileInfo_B,VideoObject_B]=get_file_type(ImageName_B);
     236        [FileInfo_B,VideoObject_B]=get_file_type(ImageName_B);
     237        FileType_B=FileInfo_B.FileType;
    236238        if strcmp(FileInfo_B.FileType,'netcdf')
    237239            FieldName_B=Param.InputFields.FieldName;
     
    255257            return
    256258        end
    257         [FileType_B,FileInfo_B,VideoObject_B]=get_file_type(ImageName_B);
     259        [FileInfo_B,VideoObject_B]=get_file_type(ImageName_B);
     260        FileType_B=FileInfo_B.FileType;
    258261        [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ2(1));
    259262        NbField=numel(i1_series_Civ2);
  • trunk/src/series/float_tracking.m

    r635 r783  
    124124
    125125%% check the input file type 
    126 [FileType,FileInfo,VideoObject]=get_file_type(filecell{1,1});
     126[FileInfo,VideoObject]=get_file_type(filecell{1,1});
     127FileType=FileInfo.FileType;
    127128ImageTypeOptions={'image','multimage','mmreader','video'};
    128129if isempty(find(strcmp(FileType,ImageTypeOptions)))
  • trunk/src/series/ima_levels.m

    r635 r783  
    6565        msgbox_uvmat('WARNING','the first input file does not exist')
    6666    else
    67         FileType=get_file_type(filecell{1,1});
     67        FileInfo=get_file_type(filecell{1,1});
     68        FileType=FileInfo.FileType;
    6869        if isempty(find(strcmp(FileType,{'image','multimage','mmreader','video'})));% =1 for images
    6970            msgbox_uvmat('ERROR',['bad input file type for ' mfilename ': an image is needed'])
     
    106107nbfield_i=size(i1_series{1},2); %nb of fields for the i index
    107108nbfield=nbfield_j*nbfield_i; %total number of fields
    108 [FileType{1},FileInfo{1},VideoObject{1}]=get_file_type(filecell{1,1});% type of input file
     109[FileInfo{1},VideoObject{1}]=get_file_type(filecell{1,1});% type of input file
     110FileType{1}=FileInfo{1}.FileType;
    109111
    110112%% frame index for movie or multimage file input 
  • trunk/src/series/merge_proj.m

    r746 r783  
    121121        return
    122122    end
    123     [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     123    [FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     124    FileType{iview}=FileInfo{iview}.FileType;
    124125    CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images
    125126    CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files
  • trunk/src/series/merge_proj_special.m

    r712 r783  
    114114        return
    115115    end
    116     [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     116    [FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     117    FileType{iview}=FileInfo{iview}.FileType;
    117118    CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images
    118119    CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files
  • trunk/src/series/particle_tracking.m

    r635 r783  
    124124
    125125%% check the input file type 
    126 [FileType,FileInfo,VideoObject]=get_file_type(filecell{1,1});
     126[FileInfo,VideoObject]=get_file_type(filecell{1,1});
     127FileType=FileInfo.FileType;
    127128ImageTypeOptions={'image','multimage','mmreader','video'};
    128129if isempty(find(strcmp(FileType,ImageTypeOptions)))
  • trunk/src/series/relabel_i_j.m

    r736 r783  
    9595    return
    9696end
    97 [FileType{1},FileInfo{1},MovieObject{1}]=get_file_type(filecell{1,1});
     97[FileInfo{1},MovieObject{1}]=get_file_type(filecell{1,1});
     98FileType{1}=FileInfo{1}.FileType;
    9899CheckImage=~isempty(find(strcmp(FileType{1},ImageTypeOptions)));% =1 for images
    99100
  • trunk/src/series/sub_background.m

    r774 r783  
    9090    %% check the validity of  input file types
    9191    ImageTypeOptions={'image','multimage','mmreader','video'};%allowed input file types(images)
    92     FileType=get_file_type(FirstFileName);
     92    FileInfo=get_file_type(FirstFileName);
     93    FileType=FileInfo.FileType;
    9394    CheckImage=~isempty(find(strcmp(FileType,ImageTypeOptions), 1));% =1 for images
    9495    if ~CheckImage
     
    200201    % i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices
    201202%%%%%%%%%%%%
    202 [FileType{1},FileInfo{1},MovieObject{1}]=get_file_type(filecell{1,1});
     203[FileInfo{1},MovieObject{1}]=get_file_type(filecell{1,1});
     204FileType{1}=FileInfo{1}.FileType;
    203205    if ~isempty(j1_series{1})
    204206        frame_index{1}=j1_series{1};
  • trunk/src/series/time_series.m

    r768 r783  
    124124        return
    125125    end
    126     [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     126    [FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     127    FileType{iview}=FileInfo{iview}.FileType;
    127128    if strcmp(FileType{iview},'civdata')||strcmp(FileType{iview},'civx')
    128129        if ~isfield(Param.InputFields,'VelType')
  • trunk/src/series/turb_stat.m

    r761 r783  
    103103        return
    104104    end
    105     [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     105    [FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     106    FileType{iview}=FileInfo{iview}.FileType;
    106107    CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images
    107108    CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files
  • trunk/src/set_grid.m

    r622 r783  
    228228    return
    229229end
    230 [FileType,tild,VideoObject]=get_file_type(GUI.ImageA);
    231 switch FileType
     230[FileInfo,VideoObject]=get_file_type(GUI.ImageA);
     231switch FileInfo.FileType
    232232    case {'image','multimage','video','mmreader'}% case of input image or movie OK
    233233    otherwise
     
    265265
    266266%% detect the grid points which are inside image A
    267 A=read_image(GUI.ImageA,FileType,VideoObject,1);
     267A=read_image(GUI.ImageA,FileInfo.FileType,VideoObject,1);
    268268npxA=size(A,2);
    269269npyA=size(A,1);
     
    323323            'Pick the second image file',fileparts(fileparts(get(handles.ImageA,'String'))));
    324324        ImageB=fullfile(PathName,FileName);
    325         [FileType,tild,VideoObject]=get_file_type(ImageB);
    326     switch FileType
     325        [FileInfo,tild,VideoObject]=get_file_type(ImageB);
     326    switch FileInfo.FileType
    327327        case {'image','multimage','video','mmreader'}% case of input image or movie OK
    328328            set(handles.ImageB,'String',ImageB)
  • trunk/src/uigetfile_uvmat.m

    r714 r783  
    147147                uiresume(hfig)
    148148            case 'status_display'
    149                 FileType=get_file_type(FullSelectName);
    150                 if strcmp(FileType,'txt')
     149                FileInfo=get_file_type(FullSelectName);
     150                if strcmp(FileInfo.FileType,'txt')
    151151                    edit(FullSelectName)
    152                 elseif strcmp(FileType,'xml')
     152                elseif strcmp(FileInfo.FileType,'xml')
    153153                    editxml(FullSelectName)
    154                 elseif strcmp(FileType,'figure')
     154                elseif strcmp(FileInfo.FileType,'figure')
    155155                    open(FullSelectName)
    156156                else
  • trunk/src/uvmat.m

    r782 r783  
    643643[RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);
    644644% detect the file type, get the movie object if relevant, and look for the corresponding file series:
    645 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);
     645[RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);
    646646if isempty(i1_series)
    647647    fileinput=uigetfile_uvmat('pick an input file',fullfile(RootPath,SubDir));
     
    666666    [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles);
    667667    % detect the file type, get the movie object if relevant, and look for the corresponding file series:
    668     [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);
     668    [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);
    669669    if isempty(i1_series)
    670670        fileinput=uigetfile_uvmat('pick an input file for the second line',fullfile(RootPath,SubDir));
     
    737737% detect the file type, get the movie object if relevant, and look for the corresponding file series:
    738738% the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists
    739 [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]);
    740 
     739[RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileInfo,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]);
     740FileType=FileInfo.FileType;
    741741if strcmp(FileType,'txt')
    742742    try
     
    13841384            for ifile=1:numel(ListFiles)
    13851385                [tild,tild,MaskExt]=fileparts(ListFiles{1});
    1386                 [tild,tild,MaskFile{ifile},i1_series,i2_series,j1_series,j2_series,MaskNomType,MaskFileType]=find_file_series(MaskPath,ListFiles{ifile},0);
     1386                [tild,tild,MaskFile{ifile},i1_series,i2_series,j1_series,j2_series,MaskNomType,MaskFileInfo]=find_file_series(MaskPath,ListFiles{ifile},0);
     1387                MaskFileType=MaskFileInfo.FileType;
    13871388                if strcmp(MaskFileType,'image') && isempty(i2_series) && isempty(j2_series)
    13881389                    mdetect=1;
     
    21852186    case 'multimage'
    21862187        if ~strcmp(NomType,'*')
     2188            MaxIndex_j_cell=get(handles.MaxIndex_j,'String');
     2189            if num_j1>str2num(MaxIndex_j_cell{1})
     2190                errormsg='specified frame index exceeds file content';
     2191                return
     2192            else
    21872193            frame_index=num_j1;%frame index for movies or multimage
     2194            end
    21882195        else
     2196            MaxIndex_i_cell=get(handles.MaxIndex_i,'String');
     2197            if num_i1>str2num(MaxIndex_i_cell{1})
     2198                errormsg='specified frame index exceeds file content';
     2199                return
     2200            else
    21892201            frame_index=num_i1;
     2202            end
    21902203        end
    21912204    case 'vol' %TODO: update
     
    38773890
    38783891%% delete drawn objects if the output CooordUnit is different from the previous one
    3879 if  ~strcmp(CoordUnit,CoordUnitPrev)
     3892if  ~isempty(CoordUnit) && ~isempty(CoordUnitPrev) && ~strcmp(CoordUnit,CoordUnitPrev)
    38803893    set(handles.CheckFixLimits,'Value',0)
    38813894    hother=findobj('Tag','proj_object');%find all the proj objects
Note: See TracChangeset for help on using the changeset viewer.