- Timestamp:
- Dec 22, 2010, 5:12:31 PM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/check_field_structure.m
r140 r158 50 50 nbdim=0; 51 51 Data.ListDimName={}; 52 53 %% main loop on the list of variables 52 54 for ivar=1:nbfield 53 55 VarName=Data.ListVarName{ivar}; … … 64 66 return 65 67 end 66 nbcoord=numel(sizvar);%nbre of coordiantes for variable named VarName 68 nbcoord=numel(sizvar);%nbre of coordinates for variable named VarName 69 testrange=0; 67 70 if numel(DimCell)==0 68 71 errormsg=['empty declared dimension .VarDimName{' num2str(ivar) '} for ' VarName]; … … 79 82 return 80 83 end 84 if sizvar(1)==2 && isequal(VarName,DimCell{1}) 85 testrange=1;% test for a dimension variable representing a range 86 end 81 87 else 82 88 errormsg=['1 dimension declared in .VarDimName{' num2str(ivar) '} inconsistent with the nbre of dimensions =' num2str(nbcoord) ' of the variable ' VarName]; … … 85 91 else 86 92 if numel(DimCell)>nbcoord 87 DimCell=DimCell(end-nbcoord+1:end);%first singleton diem nsions omitted,93 DimCell=DimCell(end-nbcoord+1:end);%first singleton diemensions omitted, 88 94 elseif nbcoord > numel(DimCell) 89 95 errormsg=['nbre of declared dimensions in .VarDimName{' num2str(ivar) '} smaller than the nbre of dimensions =' num2str(nbcoord) ' of the variable ' VarName]; … … 97 103 if isempty(iprev)% append the dimension name to the current list 98 104 nbdim=nbdim+1; 105 RangeTest(nbdim)=0; %default 99 106 if sizvar(idim)==2 && strcmp(DimName,VarName)%case of a coordinate defined by the two end values (regular spacing) 100 107 RangeTest(nbdim)=1; %to be updated for a later variable … … 105 112 else % DimName is detected in the current list of dimension names 106 113 if ~isequal(Data.DimValue(iprev),sizvar(idim)) 114 RangeTest(iprev) 115 Data.DimValue(iprev) 107 116 if isequal(Data.DimValue(iprev),2)&& RangeTest(iprev) % the dimension has been already detected as a range [min max] 108 117 Data.DimValue(iprev)=sizvar(idim); %update with actual value 109 else 118 elseif ~testrange 110 119 errormsg=['dimension declaration inconsistent with the size =[' num2str(sizvar) '] for ' VarName]; 111 120 return -
trunk/src/geometry_calib.m
r156 r158 1181 1181 Data.AY=[npxy(1)-0.5 0.5]; 1182 1182 Data.AX=[0.5 npxy(2)]; 1183 Data.Coord Type='px';1183 Data.CoordUnit='pixel'; 1184 1184 Calib.GeometryCalib=GeometryCalib; 1185 1185 DataOut=phys(Data,Calib); -
trunk/src/mouse_motion.m
r156 r158 172 172 end 173 173 %coordinate transform if proj_coord differs from menu_coord A REVOIR 174 if isfield(Field,'CoordType')175 mouse.CoordType=Field.CoordType;176 end177 174 if isfield(Field,'CoordUnit') 178 175 mouse.CoordUnit=Field.CoordUnit; 179 176 end 180 if isfield(mouse,'CoordType') 181 if isequal(mouse.CoordType,'px') 182 mouse.CoordUnit='px'; 183 end 184 else 185 mouse.CoordUnit='';%default 186 end 177 % if isfield(Field,'CoordUnit') 178 % mouse.CoordUnit=Field.CoordUnit; 179 % end 180 % if isfield(mouse,'CoordType') 181 % if isequal(mouse.CoordType,'px') 182 % mouse.CoordUnit='px'; 183 % end 184 % else 185 % mouse.CoordUnit='';%default 186 % end 187 187 if test_piv 188 188 par=civ('read_param_civ1',hhciv); -
trunk/src/proj_field.m
r156 r158 87 87 end 88 88 %introduce default field properties (reading old standards) 89 if ~isfield(ObjectData,'Style')||~isfield(ObjectData,' Coord')||~isfield(ObjectData,'ProjMode')89 if ~isfield(ObjectData,'Style')||~isfield(ObjectData,'ProjMode') 90 90 ProjData=FieldData; 91 91 return 92 92 end 93 93 if ~isfield(ObjectData,'Coord') 94 if strcmp(ObjectData.Style,'plane') 95 ObjectData.Coord=[0 0 0];%default 96 else 97 ProjData=FieldData; 98 return 99 end 100 end 101 94 102 % OBSOLETE 95 103 if isfield(ObjectData,'XMax') && ~isempty(ObjectData.XMax) … … 112 120 end 113 121 %%%%%%%%%% 114 115 % FieldData=document_field(FieldData);%transform FieldData to the standard format116 % if ~isfield(FieldData,'VarAttribute')117 % FieldData.VarAttribute={};118 % end119 122 switch ObjectData.Style 120 123 case 'points' … … 138 141 [ProjData,errormsg] = proj_volume(FieldData,ObjectData); 139 142 end 140 % if exist('IndexObj','var') 141 % ProjData.IndexObj=IndexObj;%transfer object index 142 % end 143 143 144 144 145 %----------------------------------------------------------------- … … 1004 1005 1005 1006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1006 % group the variables (fields of 'FieldData') in cells of variables with the same dimensions1007 %% group the variables (fields of 'FieldData') in cells of variables with the same dimensions 1007 1008 %----------------------------------------------------------------- 1008 1009 idimvar=0; … … 1012 1013 return 1013 1014 end 1014 %LOOP ON GROUPS OF VARIABLES SHARING THE SAME DIMENSIONS 1015 1016 % LOOP ON GROUPS OF VARIABLES SHARING THE SAME DIMENSIONS 1015 1017 % CellVarIndex=cells of variable index arrays 1016 1018 ivar_new=0; % index of the current variable in the projected field … … 1036 1038 ivar_FF=VarType.errorflag; 1037 1039 testX=~isempty(ivar_X) && ~isempty(ivar_Y); 1038 %DimIndices=FieldData.VarDimIndex{VarIndex(1)};%indices of the dimensions of the first variable (common to all variables in the cell)1039 1040 DimCell=FieldData.VarDimName{VarIndex(1)}; 1040 1041 if ischar(DimCell) … … 1042 1043 end 1043 1044 1044 % case of input fields with unstructured coordinates1045 %% case of input fields with unstructured coordinates 1045 1046 if testX 1046 1047 XName=FieldData.ListVarName{ivar_X}; … … 1066 1067 indcut=find(abs(fieldZ) <= width); 1067 1068 for ivar=VarIndex 1068 VarName=FieldData.ListVarName{ivar}; 1069 % eval(['size(FieldData.' VarName ')']) 1070 eval(['FieldData.' VarName '=FieldData.' VarName '(indcut);']) 1071 % end 1069 VarName=FieldData.ListVarName{ivar}; 1070 eval(['FieldData.' VarName '=FieldData.' VarName '(indcut);']) 1072 1071 % A VOIR : CAS DE VAR STRUCTUREE MAIS PAS GRILLE REGULIERE : INTERPOLER SUR GRILLE REGULIERE 1073 1072 end … … 1217 1216 end 1218 1217 end 1219 %case of input fields defined on a structured grid 1218 1219 %% case of input fields defined on a structured grid 1220 1220 else 1221 1221 AYName=FieldData.ListVarName{VarType.coord(1)};%name of input x coordinate (name preserved on projection) … … 1256 1256 DCoord_max=max(DCoord); 1257 1257 % test_direct(idim)=DCoord_max>0;% =1 for increasing values, 0 otherwise 1258 if ~isequal(DCoord_max,DCoord_min(idim)>0)1258 if abs(DCoord_max-DCoord_min(idim))>abs(DCoord_max/1000) 1259 1259 msgbox_uvmat('ERROR',['non monotonic dimension variable # ' num2str(idim) ' in proj_field.m']) 1260 1260 return … … 1367 1367 ProjData.ListVarName=[ProjData.ListVarName VarName]; 1368 1368 ProjData.VarDimName=[ProjData.VarDimName {DimCell}]; 1369 if length(FieldData.VarAttribute)>=ivar1369 if isfield(FieldData,'VarAttribute') && length(FieldData.VarAttribute)>=ivar 1370 1370 ProjData.VarAttribute{length(ProjData.ListVarName)}=FieldData.VarAttribute{ivar}; 1371 1371 end 1372 1372 eval(['ProjData.' VarName '=FieldData.' VarName '(min_ind1:max_ind1,min_ind2:max_ind2) ;']); 1373 end 1373 end 1374 eval(['ProjData.' AYName '=FieldData.' AYName ';']) %record the new (projected ) y coordinates 1375 eval(['ProjData.' AXName '=FieldData.' AXName ';']) %record the new (projected ) x coordinates 1374 1376 else % case with rotation and/or interpolation 1375 1377 if isempty(Coord_z) %2D case … … 1452 1454 end 1453 1455 end 1454 %projection of velocity components in the rotated coordinates 1456 1457 %% projection of velocity components in the rotated coordinates 1455 1458 if ~isequal(Phi,0) && length(ivar_U)==1 1456 1459 if isempty(ivar_V) … … 2082 2085 end 2083 2086 end 2084 if isfield(FieldData,'Coord Type')2085 if isfield(ObjectData,'Coord Type')&~isequal(FieldData.CoordType,ObjectData.CoordType)2086 errormsg=[ObjectData.Style ' in ' ObjectData.Coord Type ' coordinates, while field in ' FieldData.CoordType ' coordinates'];2087 if isfield(FieldData,'CoordUnit') 2088 if isfield(ObjectData,'CoordUnit')&~isequal(FieldData.CoordUnit,ObjectData.CoordUnit) 2089 errormsg=[ObjectData.Style ' in ' ObjectData.CoordUnit ' coordinates, while field in ' FieldData.CoordUnit ]; 2087 2090 return 2088 2091 else 2089 ProjData.Coord Type=FieldData.CoordType;2092 ProjData.CoordUnit=FieldData.CoordUnit; 2090 2093 end 2091 2094 end -
trunk/src/read_civxdata.m
r156 r158 154 154 end 155 155 end 156 Field.CoordType='px';% TODO: abandon, use COORdUnit instead ? (to adapt 'px' and 'phys')156 %Field.CoordType='px';% TODO: abandon, use COORdUnit instead ? (to adapt 'px' and 'phys') 157 157 Field.CoordUnit='pixel'; 158 158 -
trunk/src/read_set_object.m
r77 r158 22 22 value=get(handles.ProjMode,'Value'); 23 23 data.ProjMode=menu{value}; 24 menu=get(handles.MenuCoord,'String');25 value=get(handles.MenuCoord,'Value');26 data.Coord Type=menu{value};24 % menu=get(handles.CoordUnit,'String'); 25 % value=get(handles.MenuCoord,'Value'); 26 data.CoordUnit=get(handles.CoordUnit,'String'); 27 27 testcalib=0; 28 28 else %default … … 33 33 %Euler angles and projection ranges 34 34 if ~testcalib 35 35 if isequal(get(handles.Phi,'Visible'),'on') 36 36 data.Phi=str2num(get(handles.Phi,'String')); 37 38 37 end 38 if isequal(get(handles.Theta,'Visible'),'on') 39 39 data.Theta=str2num(get(handles.Theta,'String')); 40 41 40 end 41 if isequal(get(handles.Psi,'Visible'),'on') 42 42 data.Psi=str2num(get(handles.Psi,'String')); 43 end 44 43 end 44 if isequal(get(handles.DX,'Visible'),'on') 45 45 data.DX=str2num(get(handles.DX,'String')); 46 47 46 end 47 if isequal(get(handles.DY,'Visible'),'on') 48 48 data.DY=str2num(get(handles.DY,'String')); 49 50 49 end 50 if isequal(get(handles.DZ,'Visible'),'on') 51 51 data.DZ=str2num(get(handles.DZ,'String')); 52 52 end … … 55 55 ZMin=str2num(get(handles.ZMin,'String')); 56 56 if ~isempty(ZMin) 57 data.RangeZ(1)=ZMin;58 dimrange=[2 3];57 data.RangeZ(1)=ZMin; 58 dimrange=[2 3]; 59 59 end 60 60 end 61 62 ZMax=str2 num(get(handles.ZMax,'String'));63 if is empty(ZMax)61 if isequal(get(handles.ZMax,'Visible'),'on') 62 ZMax=str2double(get(handles.ZMax,'String')); 63 if isnan(ZMax) 64 64 if dimrange(1)>1 65 % set(handles.ZMax,'String',get(handles.ZMin,'String'))66 65 data.RangeZ(1)=ZMax; 67 66 end 68 else 69 data.RangeZ(2)=ZMax;70 dimrange=[dimrange(1) 3];67 else 68 data.RangeZ(2)=ZMax; 69 dimrange=[dimrange(1) 3]; 71 70 end 72 71 end 73 72 if isequal(get(handles.YMin,'Visible'),'on') 74 YMin=str2num(get(handles.YMin,'String')); 75 if isempty(YMin) 76 % if dimrange(2)>2 77 % % set(handles.YMin,'String','0') 78 % data.RangeY(2)=0; 79 % end 80 else 73 YMin=str2double(get(handles.YMin,'String')); 74 if ~isnan(YMin) 81 75 data.RangeY(2)=YMin; 82 76 dimrange=[2 max(dimrange(2),2)]; … … 84 78 end 85 79 if isequal(get(handles.YMax,'Visible'),'on') 86 % data.YMax=str2num(get(handles.YMax,'String')); 87 YMax=str2num(get(handles.YMax,'String')); 88 if isempty(YMax) 89 % if dimrange(1)>1 90 % % set(handles.YMax,'String',get(handles.YMin,'String')) 91 % if ~isempty(YMin) 92 % data.RangeY(1)=YMin; 93 % end 94 % elseif dimrange(2)>2 95 % % set(handles.YMax,'String',get(handles.ZMin,'String')) 96 % data.RangeY(2)=ZMin; 97 % end 98 else 80 YMax=str2double(get(handles.YMax,'String')); 81 if ~isnan(YMax) 99 82 data.RangeY(1)=YMax; 100 83 dimrange=[dimrange(1) max(dimrange(2),2)]; … … 102 85 end 103 86 if isequal(get(handles.XMin,'Visible'),'on') 104 XMin=str2num(get(handles.XMin,'String')); 105 if isempty(XMin) 106 % if ~isempty(YMin) 107 % if dimrange(2)>1 108 % % set(handles.XMin,'String',get(handles.YMin,'String')) 109 % data.RangeX(2)=YMin; 110 % XMin=YMin; 111 % end 112 % end 113 else 87 XMin=str2double(get(handles.XMin,'String')); 88 if ~isnan(XMin) 114 89 data.RangeX(2)=XMin; 115 %dimrange=[2 max(dimrange(2),1)];116 90 end 117 end 118 if isequal(get(handles.XMax,'Visible'),'on') 119 XMax=str2num(get(handles.XMax,'String')); 120 if isempty(XMax) 121 % if dimrange(1)>1 122 % % set(handles.XMax,'String',get(handles.XMin,'String')) 123 % if ~isempty(XMin) 124 % data.RangeX(2)=XMin; 125 % end 126 % elseif dimrange(2)>1 127 % % set(handles.XMax,'String',get(handles.YMax,'String')) 128 % data.RangeX(1)=YMax; 129 % end 130 else 91 end 92 if isequal(get(handles.XMax,'Visible'),'on') 93 XMax=str2double(get(handles.XMax,'String')); 94 if ~isnan(XMax) 131 95 data.RangeX(1)=XMax; 132 96 end 133 97 end 134 98 end -
trunk/src/series.m
r156 r158 2092 2092 transform_menu=get(handles.transform_fct,'String'); 2093 2093 ichoice=get(handles.transform_fct,'Value'); 2094 if isequal(transform_menu{ichoice},'px');2095 data.CoordType='px';2096 else2097 data.CoordType='phys';2098 end2094 % if isequal(transform_menu{ichoice},'px'); 2095 % data.CoordType='px'; 2096 % else 2097 % data.CoordType='phys'; 2098 % end 2099 2099 data.desable_plot=1; 2100 2100 [SeriesData.hset_object,SeriesData.sethandles]=set_object(data);% call the set_object interface -
trunk/src/series/aver_stat.m
r128 r158 342 342 Data{iview}.AX=[0.5 npx-0.5]; 343 343 Data{iview}.A=double(A); 344 Data{iview}.Coord Type='px';344 Data{iview}.CoordUnit='pixel'; 345 345 elseif testcivx 346 346 [Data{iview},VelTypeOut]=read_civxdata(filename,FieldName,VelType); -
trunk/src/series/merge_proj.m
r128 r158 278 278 Field{iview}.AX=[0.5 npxy(2)-0.5]; % coordinates of the first and last pixel centers 279 279 Field{iview}.AY=[npxy(1)-0.5 0.5]; 280 Field{iview}.Coord Type='px';280 Field{iview}.CoordUnit='pixel'; 281 281 Field{iview}.AName='image'; 282 282 timeread(iview)=0; -
trunk/src/series/time_series.m
r128 r158 349 349 Data{iview}.AX=[0.5 npx-0.5]; 350 350 Data{iview}.A=double(A); 351 Data{iview}.Coord Type='px';351 Data{iview}.CoordUnit='pixel'; 352 352 elseif testcivx 353 353 [Data{iview},VelTypeOut]=read_civxdata(filename,FieldName,VelType); -
trunk/src/set_object.m
r156 r158 84 84 end 85 85 set(hObject,'KeyPressFcn',{'keyboard_callback',handles})%set keyboard action function (allow action on uvmat when set_object is in front) 86 set(handles.MenuCoord,'ListboxTop',1)86 %set(handles.MenuCoord,'ListboxTop',1) 87 87 % if ~exist('PlotHandles','var') 88 88 % PlotHandles=[]; … … 241 241 set(handles.DZ,'String',data.DZ) 242 242 end 243 if isfield(data,'CoordType')&& isequal(data.CoordType,'px') 244 % if isequal(data.CoordType,'phys') 245 % set(handles.MenuCoord,'Value',1) 246 % elseif isequal(data.CoordType,'px') 247 set(handles.MenuCoord,'Value',2) 248 % end 249 end 243 if isfield(data,'CoordUnit') 244 set(handles.CoordUnit,'String',data.CoordUnit) 245 end 246 % if isfield(data,'CoordType')&& isequal(data.CoordType,'px') 247 % % if isequal(data.CoordType,'phys') 248 % % set(handles.MenuCoord,'Value',1) 249 % % elseif isequal(data.CoordType,'px') 250 % set(handles.MenuCoord,'Value',2) 251 % % end 252 % end 250 253 end 251 254 if enable_plot … … 582 585 583 586 ProjMode_Callback(hObject, eventdata, handles);%visualize the appropriate edit boxes 584 if isfield(s,'CoordType')585 if isequal(s.CoordType,'phys')586 set(handles.MenuCoord,'Value',1)587 elseif isequal(s.CoordType,'px')588 set(handles.MenuCoord,'Value',2)589 else590 warndlg('unknown CoordType (px or phys) in set_object.m')591 end592 end587 % if isfield(s,'CoordType') 588 % if isequal(s.CoordType,'phys') 589 % set(handles.MenuCoord,'Value',1) 590 % elseif isequal(s.CoordType,'px') 591 % set(handles.MenuCoord,'Value',2) 592 % else 593 % warndlg('unknown CoordType (px or phys) in set_object.m') 594 % end 595 % end 593 596 if isfield(s,'XMax') 594 597 set(handles.XMax,'String',s.XMax) … … 873 876 ObjectName=get(handles.TITLE,'String'); 874 877 if ~isempty(ObjectName)&&~strcmp(ObjectName,'') 875 def={fullfile(dir_save,[ObjectName Object.CoordType'.xml'])};878 def={fullfile(dir_save,[ObjectName '.xml'])}; 876 879 else 877 def={fullfile(dir_save,[Object.Style Object.CoordType'.xml'])};880 def={fullfile(dir_save,[Object.Style '.xml'])}; 878 881 end 879 882 options.Resize='on'; -
trunk/src/transform_field/phys.m
r157 r158 99 99 100 100 DataOut=Data;%default 101 DataOut.Coord Type='phys'; %put flag for physical coordinates101 DataOut.CoordUnit=Calib.CoordUnit; %put flag for physical coordinates 102 102 if isfield(Calib,'SliceCoord') 103 103 DataOut.PlaneCoord=Calib.SliceCoord;%to generalise for any plane 104 104 end 105 105 % The transform ACTS ONLY IF .CoordType='px'and Calib defined 106 if isfield(Data,'Coord Type')&& isequal(Data.CoordType,'px')&& ~isempty(Calib)106 if isfield(Data,'CoordUnit')%&& isequal(Data.CoordType,'px')&& ~isempty(Calib) 107 107 if isfield(Calib,'CoordUnit') 108 108 DataOut.CoordUnit=Calib.CoordUnit; -
trunk/src/uvmat.m
r155 r158 1528 1528 end 1529 1529 end 1530 % if mdetect==01531 % msgbox_uvmat('ERROR','no mask file detected (format ..._xxmask_ii.png needed), use the menu bar Tools/Make mask')1532 % set(handles.mask_test,'Value',0)1533 % return1534 % end1535 1530 end 1536 1531 errormsg=[];%default … … 1610 1605 Mask.AX=[0.5 npxy(2)-0.5]; 1611 1606 Mask.AY=[npxy(1)-0.5 0.5 ]; 1612 Mask.Coord Type='px';1607 Mask.CoordUnit='pixel'; 1613 1608 if isequal(get(handles.slices,'Value'),1) 1614 1609 NbSlice=str2num(get(handles.nb_slice,'String')); … … 1944 1939 Field_b.ZIndex=mod(num_i2-1,nbslice)+1; 1945 1940 end 1946 Field_b.Coord Type='px';1941 Field_b.CoordUnit='pixel'; 1947 1942 %determine the input file type 1948 1943 if (test_1 && isfield(UvData,'MovieObject_1'))||(~test_1 && isfield(UvData,'MovieObject')) … … 2243 2238 Field{1}.AX=Rangx; 2244 2239 Field{1}.A=A; 2245 Field{1}.CoordType='px'; %used for mouse_motion2240 % Field{1}.CoordType='px'; %used for mouse_motion 2246 2241 Field{1}.CoordUnit='pixel'; %used for mouse_motion 2247 2242 end … … 2490 2485 UvData.ZMax=0; 2491 2486 UvData.ZMin=0;%default 2492 UvData.Mesh=1; %default2487 %UvData.Mesh=1; %default 2493 2488 [UvData.Field,errormsg]=check_field_structure(UvData.Field); 2494 2489 if ~isempty(errormsg) … … 2542 2537 end 2543 2538 if test_z 2544 UvData.Mesh=((UvData.XMax-UvData.XMin)*(UvData.YMax-UvData.YMin)*(UvData.ZMax-UvData.ZMin))/nbvec;% volume per vector2545 UvData.Mesh=(UvData.Mesh)^(1/3);2539 Field.Mesh=((UvData.XMax-UvData.XMin)*(UvData.YMax-UvData.YMin)*(UvData.ZMax-UvData.ZMin))/nbvec;% volume per vector 2540 Field.Mesh=(Field.Mesh)^(1/3); 2546 2541 else 2547 UvData.Mesh=sqrt((UvData.XMax-UvData.XMin)*(UvData.YMax-UvData.YMin)/nbvec);%2D2542 Field.Mesh=sqrt((UvData.XMax-UvData.XMin)*(UvData.YMax-UvData.YMin)/nbvec);%2D 2548 2543 end 2549 2544 end 2550 2545 2551 2546 %case of structured coordinates 2547 'TESTfield' 2548 UvData.Field 2552 2549 if isfield(UvData.Field,'AX') && isfield(UvData.Field,'AY')&& isfield(UvData.Field,'A') 2553 2550 UvData.XMax=max(UvData.Field.AX); … … 2556 2553 UvData.YMin=min(UvData.Field.AY); 2557 2554 np_A=size(UvData.Field.A); 2558 UvData.Mesh=sqrt((UvData.XMax-UvData.XMin)*(UvData.YMax-UvData.YMin)/((np_A(1)-1) * (np_A(2)-1))) ;2555 Field.Mesh=sqrt((UvData.XMax-UvData.XMin)*(UvData.YMax-UvData.YMin)/((np_A(1)-1) * (np_A(2)-1))) ; 2559 2556 end 2560 2557 if isempty(coord_x) && ~isempty(CellVarIndex) … … 2582 2579 end 2583 2580 end 2584 UvData.Mesh=(UvData.ZMax-UvData.ZMin)/(nbpoints-1);2581 Field.Mesh=(UvData.ZMax-UvData.ZMin)/(nbpoints-1); 2585 2582 elseif NbDim==2 2586 2583 nbpoints_y=UvData.Field.DimValue(DimIndex(1)); … … 2612 2609 end 2613 2610 DX=(UvData.XMax-UvData.XMin)/(nbpoints_x-1); 2614 UvData.Mesh= sqrt(DX*DY);2611 Field.Mesh= sqrt(DX*DY); 2615 2612 end 2616 2613 end … … 2628 2625 if NbDim==3 && UvData.NewSeries 2629 2626 UvData.Object{1}.NbDim=UvData.NbDim;%test for 3D objects 2630 UvData.Object{1}.RangeZ= UvData.Mesh;%main plotting plane2627 UvData.Object{1}.RangeZ=Field.Mesh;%main plotting plane 2631 2628 UvData.Object{1}.Coord(1,3)=(UvData.ZMin+UvData.ZMax)/2;%section at a middle plane chosen 2632 2629 UvData.Object{1}.Phi=0; … … 2754 2751 [PlotType,PlotParamOut]=plot_field(ObjectData,haxes(imap),PlotParam{imap},keeplim(imap),PosColorbar{imap}); 2755 2752 write_plot_param(plot_handles{imap},PlotParamOut) %update the auto plot parameters 2756 if isfield( UvData,'Mesh')&&~isempty(UvData.Mesh)2757 ObjectData.Mesh= UvData.Mesh; % gives an estimated mesh size (useful for mouse action on the plot)2753 if isfield(Field,'Mesh')&&~isempty(Field.Mesh) 2754 ObjectData.Mesh=Field.Mesh; % gives an estimated mesh size (useful for mouse action on the plot) 2758 2755 end 2759 2756 if imap==1 … … 5063 5060 transform_list=get(handles.transform_fct,'String'); 5064 5061 val=get(handles.transform_fct,'Value'); 5065 data.CoordType=transform_list{val}; 5066 % if isfield(UvData,'CoordType') 5067 % data.CoordType=UvData.CoordType; 5068 % end 5069 if isfield(UvData,'Mesh')&&~isempty(UvData.Mesh) 5070 data.RangeX=UvData.Mesh; 5071 data.RangeY=UvData.Mesh; 5072 data.DX=UvData.Mesh; 5073 data.DY=UvData.Mesh; 5074 elseif isfield(UvData.Field,'AX')&& isfield(UvData.Field,'AY')&& isfield(UvData.Field,'A')%only image 5075 np=size(UvData.Field.A); 5076 meshx=(UvData.Field.AX(end)-UvData.Field.AX(1))/np(2); 5077 meshy=abs(UvData.Field.AY(end)-UvData.Field.AY(1))/np(1); 5078 data.RangeY=max(meshx,meshy); 5079 data.RangeX=max(meshx,meshy); 5080 data.DX=max(meshx,meshy); 5081 end 5082 if isfield(UvData,'NbDim') 5083 data.NbDim=UvData.NbDim; 5062 %data.CoordType=transform_list{val}; 5063 if isfield(UvData,'Field') 5064 Field=UvData.Field; 5065 if isfield(Field,'Mesh')&&~isempty(Field.Mesh) 5066 data.RangeX=Field.Mesh; 5067 data.RangeY=Field.Mesh; 5068 data.DX=Field.Mesh; 5069 data.DY=Field.Mesh; 5070 elseif isfield(Field,'AX')&& isfield(Field,'AY')&& isfield(Field,'A')%only image 5071 np=size(Field.A); 5072 meshx=(Field.AX(end)-Field.AX(1))/np(2); 5073 meshy=abs(Field.AY(end)-Field.AY(1))/np(1); 5074 data.RangeY=max(meshx,meshy); 5075 data.RangeX=max(meshx,meshy); 5076 data.DX=max(meshx,meshy); 5077 end 5078 if isfield(Field,'NbDim') 5079 data.NbDim=Field.NbDim; 5080 end 5081 if isfield(Field,'CoordUnit') 5082 data.CoordUnit=Field.CoordUnit; 5083 end 5084 5084 end 5085 5085 data.Coord=[0 0 0]; %default … … 5091 5091 end 5092 5092 end 5093 %data.ParentButton=handles.create;5094 5093 if ishandle(handles.UVMAT_title) 5095 5094 delete(handles.UVMAT_title)%delete the initial display of uvmat if no field has been entered … … 5098 5097 set_object(data,PlotHandles);% call the set_object interface 5099 5098 set(handles.MenuObject,'checked','on') 5100 %UvData.MouseAction='create_object';5101 5099 set(handles.uvmat,'UserData',UvData) 5102 5100 set(handles.zoom,'Value',0) -
trunk/src/view_field.m
r156 r158 145 145 Mask.AX=[0.5 npxy(2)-0.5]; 146 146 Mask.AY=[npxy(1)-0.5 0.5 ]; 147 Mask.Coord Type='px';147 Mask.CoordUnit='pixel'; 148 148 if isequal(get(handles.slices,'Value'),1) 149 149 NbSlice=str2num(get(handles.nb_slice,'String'));
Note: See TracChangeset
for help on using the changeset viewer.