Changeset 566


Ignore:
Timestamp:
Jan 30, 2013, 11:35:02 PM (12 years ago)
Author:
sommeria
Message:

introduce LIF, first step

Location:
trunk/src
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r564 r566  
    45944594set(handles.MenuCalib,'checked','on')% indicate that MenuCalib is activated, test used by mouse action
    45954595
     4596
     4597%-----------------------------------------------------------------------
     4598function MenuLIFCalib_Callback(hObject, eventdata, handles)
     4599%------------------------------------------------------------------------
     4600UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
     4601ListObj=UvData.Object;
     4602select=zeros(1,numel(ListObj));
     4603for iobj=1:numel(ListObj);
     4604    if strcmp(ListObj{iobj}.Type,'line')
     4605        select(iobj)=1;
     4606    end
     4607end
     4608val=find(select);
     4609if numel(val)<2
     4610    msgbox_uvmat('ERROR','light rays must be defined by at least two lines created by Projection object/line in the menu bar');
     4611    return
     4612else
     4613    set(handles.ListObject,'Value',val);
     4614    ObjectData=UvData.Object(val);
     4615    flag=1;
     4616    npx=size(UvData.Field.A,2);
     4617    npy=size(UvData.Field.A,1);
     4618    xi=0.5:npx-0.5;
     4619    yi=0.5:npy-0.5;
     4620    [Xi,Yi]=meshgrid(xi,yi);
     4621    for iobj=1:length(ObjectData)
     4622        flagobj=1;
     4623        testphys=0; %coordinates in pixels by default
     4624        if isfield(ObjectData,'CoordUnit') && ~isequal(ObjectData.CoordUnit,'pixel')
     4625            if isfield(UvData,'XmlData')&& isfield(UvData.XmlData{1},'GeometryCalib')
     4626                Calib=UvData.XmlData{1}.GeometryCalib;
     4627                testphys=1;
     4628            end
     4629        end
     4630        if isfield(ObjectData{iobj},'Coord')
     4631            x1(iobj)=ObjectData{iobj}.Coord(1,1);
     4632            y1(iobj)=ObjectData{iobj}.Coord(1,2);
     4633            x2(iobj)=ObjectData{iobj}.Coord(2,1);
     4634            y2(iobj)=ObjectData{iobj}.Coord(2,2);
     4635        end
     4636    end
     4637end
     4638    %determine the ray origin
     4639    x1
     4640    y1
     4641    x2
     4642    y2
     4643    % update the xml file
     4644
     4645
     4646
    45964647%------------------------------------------------------------------------
    45974648function MenuMask_Callback(hObject, eventdata, handles)
     
    46174668    yi=0.5:npy-0.5;
    46184669    [Xi,Yi]=meshgrid(xi,yi);
    4619     if isfield(UvData,'Object')
     4670%     if isfield(UvData,'Object')
    46204671        for iobj=1:length(UvData.Object)
    46214672            ObjectData=UvData.Object{iobj};
     
    46764727            end
    46774728        end
    4678     end
     4729%     end
    46794730    %mask name
    46804731    RootPath=get(handles.RootPath,'String');
     
    48464897
    48474898% Hint: get(hObject,'Value') returns toggle state of CheckColorBar
     4899
Note: See TracChangeset for help on using the changeset viewer.