Changeset 215


Ignore:
Timestamp:
Mar 8, 2011, 11:36:29 PM (10 years ago)
Author:
sommeria
Message:

proj_field: correct the projection mode filter on a line
uvmat: correct bug for avi movies extraction
imadoc2struct: cleaning

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/imadoc2struct.m

    r207 r215  
    9292                end
    9393                if ~isempty(Dtj)
    94                     Dtj=reshape(Dtj'*ones(1,NbDtj),1,NbDtj*numel(Dtj)); %concatene Dti vector NbDti times
     94                    Dtj=reshape(Dtj'*ones(1,NbDtj),1,NbDtj*numel(Dtj)); %concatene Dtj vector NbDtj times
    9595                    Dtj=[0 Dtj];
    9696                    Time_val=Time_val*ones(1,numel(Dtj))+ones(numel(Time_val),1)*cumsum(Dtj);% produce a time matrix with Dtj
  • trunk/src/proj_field.m

    r213 r215  
    220220    ProjData.ListVarName={'Y','X','NbVal'};
    221221    ProjData.VarDimName={'nb_points','nb_points','nb_points'};
    222     %ProjData.VarDimIndex={[1],[1],[1]};
    223222    ProjData.VarAttribute{1}.Role='ancillary';
    224223    ProjData.VarAttribute{2}.Role='ancillary';
     
    227226        VarName=FieldData.ListVarName{ivar};
    228227        ProjData.ListVarName=[ProjData.ListVarName {VarName}];
    229         %ProjData.VarDimIndex=[ProjData.VarDimIndex {[1]}];
    230228        ProjData.VarDimName=[ProjData.VarDimName {'nb_points'}];
    231229    end
     
    253251               FFName=FieldData.ListVarName{ivar_FF};
    254252               eval(['FF=FieldData.' FFName '(indsel);'])
    255                ind_indsel=find(~FF);
    256                indsel=indsel(ind_indsel);
     253               %ind_indsel=find(~FF);
     254               indsel=indsel(~FF);
    257255           end
    258256           ProjData.NbVal(ipoint,1)=length(indsel);
     
    750748                Xproj=linelength/(2*npoint):linelength/npoint:linelength-linelength/(2*npoint);
    751749                siz=size(X_sel);
    752                 xregij=cos(theta(ip))*Xproj'*ones(1,siz(2))+ObjectData.Coord(ip,1);
    753                 yregij=sin(theta(ip))*Xproj'*ones(1,siz(2))+ObjectData.Coord(ip,2);
    754                 xij=ones(npoint,1)*X_sel;
    755                 yij=ones(npoint,1)*Y_sel;
     750                xregij=cos(theta(ip))*ones(siz(1),1)*Xproj+ObjectData.Coord(ip,1);
     751                yregij=sin(theta(ip))*ones(siz(1),1)*Xproj+ObjectData.Coord(ip,2);
     752                xij=X_sel*ones(1,npoint);
     753                yij=Y_sel*ones(1,npoint);
    756754                Aij=exp(-lambda*((xij-xregij).*(xij-xregij)+(yij-yregij).*(yij-yregij)));
    757                 norm=ones(1,siz(2))*Aij';
     755                norm=Aij'*ones(siz(1),1);
    758756                for ivar=1:numel(ProjVar)
    759757                     if ~isempty(ProjVar{ivar})
    760                         ProjVar{ivar}=ProjVar{ivar}*Aij'./norm;
     758                        ProjVar{ivar}=Aij'*ProjVar{ivar}./norm;
    761759                     end
    762760                end             
     
    12561254        VarName=FieldData.ListVarName{VarIndex(1)};%get the first variable of the cell to get the input matrix dimensions
    12571255        eval(['DimValue=size(FieldData.' VarName ');'])%input matrix dimensions
    1258         DimValue(find(DimValue==1))=[];%remove singleton dimensions       
     1256        DimValue(DimValue==1)=[];%remove singleton dimensions       
    12591257        NbDim=numel(DimValue);%update number of space dimensions
    12601258        nbcolor=1; %default number of 'color' components: third matrix index without corresponding coordinate
  • trunk/src/set_object.m

    r213 r215  
    276276z_new={};
    277277if isequal(get(handles.ZObject,'Visible'),'on')
    278     data.NbDim=3; %test 3D object
     278    %data.NbDim=3; %test 3D object
    279279    Zcolumn=get(handles.ZObject,'String');
    280280    if ischar(Zcolumn)
     
    766766
    767767%% plot the field projected on the object and store in the corresponding figue
    768 'TESTproj'
    769 UvData.Field
    770 ObjectData
    771 ProjData= proj_field(UvData.Field,ObjectData)%project the current interface field on ObjectData
     768ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData
    772769PlotParam=read_plot_param(PlotHandles);
    773770[PlotType,Object_out{IndexObj}.PlotParam,plotaxes]=plot_field(ProjData,plotaxes,PlotParam);%update an existing field plot
  • trunk/src/uvmat.m

    r210 r215  
    234234%UvData.Object{1}.Style='plane';%main plotting plane
    235235UvData.Object{1}.ProjMode='projection';%main plotting plane
    236 if ~isfield(UvData.Object{1},'plotaxes')
    237     UvData.Object{1}.plotaxes=handles.axes3;%default plotting axis
    238     set(handles.list_object_1,'Value',1);
    239    % set(handles.list_object_1,'String',{'1-PLANE'});
    240    set(handles.list_object_1,'String',{''});
    241 end
     236% if ~isfield(UvData.Object{1},'plotaxes')
     237%     UvData.Object{1}.plotaxes=handles.axes3;%default plotting axis
     238%     set(handles.list_object_1,'Value',1);
     239%    % set(handles.list_object_1,'String',{'1-PLANE'});
     240%    set(handles.list_object_1,'String',{''});
     241% end
    242242set(handles.Fields,'Value',1)
    243243set(handles.Fields,'string',{''})
     
    25292529    set(handles.list_object_1,'String',{''});
    25302530end
    2531 if ~isfield(UvData.Object{1},'plotaxes')
    2532     UvData.Object{1}.plotaxes=handles.axes3;%default plotting axis
    2533 end
     2531% if ~isfield(UvData.Object{1},'plotaxes')
     2532%     UvData.Object{1}.plotaxes=handles.axes3;%default plotting axis
     2533% end
    25342534testnewseries=UvData.NewSeries;
    25352535UvData.NewSeries=0;% put to 0 the test for a new field series (set by RootPath_callback)
     
    25512551end
    25522552plot_handles{1}=handles;
    2553 haxes(1)=handles.axes3;
     2553if isfield(UvData,'plotaxes')%case of movies
     2554    haxes(1)=UvData.plotaxes;
     2555else
     2556    haxes(1)=handles.axes3;
     2557end
    25542558PlotParam{1}=read_plot_param(handles);%read plotting parameters on the uvmat interfac
    25552559keeplim(1)=get(handles.FixLimits,'Value');% test for fixed graph limits
     
    44754479msgbox_uvmat('INPUT_Y-N',{['adjust figure ' num2str(newfig) ' with its matlab edit menu '] ;...
    44764480        ['then press OK to get the avi movie as a copy of figure ' num2str(newfig) ' display']});
    4477 UvData.Object{1}.plotaxes=newaxes;% the axis in the new figure becomes the current main plotting axes
     4481UvData.plotaxes=newaxes;% the axis in the new figure becomes the current main plotting axes
    44784482set(huvmat,'UserData',UvData);
    44794483increment=str2double(get(handles.increment_scan,'String')); %get the field increment d
     
    45094513    end
    45104514end
    4511 close(aviobj);
    4512 UvData.Object{1}.plotaxes=handles.axes3;
     4515aviobj=close(aviobj);
     4516UvData=rmfield(UvData,'plotaxes');
     4517%UvData.Object{1}.plotaxes=handles.axes3;
    45134518set(huvmat,'UserData',UvData);
    45144519msgbox_uvmat('CONFIRMATION',{['movie ' aviname ' created '];['with ' num2str(imax) ' frames']})
Note: See TracChangeset for help on using the changeset viewer.