Changeset 548


Ignore:
Timestamp:
Oct 10, 2012, 11:25:35 PM (9 years ago)
Author:
sommeria
Message:

various bug repairs

Location:
trunk/src
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/check_files.m

    r530 r548  
    8585    'read_civdata';... reads new civ data from netcdf files
    8686    'read_field';...% read the fields from files in different formats (netcdf files, images, video)
    87     'read_get_field';... read the list of selected variables from the GUI get_field (TODO: use read_GUI)
     87%     'read_get_field';... read the list of selected variables from the GUI get_field (TODO: use read_GUI)
    8888    'read_GUI';... %read a GUI and provide the data as a Matlab structure
    8989    'read_image';...%read images or video objects
  • trunk/src/civ.m

    r547 r548  
    37763776    set(0,'CurrentFigure',hview_field)
    37773777    hhview_field=guihandles(hview_field);
    3778     set(hview_field,'CurrentAxes',hhview_field.axes3)
     3778    set(hview_field,'CurrentAxes',hhview_field.PlotAxes)
    37793779    ViewData=get(hview_field,'UserData');
    37803780    ViewData.CivHandle=handles.civ;% indicate the handle of the civ GUI in view_field
    3781     ViewData.axes3.B=imread(filecell.ima2.civ1{1});%store the second image in the UserData of the GUI view_field
    3782     ViewData.axes3.X=Grid.Civ1_X; %keep the set of points in memeory
    3783     ViewData.axes3.Y=Grid.Civ1_Y;
     3781    ViewData.PlotAxes.B=imread(filecell.ima2.civ1{1});%store the second image in the UserData of the GUI view_field
     3782    ViewData.PlotAxes.X=Grid.Civ1_X; %keep the set of points in memeory
     3783    ViewData.PlotAxes.Y=Grid.Civ1_Y;
    37843784    set(hview_field,'UserData',ViewData)
    37853785    corrfig=findobj(allchild(0),'tag','corrfig');% look for a current figure for image correlation display
  • trunk/src/civ_matlab.m

    r497 r548  
    100100        end
    101101    else
    102         if isfield(Param.Civ1,'ImageA')%&&...   
     102        if isfield(Param.Civ1,'ImageA') && ischar(Param.Civ1.ImageA)
    103103             Param.Civ1.ImageA=regexprep(Param.Civ1.ImageA,'''','\');
    104104            [par_civ1.ImageA,VideoObject] = read_image(Param.Civ1.ImageA,par_civ1.FileTypeA,[],par_civ1.FrameIndexA);
    105105        end
    106         if isfield(Param.Civ1,'ImageB')%&& ...
     106        if isfield(Param.Civ1,'ImageB')&& ischar(Param.Civ1.ImageB)
    107107             Param.Civ1.ImageB=regexprep(Param.Civ1.ImageB,'''','\');
    108108             if strcmp(Param.Civ1.ImageA,Param.Civ1.ImageB)% use the same movie object
  • trunk/src/sub_field.m

    r520 r548  
    4545        end
    4646        if ~isfield(Field,AttrName) || ~isequal(Field_1.(AttrName),Field.(AttrName))
    47         SubData.ListGlobalAttribute=[SubData.ListGlobalAttribute {AttrNameNew}];
    48         SubData.(AttrNameNew)=Field_1.(AttrName);
     47            SubData.ListGlobalAttribute=[SubData.ListGlobalAttribute {AttrNameNew}];
     48            SubData.(AttrNameNew)=Field_1.(AttrName);
    4949        end
    5050    end
     
    149149
    150150%% substrat fields when possible
    151 [CellVarIndex,NbDim,CellVarType,errormsg]=find_field_cells(SubData);
     151%[CellVarIndex,NbDim,CellVarType,errormsg]=find_field_cells(SubData);
     152[CellInfo,NbDim,errormsg]=find_field_cells(SubData)
    152153ind_remove=zeros(size(SubData.ListVarName));
    153154ivar=[];
    154155ivar_1=[];
    155 for icell=1:numel(CellVarIndex)
    156     if ~isempty(CellVarIndex{icell})
    157         if isfield(CellVarType{icell},'scalar') && numel(CellVarType{icell}.scalar)==2 && SubData.VarAttribute{CellVarType{icell}.scalar(2)}.CheckSub;
    158             ivar=[ivar CellVarType{icell}.scalar(1)];
    159             ivar_1=[ivar_1 CellVarType{icell}.scalar(2)];
     156for icell=1:numel(CellInfo)
     157    if ~isempty(CellInfo{icell})
     158        if isfield(CellInfo{icell},'VarIndex_scalar') && numel(CellInfo{icell}.VarIndex_scalar)==2 && SubData.VarAttribute{CellInfo{icell}.VarIndex_scalar(2)}.CheckSub;
     159            ivar=[ivar CellInfo{icell}.VarIndex_scalar(1)];
     160            ivar_1=[ivar_1 CellInfo{icell}.VarIndex_scalar(2)];
    160161        end
    161         if isfield(CellVarType{icell},'vector_x') && numel(CellVarType{icell}.vector_x)==2 && SubData.VarAttribute{CellVarType{icell}.vector_x(2)}.CheckSub;
    162             ivar=[ivar CellVarType{icell}.vector_x(1)];
    163             ivar_1=[ivar_1 CellVarType{icell}.vector_x(2)];
     162        if isfield(CellInfo{icell},'VarIndex_vector_x') && numel(CellInfo{icell}.VarIndex_vector_x)==2 && SubData.VarAttribute{CellInfo{icell}.VarIndex_vector_x(2)}.CheckSub;
     163            ivar=[ivar CellInfo{icell}.VarIndex_vector_x(1)];
     164            ivar_1=[ivar_1 CellInfo{icell}.VarIndex_vector_x(2)];
    164165        end
    165         if isfield(CellVarType{icell},'vector_y') && numel(CellVarType{icell}.vector_y)==2 && SubData.VarAttribute{CellVarType{icell}.vector_y(2)}.CheckSub;
    166             ivar=[ivar CellVarType{icell}.vector_y(1)];
    167             ivar_1=[ivar_1 CellVarType{icell}.vector_y(2)];
     166        if isfield(CellInfo{icell},'VarIndex_vector_y') && numel(CellInfo{icell}.VarIndex_vector_y)==2 && SubData.VarAttribute{CellInfo{icell}.VarIndex_vector_y(2)}.CheckSub;
     167            ivar=[ivar CellInfo{icell}.VarIndex_vector_y(1)];
     168            ivar_1=[ivar_1 CellInfo{icell}.VarIndex_vector_y(2)];
    168169        end
    169170    end
     
    172173        VarName=SubData.ListVarName{ivar(imod)};
    173174        VarName_1=SubData.ListVarName{ivar_1(imod)};
    174         SubData.(VarName)=SubData.(VarName)-SubData.(VarName_1);
     175        SubData.(VarName)=double(SubData.(VarName))-double(SubData.(VarName_1));
    175176        ind_remove(ivar_1(imod))=1;
    176177end
  • trunk/src/uvmat.m

    r546 r548  
    791791TimeUnit='';%default
    792792Time=[];
    793 testima=0; %test for image input
     793% testima=0; %test for image input
    794794imainfo=[];
    795795ColorType='falsecolor'; %default
    796 hhh=[];
     796% hhh=[];
    797797UvData.MovieObject{index}=VideoObject;
    798798if ~isempty(VideoObject)
    799799    imainfo=get(VideoObject);
    800     testima=1;
     800%     testima=1;
    801801    TimeUnit='s';
    802802    if isempty(j1_series); %frame index along i
    803803        Time=(0:1/imainfo.FrameRate:(imainfo.NumberOfFrames)/imainfo.FrameRate)';
    804804    else
    805     Time=ones(size(i1_series,1),1)*(0:1/imainfo.FrameRate:(imainfo.NumberOfFrames)/imainfo.FrameRate);
    806     end
    807     %nbfield=imainfo.NumberOfFrames;
     805        Time=ones(size(i1_series,1),1)*(0:1/imainfo.FrameRate:(imainfo.NumberOfFrames)/imainfo.FrameRate);
     806    end
    808807    set(handles.Dt_txt,'String',['Dt=' num2str(1000/imainfo.FrameRate) 'ms']);%display the elementary time interval in millisec
    809808    ColorType='truecolor';
    810809elseif ~isempty(FileExt(2:end))&&(~isempty(imformats(FileExt(2:end))) || isequal(FileExt,'.vol'))%&& isequal(NomType,'*')% multi-frame image
    811     testima=1;
     810%     testima=1;
    812811    if ~isequal(SubDir,'')
    813         RootFile=get(handles.RootFile,'String');
    814812        imainfo=imfinfo([fullfile(RootPath,SubDir,RootFile) FileIndices FileExt]);
    815813    else
     
    817815    end
    818816    ColorType=imainfo.ColorType;%='truecolor' for color images
    819     if length(imainfo) >1 %case of image with multiple frames
    820        % nbfield=length(imainfo);
    821        % nbfield_j=1;
    822     end
    823817end
    824818if isfield(imainfo,'Width') && isfield(imainfo,'Height')
Note: See TracChangeset for help on using the changeset viewer.