Changeset 535 for trunk/src/uvmat.m


Ignore:
Timestamp:
Sep 3, 2012, 2:02:13 PM (12 years ago)
Author:
sommeria
Message:

various bugs fixed, in particular patch projection with color images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r534 r535  
    293293    display_file_name(handles,inputfile)
    294294    %%%%%%%
    295     testinputfield=1;
    296295end
    297296
     
    24042403%% get bounds and mesh (needed  to propose default options for projection objects)
    24052404if NbDim>1
    2406     CoordMax=zeros(1,numel(imax));
    2407     CoordMin=zeros(1,numel(imax));
     2405    CoordMax=zeros(numel(imax),NbDim);
     2406    CoordMin=zeros(numel(imax),NbDim);
     2407    Mesh=zeros(numel(imax),NbDim);
    24082408    for ind=1:numel(imax)
    24092409        XName=UvData.Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(end)};
    24102410        YName=UvData.Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(end-1)};
    2411         CoordMax(ind,1)=max(max(UvData.Field.(XName)));
    2412         CoordMin(ind,1)=min(min(UvData.Field.(XName)));
    2413         CoordMax(ind,2)=max(max(UvData.Field.(YName)));
    2414         CoordMin(ind,2)=min(min(UvData.Field.(YName)));
     2411        CoordMax(ind,NbDim)=max(max(UvData.Field.(XName)));
     2412        CoordMin(ind,NbDim)=min(min(UvData.Field.(XName)));
     2413        CoordMax(ind,NbDim-1)=max(max(UvData.Field.(YName)));
     2414        CoordMin(ind,NbDim-1)=min(min(UvData.Field.(YName)));
    24152415        %         test_x=1;%test for unstructured coordinates
    24162416        if NbDim==3
    24172417            ZName=UvData.Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(1)};
    2418             CoordMax(imax(ind),3)=max(max(UvData.Field.(ZName)));
    2419             CoordMin(ind,3)=min(min(UvData.Field.(ZName)));
     2418            CoordMax(imax(ind),1)=max(max(UvData.Field.(ZName)));
     2419            CoordMin(ind,1)=min(min(UvData.Field.(ZName)));
    24202420        end
    24212421       
     
    24232423           
    24242424            case 'scattered' %unstructured coordinates
    2425                 NbPoints(ind)=CellInfo{imax(ind)}.CoordSize;% nbre of points
    2426                 Mesh(ind)=(prod(CoordMax(ind,:)-CoordMin(ind,:))/NbPoints)^(1/NbDim); %(volume or area per point)^(1/NbDim)
     2425                NbPoints=CellInfo{imax(ind)}.CoordSize;% nbre of points
     2426                Mesh(ind,:)=(prod(CoordMax(ind,:)-CoordMin(ind,:))/NbPoints)^(1/NbDim); %(volume or area per point)^(1/NbDim)
    24272427            case 'grid'%structured coordinate
    2428                 NbPoints=CellInfo{imax(ind)}.CoordSize;% nbre of points
    2429                 Mesh(ind)=min((CoordMax(ind,:)-CoordMin(ind,:))./NbPoints);
    2430                
     2428                NbPoints=CellInfo{imax(ind)}.CoordSize;% nbre of points in each direction
     2429                Mesh(ind,:)=min((CoordMax(ind,:)-CoordMin(ind,:))./(NbPoints-1));               
    24312430        end
    24322431    end
     
    25252524    % main projection object (uvmat display)
    25262525    list_object=get(handles.ListObject_1,'String');
    2527     if isequal(list_object,{''})%refresh list of objects if the menu is empty
     2526    if isequal(list_object,{''})||isequal(list_object,' ')%refresh list of objects if the menu is empty
    25282527        set(handles.ListObject,'Value',1)
    25292528        set(handles.ListObject,'String',{'plane'})
Note: See TracChangeset for help on using the changeset viewer.