Changeset 542 for trunk/src/uvmat.m
 Timestamp:
 Sep 15, 2012, 7:04:56 PM (12 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/uvmat.m
r541 r542 1332 1332 else 1333 1333 %read mask image 1334 Mask.AName='image'; 1335 Mask.A=imread(MaskName); 1334 [Mask,tild,errormsg] = read_field(MaskName,'image'); 1335 % Mask.AName='image'; 1336 % Mask.A=imread(MaskName); 1337 if ~isempty(errormsg) 1338 return 1339 end 1336 1340 npxy=size(Mask.A); 1337 test_error=0;1338 1341 if length(npxy)>2 1339 1342 errormsg=[MaskName ' is not a grey scale image']; … … 1343 1346 return 1344 1347 end 1345 Mask.AX=[0.5 npxy(2)0.5];1346 Mask.AY=[npxy(1)0.5 0.5 ];1347 Mask.CoordUnit='pixel';1348 % Mask.AX=[0.5 npxy(2)0.5]; 1349 % Mask.AY=[npxy(1)0.5 0.5 ]; 1350 % Mask.CoordUnit='pixel'; 1348 1351 if isequal(get(handles.slices,'Value'),1) 1349 1352 NbSlice=str2num(get(handles.num_NbSlice,'String')); … … 4609 4612 return 4610 4613 else 4611 % set(handles.ListObject,'Max',2);%allow multiple selection4612 4614 set(handles.ListObject,'Value',val); 4613 4615 flag=1; … … 4634 4636 Y=ObjectData.Coord(:,2); 4635 4637 if testphys 4636 [X,Y]=px_XYZ(Calib,X,Y,0);% to generalise with 3D cases 4638 pos=[X Y zeros(size(X))]; 4639 if isfield(Calib,'SliceCoord') && length(Calib.SliceCoord)>=3 4640 if isfield(Calib,'SliceAngle')&&~isequal(Calib.SliceAngle,[0 0 0]) 4641 om=norm(Calib.SliceAngle);%norm of rotation angle in radians 4642 OmAxis=Calib.SliceAngle/om; %unit vector marking the rotation axis 4643 cos_om=cos(pi*om/180); 4644 sin_om=sin(pi*om/180); 4645 pos=cos_om*pos+sin_om*cross(OmAxis,pos)+(1cos_om)*(OmAxis*pos')*OmAxis; 4646 end 4647 pos(:,1)=pos(:,1)+Calib.SliceCoord(1); 4648 pos(:,2)=pos(:,2)+Calib.SliceCoord(2); 4649 pos(:,3)=pos(:,3)+Calib.SliceCoord(3); 4650 end 4651 [X,Y]=px_XYZ(Calib,pos(:,1),pos(:,2),pos(:,3)); 4637 4652 end 4638 4653 flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside … … 4671 4686 RootFile(1)=[]; 4672 4687 end 4673 % filebase=fullfile(RootPath,RootFile);4674 4688 list=get(handles.masklevel,'String'); 4675 4689 masknumber=num2str(length(list));
Note: See TracChangeset
for help on using the changeset viewer.