Changeset 847
- Timestamp:
- Jan 15, 2015, 6:05:57 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r838 r847 170 170 %------------------------------------------------------------------------ 171 171 %% 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'); 172 set(handles.APPLY,'BackgroundColor',[1 1 0])% paint APPLY button in yellow to show activation 173 huvmat=findobj(allchild(0),'Name','uvmat');% look for the GUI uvmat 174 174 hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat 175 175 176 176 RootPath=''; 177 177 if ~isempty(hhuvmat.RootPath)&& ~isempty(hhuvmat.RootFile) 178 RootPath=get(hhuvmat.RootPath,'String'); 178 RootPath=get(hhuvmat.RootPath,'String');% path to the currently displayed image 179 179 SubDirBase=regexprep(get(hhuvmat.SubDir,'String'),'\..+$',''); 180 180 outputfile=[fullfile(RootPath,SubDirBase) '.xml'];%xml file associated with the currently displayed image … … 326 326 327 327 %% 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;%default330 % 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 % end340 % end341 342 328 answer=msgbox_uvmat('INPUT_Y-N',{'store calibration data';... 343 329 ['Error rms (along x,y)=' num2str(GeometryCalib.ErrorRms) ' pixels'];... 344 330 ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']}); 345 346 %% get plane position(s) 347 if ~strcmp(answer,'Yes') 331 if 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 336 else 348 337 GeometryCalib=[]; 349 338 index=1; 350 return351 end352 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration353 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; %default361 % else362 % Z_plane=linspace(str2double(answer{1}),str2double(answer{2}),GeometryCalib.NbSlice);363 % end364 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});370 339 end 371 340 -
trunk/src/msgbox_uvmat.m
r809 r847 106 106 case 'INPUT_Y-N' 107 107 icontype='quest'; 108 testCancel= 1; %no cancel button108 testCancel=0; %no cancel button 109 109 testNo=1; % button No activated 110 110 case 'RULER' -
trunk/src/proj_field.m
r813 r847 1329 1329 XIndexMin=1; 1330 1330 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 % end1336 % if testXMin%test_direct(NbDim)==11337 % XIndexMin=(XMin-Coord{NbDim}(1))/DX+1;% matrix index corresponding to the min x value for the new field1338 % XIndexMax=(XMax-Coord{NbDim}(1))/DX+1;% matrix index corresponding to the max x value for the new field1339 % Xbound(1)=Coord{NbDim}(1)+DX*(XIndexMin-1);% x value corresponding to XIndexMin1340 % Xbound(2)=Coord{NbDim}(1)+DX*(XIndexMax-1);% x value corresponding to XIndexMax1341 % else1342 % 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 % end1347 1331 YIndexRange(1)=ceil(min(YIndexMin,YIndexMax));%first y index to select from the previous field 1348 1332 YIndexRange(1)=max(YIndexRange(1),1);% avoid bound lower than the first index … … 1461 1445 VarName=FieldData.ListVarName{ivar}; 1462 1446 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 1464 1448 else 1465 1449 ProjData.(VarName)=interp2(X,Y,double(FieldData.(VarName)(:,:,1)),XI,YI,'*linear'); 1466 1450 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 TEST1451 ProjData.(VarName)=cat(3,ProjData.(VarName),interp2(X,Y,double(FieldData.(VarName)(:,:,icolor)),XI,YI,'*linear')); 1468 1452 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) 1469 1458 end 1470 1459 ListVarName=[ListVarName VarName]; … … 1540 1529 eval(['ProjData.' WName '=NormVec_X*ProjData.' UName '+ NormVec_Y*ProjData.' VName '+ NormVec_Z* ProjData.' WName ';']); 1541 1530 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 % end1546 1531 end 1547 1532 end -
trunk/src/uvmat.m
r844 r847 4120 4120 % --- read the data displayed for the input rootfile windows (new): TODO use read_GUI 4121 4121 %------------------------------------------------------------------------ 4122 function [RootPath,SubDir,RootFile,FileIndices,FileExt ]=read_file_boxes(handles)4122 function [RootPath,SubDir,RootFile,FileIndices,FileExt,NomType]=read_file_boxes(handles) 4123 4123 4124 4124 InputFile=read_GUI(handles.InputFile); … … 4128 4128 FileIndices=InputFile.FileIndex; 4129 4129 FileExt=InputFile.FileExt; 4130 4130 NomType=InputFile.NomType; 4131 4131 4132 4132 %------------------------------------------------------------------------ … … 4321 4321 4322 4322 %---------------------------------------------------------------- 4323 % --- Executes on menu selection FieldName 4323 % --- Executes on menu selection FieldName_1 4324 4324 function FieldName_1_Callback(hObject, eventdata, handles) 4325 4325 %------------------------------------------------- … … 4468 4468 case 'image' 4469 4469 %% look for image corresponding to civ data 4470 imagename='';4471 4470 if isfield(UvData.Field,'Civ2_ImageA')%get the corresponding input image in the netcdf file 4472 4471 imagename=UvData.Field.Civ2_ImageA; … … 4474 4473 imagename=UvData.Field.Civ1_ImageA; 4475 4474 else 4475 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles); 4476 4476 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,[]); 4478 4478 end 4479 4479 if ~exist(imagename,'file')
Note: See TracChangeset
for help on using the changeset viewer.