Changeset 207
- Timestamp:
- Feb 27, 2011, 10:41:07 PM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r196 r207 254 254 end 255 255 GeometryCalib.SliceCoord=Z_plane'*[0 0 1]; 256 GeometryCalib.SliceAngle=answer{7}*ones(GeometryCalib.NbSlice,1)*[0 1 0];%rotation around y axis (to generalise) 256 257 GeometryCalib.InterfaceCoord=[0 0 str2double(answer{3})]; 257 GeometryCalib.RefractionIndex=str2double(answer{4}); 258 GeometryCalib.RefractionIndex=str2double(answer{4}); 258 259 end 259 260 errormsg=update_imadoc(GeometryCalib,outputfile);% introduce the calibration data in the xml file -
trunk/src/imadoc2struct.m
r197 r207 117 117 if length(uid_subtree)==1 118 118 subt=branch(t,uid_subtree);%subtree under GeometryCalib 119 [s.TranslationMotor,errormsg]=read_subtree(subt,{'Nbslice','ZStart','ZEnd'},[1 1 1],[1 1 1]) 119 [s.TranslationMotor,errormsg]=read_subtree(subt,{'Nbslice','ZStart','ZEnd'},[1 1 1],[1 1 1]); 120 120 end 121 121 end … … 207 207 tsai.SliceCoord=ones(NbSlice,1)*tsai.SliceCoord+DZ*(0:NbSlice-1)'*[0 0 1]; 208 208 end 209 end 210 uid_VolumeScan=find(subt,'/GeometryCalib/VolumeScan'); 211 if ~isempty(uid_VolumeScan) 212 tsai.VolumeScan=get(subt,children(subt,uid_VolumeScan),'value'); 213 end 214 tsai.InterfaceCoord=get_value(subt,'/GeometryCalib/InterfaceCoord',[0 0 0]) 215 tsai.RefractionIndex=get_value(subt,'/GeometryCalib/RefractionIndex',1) 209 end 210 tsai.SliceAngle=get_value(subt,'/GeometryCalib/SliceAngle',[0 0 0]); 211 tsai.VolumeScan=get_value(subt,'/GeometryCalib/VolumeScan','n'); 212 tsai.InterfaceCoord=get_value(subt,'/GeometryCalib/InterfaceCoord',[0 0 0]); 213 tsai.RefractionIndex=get_value(subt,'/GeometryCalib/RefractionIndex',1); 216 214 217 215 if strcmp(option,'GeometryCalib') … … 236 234 s=[];%default 237 235 errormsg=''; 238 head_element=get(subt,1,'name') 236 head_element=get(subt,1,'name'); 239 237 cont=get(subt,1,'contents'); 240 238 if ~isempty(cont) 241 239 for ilist=1:length(Data) 242 uid_key=find(subt,[head_element '/' Data{ilist}]) 240 uid_key=find(subt,[head_element '/' Data{ilist}]); 243 241 if ~isequal(length(uid_key),NbOccur(ilist)) 244 errormsg=['wrong number of occurence for ' Data{ilist}] 242 errormsg=['wrong number of occurence for ' Data{ilist}]; 245 243 return 246 244 end 247 245 for ival=1:length(uid_key) 248 val=get(subt,children(subt,uid_key(ival)),'value') 246 val=get(subt,children(subt,uid_key(ival)),'value'); 249 247 if ~NumTest(ilist) 250 248 eval(['s.' Data{ilist} '=val;']); … … 279 277 if ~isempty(val_read) 280 278 val=val_read; 279 else 280 val=get(t,uid_child,'value');%char string data 281 281 end 282 282 end -
trunk/src/mouse_motion.m
r187 r207 103 103 text_displ_4=''; 104 104 for icell=1:numel(CellVarIndex)%look for all physical fields 105 if NbDim(icell) ==2 % select 2D field105 if NbDim(icell)>=2 % select 2D field 106 106 if isfield(Field,'Mesh') && ~isempty(Field.Mesh)&& ~isempty(VarType{icell}.coord_x) && ~isempty(VarType{icell}.coord_y)%case of unstructured data 107 107 eval(['X=Field.' Field.ListVarName{VarType{icell}.coord_x} ';']) … … 169 169 % end 170 170 if strcmp(text_displ_1,'') 171 text_displ_1=['x=' num2str(xy(1,1),3) ',y=' num2str(xy(1,2),3) ',']; 172 end 173 if isfield(Field,'PlaneCoord') && isfield(Field,'ZIndex') 174 text_displ_1=[text_displ_1 ' z=' num2str(Field.PlaneCoord(Field.ZIndex,3))]; %TODO: generaliser au cas avec angle 171 text_displ_1=['x=' num2str(xy(1,1),3) ',y=' num2str(xy(1,2),3) ',']; 172 z=[]; 173 if isfield(Field,'PlaneCoord') && isfield(Field,'ZIndex') 174 ZIndex=Field.ZIndex; 175 if size(Field.PlaneCoord)>=[ZIndex 3] 176 z=Field.PlaneCoord(ZIndex,3); 177 if isfield(Field,'PlaneAngle') 178 om=norm(Field.PlaneAngle(ZIndex,:));%norm of rotation angle in radians 179 OmAxis=Field.PlaneAngle(ZIndex,:)/om; %unit vector marking the rotation axis 180 cos_om=cos(pi*om/180); 181 sin_om=sin(pi*om/180); 182 coeff=OmAxis(3)*(1-cos_om); 183 norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om; 184 norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om; 185 norm_plane(3)=OmAxis(3)*coeff+cos_om; 186 Z0=norm_plane*Field.PlaneCoord(ZIndex,:)'/norm_plane(3); 187 z=Z0-norm_plane(1)*xy(1,1)/norm_plane(3)-norm_plane(2)*xy(1,2)/norm_plane(3); 188 end 189 end 190 end 191 if ~isempty(z) 192 text_displ_1=[text_displ_1 ' z=' num2str(z,3)]; %TODO: generaliser au cas avec angle 193 end 175 194 end 176 195 %coordinate transform if proj_coord differs from menu_coord A REVOIR
Note: See TracChangeset
for help on using the changeset viewer.