Changeset 1024 for trunk/src


Ignore:
Timestamp:
Dec 24, 2017, 9:50:18 AM (7 years ago)
Author:
sommeria
Message:

pb for reading images repaired

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_field_cells.m

    r1023 r1024  
    7979    end
    8080end
    81 % if ~check_var &&  ~(isfield(Data,'ListDimName')&& isfield(Data,'DimValue')&& isequal(numel(Data.ListDimName),numel(Data.DimValue)))
    82 %     errormsg=['missing dimension values'];
    83 %     return
    84 % end
    85 
    8681
    8782%% role of variables and list of requested operations
     
    122117    % look for variables sharing dimension(s) with ivar_coord_x(icell)
    123118    check_cell=zeros(numel(DimCell),nbvar);
    124     for idim=1:numel(DimCell)
     119    for idim=1:numel(DimCell);% for each variable with role coord_x, look at which other variables contain the same dimension
    125120        for ivar=1:nbvar
    126121            check_cell(idim,ivar)=max(strcmp(DimCell{idim},Data.VarDimName{ivar}));
  • trunk/src/proj_field.m

    r1009 r1024  
    11131113
    11141114%% group the variables (fields of 'FieldData') in cells of variables with the same dimensions
     1115
    11151116[CellInfo,NbDimArray,errormsg]=find_field_cells(FieldData);
    11161117
     
    11191120    return
    11201121end
     1122
    11211123check_grid=zeros(size(CellInfo));% =1 if a grid is needed , =0 otherwise, for each field cell
    1122 
    11231124ProjMode=cell(size(CellInfo));
    11241125for icell=1:numel(CellInfo)
    11251126    ProjMode{icell}=ObjectData.ProjMode;% projection mode of the plane object
    11261127end
    1127     icell_grid=[];% field cell index which defines the grid
     1128icell_grid=[];% field cell index which defines the grid
    11281129if ~strcmp(ObjectData.ProjMode,'projection')&& ~strcmp(ObjectData.Type,'plane_z')% TODO:rationalize
    11291130    %% define the new coordinates in case of interpolation on a imposed grid
     
    11541155            check_grid(icell)=1;
    11551156        end
    1156         if strcmp(CellInfo{icell}.CoordType,'grid')&&NbDimArray(icell)>=2
     1157        if strcmp(CellInfo{icell}.CoordType,'grid') && NbDimArray(icell)>=2
    11571158            if ~testangle && isempty(icell_grid)% if the input gridded data is not modified, choose the first one in case of multiple gridded field cells
    11581159                icell_grid=icell;
  • trunk/src/read_field.m

    r1022 r1024  
    294294    Field.AName='image';
    295295    Field.ListVarName={'Coord_y','Coord_x','A'}; %
     296    Field.VarAttribute{1}.Unit='pixel';
     297    Field.VarAttribute{2}.Unit='pixel';
     298    Field.VarAttribute{3}.Role='scalar';
    296299    if ndims(A)==3
    297300        if Npz==1;%color
  • trunk/src/sub_field.m

    r985 r1024  
    136136for ilist=1:numel(Field_1.VarAttribute)
    137137    % case of variable with a single dimension
    138     if ~isempty(Field_1.VarAttribute{ilist}) && ~isempty(regexp(Field_1.VarAttribute{ilist}.Role,'^coord'))% if variable with Role coord... is found.
     138    if ~isempty(Field_1.VarAttribute{ilist}) && isfield(Field_1.VarAttribute{ilist},'Role')&&~isempty(regexp(Field_1.VarAttribute{ilist}.Role,'^coord'))% if variable with Role coord... is found.
    139139        OldDimName=Field_1.VarDimName{ilist};
    140140        if ischar(OldDimName), OldDimName={OldDimName}; end% transform char string to cell if relevant
  • trunk/src/uvmat.m

    r1023 r1024  
    33333333        end
    33343334    case {'video','mmreader','rdvision','cine_phantom'}
     3335        FieldName='image';
    33353336        ParamIn=UvData.MovieObject{1}; % movie object
    33363337        if strcmp(NomType,'*')
     
    33403341        end
    33413342    case 'multimage'
     3343        FieldName='image';
    33423344        if ~strcmp(NomType,'*')
    33433345            MaxIndex_j_cell=get(handles.MaxIndex_j,'String');
     
    33653367            return
    33663368        end
     3369    case 'image'
     3370        FieldName='image';     
    33673371end
    33683372if isstruct (ParamIn)
     
    33723376    ParamIn.Coord_y=get(handles.Coord_y,'String');
    33733377    ParamIn.Coord_z=get(handles.Coord_z,'String');
    3374     ParamIn.CheckCoordIndex=strcmp(get(handles.SwitchCoordIndex,'String'),'dim');
     3378    %ParamIn.CheckCoordIndex=strcmp(get(handles.SwitchCoordIndex,'String'),'dim');
    33753379    TimeName=get(handles.TimeName,'String');
    33763380    r=regexp(TimeName,'^(?<type>(dim:)|(var:))','names');%look for 'var:' or 'dim:' at the beginning of time name
     
    34213425                FieldName_1=FieldName;% if blank reproduce the field name of the first field
    34223426            end
    3423             if ~isempty(regexp(FieldName_1,'^vel'))&& strcmp(get(handles.ColorCode,'Visible'),'on')
     3427            if ~isempty(regexp(FieldName_1,'^vel', 'once'))&& strcmp(get(handles.ColorCode,'Visible'),'on')
    34243428                list_code=get(handles.ColorCode,'String');% list menu fields
    34253429                index_code=get(handles.ColorCode,'Value');% selected string index
     
    35963600            TimeUnit='';
    35973601        end
    3598     elseif  ~isempty(regexp(TimeName,'^var:'))
     3602    elseif  ~isempty(regexp(TimeName,'^var:', 'once'))
    35993603        abstime=Field{1}.(TimeName(5:end));%the time is a variale selected by get_file
    36003604        % TODO: look for time unit attribute
     
    44494453            if isfield(GetFieldData,'Coordinates')
    44504454                XName=GetFieldData.Coordinates.Coord_x;
    4451                 set(handles.SwitchCoordIndex,'String','var'); % variable used as coordinate
    4452             else
    4453                 set(handles.SwitchCoordIndex,'String','dim'); % matrix index used a coordinate
     4455%                set(handles.SwitchCoordIndex,'String','var'); % variable used as coordinate
     4456%             else
     4457%                 set(handles.SwitchCoordIndex,'String','dim'); % matrix index used a coordinate
    44544458            end
    44554459            TimeNameStr=GetFieldData.Time.SwitchVarIndexTime;
Note: See TracChangeset for help on using the changeset viewer.