- Timestamp:
- Dec 24, 2017, 9:50:18 AM (7 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/find_field_cells.m
r1023 r1024 79 79 end 80 80 end 81 % if ~check_var && ~(isfield(Data,'ListDimName')&& isfield(Data,'DimValue')&& isequal(numel(Data.ListDimName),numel(Data.DimValue)))82 % errormsg=['missing dimension values'];83 % return84 % end85 86 81 87 82 %% role of variables and list of requested operations … … 122 117 % look for variables sharing dimension(s) with ivar_coord_x(icell) 123 118 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 125 120 for ivar=1:nbvar 126 121 check_cell(idim,ivar)=max(strcmp(DimCell{idim},Data.VarDimName{ivar})); -
trunk/src/proj_field.m
r1009 r1024 1113 1113 1114 1114 %% group the variables (fields of 'FieldData') in cells of variables with the same dimensions 1115 1115 1116 [CellInfo,NbDimArray,errormsg]=find_field_cells(FieldData); 1116 1117 … … 1119 1120 return 1120 1121 end 1122 1121 1123 check_grid=zeros(size(CellInfo));% =1 if a grid is needed , =0 otherwise, for each field cell 1122 1123 1124 ProjMode=cell(size(CellInfo)); 1124 1125 for icell=1:numel(CellInfo) 1125 1126 ProjMode{icell}=ObjectData.ProjMode;% projection mode of the plane object 1126 1127 end 1127 1128 icell_grid=[];% field cell index which defines the grid 1128 1129 if ~strcmp(ObjectData.ProjMode,'projection')&& ~strcmp(ObjectData.Type,'plane_z')% TODO:rationalize 1129 1130 %% define the new coordinates in case of interpolation on a imposed grid … … 1154 1155 check_grid(icell)=1; 1155 1156 end 1156 if strcmp(CellInfo{icell}.CoordType,'grid') &&NbDimArray(icell)>=21157 if strcmp(CellInfo{icell}.CoordType,'grid') && NbDimArray(icell)>=2 1157 1158 if ~testangle && isempty(icell_grid)% if the input gridded data is not modified, choose the first one in case of multiple gridded field cells 1158 1159 icell_grid=icell; -
trunk/src/read_field.m
r1022 r1024 294 294 Field.AName='image'; 295 295 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'; 296 299 if ndims(A)==3 297 300 if Npz==1;%color -
trunk/src/sub_field.m
r985 r1024 136 136 for ilist=1:numel(Field_1.VarAttribute) 137 137 % 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. 139 139 OldDimName=Field_1.VarDimName{ilist}; 140 140 if ischar(OldDimName), OldDimName={OldDimName}; end% transform char string to cell if relevant -
trunk/src/uvmat.m
r1023 r1024 3333 3333 end 3334 3334 case {'video','mmreader','rdvision','cine_phantom'} 3335 FieldName='image'; 3335 3336 ParamIn=UvData.MovieObject{1}; % movie object 3336 3337 if strcmp(NomType,'*') … … 3340 3341 end 3341 3342 case 'multimage' 3343 FieldName='image'; 3342 3344 if ~strcmp(NomType,'*') 3343 3345 MaxIndex_j_cell=get(handles.MaxIndex_j,'String'); … … 3365 3367 return 3366 3368 end 3369 case 'image' 3370 FieldName='image'; 3367 3371 end 3368 3372 if isstruct (ParamIn) … … 3372 3376 ParamIn.Coord_y=get(handles.Coord_y,'String'); 3373 3377 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'); 3375 3379 TimeName=get(handles.TimeName,'String'); 3376 3380 r=regexp(TimeName,'^(?<type>(dim:)|(var:))','names');%look for 'var:' or 'dim:' at the beginning of time name … … 3421 3425 FieldName_1=FieldName;% if blank reproduce the field name of the first field 3422 3426 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') 3424 3428 list_code=get(handles.ColorCode,'String');% list menu fields 3425 3429 index_code=get(handles.ColorCode,'Value');% selected string index … … 3596 3600 TimeUnit=''; 3597 3601 end 3598 elseif ~isempty(regexp(TimeName,'^var:' ))3602 elseif ~isempty(regexp(TimeName,'^var:', 'once')) 3599 3603 abstime=Field{1}.(TimeName(5:end));%the time is a variale selected by get_file 3600 3604 % TODO: look for time unit attribute … … 4449 4453 if isfield(GetFieldData,'Coordinates') 4450 4454 XName=GetFieldData.Coordinates.Coord_x; 4451 set(handles.SwitchCoordIndex,'String','var'); % variable used as coordinate4452 else4453 set(handles.SwitchCoordIndex,'String','dim'); % matrix index used a coordinate4455 % set(handles.SwitchCoordIndex,'String','var'); % variable used as coordinate 4456 % else 4457 % set(handles.SwitchCoordIndex,'String','dim'); % matrix index used a coordinate 4454 4458 end 4455 4459 TimeNameStr=GetFieldData.Time.SwitchVarIndexTime;
Note: See TracChangeset
for help on using the changeset viewer.