Changeset 847


Ignore:
Timestamp:
Jan 15, 2015, 6:05:57 PM (9 years ago)
Author:
sommeria
Message:

various

Location:
trunk/src
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r838 r847  
    170170%------------------------------------------------------------------------
    171171%% look for the GUI uvmat and check for an image as input
    172 set(handles.APPLY,'BackgroundColor',[1 1 0])
    173 huvmat=findobj(allchild(0),'Name','uvmat');
     172set(handles.APPLY,'BackgroundColor',[1 1 0])% paint APPLY button in yellow to show activation
     173huvmat=findobj(allchild(0),'Name','uvmat');% look for the GUI uvmat
    174174hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat
    175175
    176176RootPath='';
    177177if ~isempty(hhuvmat.RootPath)&& ~isempty(hhuvmat.RootFile)
    178     RootPath=get(hhuvmat.RootPath,'String');
     178    RootPath=get(hhuvmat.RootPath,'String');% path to the currently displayed image
    179179    SubDirBase=regexprep(get(hhuvmat.SubDir,'String'),'\..+$','');
    180180    outputfile=[fullfile(RootPath,SubDirBase) '.xml'];%xml file associated with the currently displayed image
     
    326326
    327327%% store the calibration data, by default in the xml file of the currently displayed image
    328 UvData=get(hhuvmat.uvmat,'UserData');
    329 % NbSlice_j=1;%default
    330 % ZStart=Z_plane;
    331 % ZEnd=Z_plane;
    332 % volume_scan='n';
    333 % if isfield(UvData,'XmlData')
    334 %     if isfield(UvData.XmlData,'TranslationMotor')
    335 %         NbSlice_j=UvData.XmlData.TranslationMotor.Nbslice;
    336 %         ZStart=UvData.XmlData.TranslationMotor.ZStart/10;
    337 %         ZEnd=UvData.XmlData.TranslationMotor.ZEnd/10;
    338 %         volume_scan='y';
    339 %     end
    340 % end
    341 
    342328answer=msgbox_uvmat('INPUT_Y-N',{'store calibration data';...
    343329    ['Error rms (along x,y)=' num2str(GeometryCalib.ErrorRms) ' pixels'];...
    344330    ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']});
    345 
    346 %% get plane position(s)
    347 if ~strcmp(answer,'Yes')
     331if strcmp(answer,'Yes') %store the calibration data
     332    if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration
     333        msgbox_uvmat('CONFIRMATION',{['The current image series is assumed by default in the plane of the calib points z=' num2str(Z_plane) ] ; 'can be modified by MenuSetSlice in the upper bar menu of uvmat'})
     334        GeometryCalib.SliceCoord=Z_plane'*[0 0 1];
     335    end
     336else
    348337    GeometryCalib=[];
    349338    index=1;
    350     return
    351 end
    352 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration
    353     msgbox_uvmat('CONFIRMATION',{['The current image series is assumed by default in the plane of the calib points z=' num2str(Z_plane) ] ; 'can be modified by MenuSetSlice in the upper bar menu of uvmat'})
    354 %     input_key={'Z (first position)','Z (last position)','Z (water surface)', 'refractive index','NbSlice','volume scan (y/n)','tilt angle y axis','tilt angle x axis'};
    355 %     input_val=[{num2str(ZEnd)} {num2str(ZStart)} {num2str(ZStart)} {'1.333'} num2str(NbSlice_j) {volume_scan} {'0'} {'0'}];
    356 %     answer=inputdlg(input_key,'slice position(s)',ones(1,8), input_val,'on');
    357 %     GeometryCalib.NbSlice=str2double(answer{5});
    358 %     GeometryCalib.VolumeScan=answer{6};
    359 %     if isempty(answer)
    360 %         Z_plane=0; %default
    361 %     else
    362 %         Z_plane=linspace(str2double(answer{1}),str2double(answer{2}),GeometryCalib.NbSlice);
    363 %     end
    364      GeometryCalib.SliceCoord=Z_plane'*[0 0 1];
    365 %     GeometryCalib.SliceAngle(:,3)=0;
    366 %     GeometryCalib.SliceAngle(:,2)=str2double(answer{7})*ones(GeometryCalib.NbSlice,1);%rotation around y axis (to generalise)
    367 %     GeometryCalib.SliceAngle(:,1)=str2double(answer{8})*ones(GeometryCalib.NbSlice,1);%rotation around x axis (to generalise)
    368 %     GeometryCalib.InterfaceCoord=[0 0 str2double(answer{3})];
    369 %     GeometryCalib.RefractionIndex=str2double(answer{4});
    370339end
    371340
  • trunk/src/msgbox_uvmat.m

    r809 r847  
    106106        case 'INPUT_Y-N'
    107107            icontype='quest';
    108             testCancel=1; %no cancel button
     108            testCancel=0; %no cancel button
    109109            testNo=1; % button No activated
    110110        case 'RULER'
  • trunk/src/proj_field.m

    r813 r847  
    13291329                        XIndexMin=1;
    13301330                    end
    1331 %                         YIndexMin=(Coord{NbDim-1}(1)-YMax)/DY+1;
    1332 % %                         YIndexMax=(Coord{NbDim-1}(1)-YMin)/DY+1;
    1333 %                         Ybound(2)=Coord{NbDim-1}(1)-DY*(YIndexMax-1);
    1334 %                         Ybound(1)=Coord{NbDim-1}(1)-DY*(YIndexMin-1);
    1335 %                     end
    1336 %                     if testXMin%test_direct(NbDim)==1
    1337 %                         XIndexMin=(XMin-Coord{NbDim}(1))/DX+1;% matrix index corresponding to the min x value for the new field
    1338 %                         XIndexMax=(XMax-Coord{NbDim}(1))/DX+1;% matrix index corresponding to the max x value for the new field
    1339 %                         Xbound(1)=Coord{NbDim}(1)+DX*(XIndexMin-1);%  x value corresponding to XIndexMin
    1340 %                         Xbound(2)=Coord{NbDim}(1)+DX*(XIndexMax-1);%  x value corresponding to XIndexMax
    1341 %                     else
    1342 %                         XIndexMin=(Coord{NbDim}(1)-XMax)/DX+1;
    1343 %                         XIndexMax=(Coord{NbDim}(1)-XMin)/DX+1;
    1344 %                         Xbound(2)=Coord{NbDim}(1)+DX*(XIndexMax-1);
    1345 %                         Xbound(1)=Coord{NbDim}(1)+DX*(XIndexMin-1);
    1346 %                     end
    13471331                    YIndexRange(1)=ceil(min(YIndexMin,YIndexMax));%first y index to select from the previous field
    13481332                    YIndexRange(1)=max(YIndexRange(1),1);% avoid bound lower than the first index
     
    14611445                        VarName=FieldData.ListVarName{ivar};
    14621446                        if size(FieldData.(VarName),3)==1
    1463                             ProjData.(VarName)=interp2(X,Y,double(FieldData.(VarName)),XI,YI,'*linear');
     1447                            ProjData.(VarName)=interp2(X,Y,double(FieldData.(VarName)),XI,YI,'*linear');%interpolation fct
    14641448                        else
    14651449                            ProjData.(VarName)=interp2(X,Y,double(FieldData.(VarName)(:,:,1)),XI,YI,'*linear');
    14661450                            for icolor=2:size(FieldData.(VarName),3)% project 'color' components
    1467                                 ProjData.(VarName)=cat(3,ProjData.(VarName),interp2(X,Y,double(FieldData.(VarName)(:,:,icolor)),XI,YI,'*linear')); %TO TEST
     1451                                ProjData.(VarName)=cat(3,ProjData.(VarName),interp2(X,Y,double(FieldData.(VarName)(:,:,icolor)),XI,YI,'*linear'));
    14681452                            end
     1453                        end
     1454                        if isa(FieldData.(VarName),'uint8')
     1455                            ProjData.(VarName)=uint8(ProjData.(VarName));%put result to integer 8 bits if the initial field is integer (image)
     1456                        elseif isa(FieldData.(VarName),'uint16')
     1457                            ProjData.(VarName)=uint16(ProjData.(VarName));%put result to integer 16 bits if the initial field is integer (image)
    14691458                        end
    14701459                        ListVarName=[ListVarName VarName];
     
    15401529                    eval(['ProjData.' WName '=NormVec_X*ProjData.' UName '+ NormVec_Y*ProjData.' VName '+ NormVec_Z* ProjData.' WName ';']);
    15411530                end
    1542                 %                 if ~isequal(Psi,0)
    1543                 %                     eval(['ProjData.' UName '=cos(Psi)* ProjData.' UName '- sin(Psi)*ProjData.' VName ';']);
    1544                 %                     eval(['ProjData.' VName '=sin(Psi)* ProjData.' UName '+ cos(Psi)*ProjData.' VName ';']);
    1545                 %                 end
    15461531            end
    15471532        end
  • trunk/src/uvmat.m

    r844 r847  
    41204120% --- read the data displayed for the input rootfile windows (new): TODO use read_GUI
    41214121%------------------------------------------------------------------------
    4122 function [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles)
     4122function [RootPath,SubDir,RootFile,FileIndices,FileExt,NomType]=read_file_boxes(handles)
    41234123
    41244124InputFile=read_GUI(handles.InputFile);
     
    41284128FileIndices=InputFile.FileIndex;
    41294129FileExt=InputFile.FileExt;
    4130 
     4130NomType=InputFile.NomType;
    41314131
    41324132%------------------------------------------------------------------------
     
    43214321
    43224322%----------------------------------------------------------------
    4323 % --- Executes on menu selection FieldName
     4323% --- Executes on menu selection FieldName_1
    43244324function FieldName_1_Callback(hObject, eventdata, handles)
    43254325%-------------------------------------------------
     
    44684468    case 'image'
    44694469        %% look for image corresponding to civ data
    4470         imagename='';
    44714470        if  isfield(UvData.Field,'Civ2_ImageA')%get the corresponding input image in the netcdf file
    44724471            imagename=UvData.Field.Civ2_ImageA;
     
    44744473            imagename=UvData.Field.Civ1_ImageA;
    44754474        else
     4475            [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles);
    44764476            SubDirBase=regexprep(SubDir,'\..*','');%take the root part of SubDir, before the first dot '.'
    4477             imagename=fullfile_uvmat(RootPath,SubDirBase,RootFile,'.png',NomType,i1,[],j1,[]);
     4477            imagename=fullfile_uvmat(RootPath,SubDirBase,RootFile,'.png','_1',i1,[],j1,[]);
    44784478        end
    44794479        if ~exist(imagename,'file')
Note: See TracChangeset for help on using the changeset viewer.