- Timestamp:
- Apr 4, 2012, 3:31:30 PM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r386 r387 1095 1095 Param.xml=s.RunParam; 1096 1096 else 1097 msgbox_uvmat('ERROR','no run civ binaries defined in PARAM.xml')1097 errormsg='no run civ binaries defined in PARAM.xml'; 1098 1098 return 1099 1099 end … … 1110 1110 [s,w]=system(test_command); 1111 1111 if ~isequal(s,0) 1112 msgbox_uvmat('ERROR',[batch_mode ' batch system not available'])1112 errormsg=[batch_mode ' batch system not available']; 1113 1113 return 1114 1114 end … … 1137 1137 Param.xml.(bin_name{1})=fullname; 1138 1138 else 1139 msgbox_uvmat('ERROR',['Binary ' Param.xml.(bin_name{1}) ' defined in PARAM.xml does not exist'])1139 errormsg=['Binary ' Param.xml.(bin_name{1}) ' defined in PARAM.xml does not exist']; 1140 1140 return 1141 1141 end … … 1239 1239 % Param.Civ1.Grid=[filecell.filebase '_' name_generator(Param.Civ1.Grid,i1_grid,1,'.grid','_i')]; 1240 1240 if ~exist(Param.Civ1.GridName,'file') 1241 msgbox_uvmat('ERROR','grid file absent for civ1') 1241 errormsg='grid file absent for civ1'; 1242 return 1242 1243 end 1243 1244 elseif ~exist(Param.Civ1.Grid,'file') 1244 msgbox_uvmat('ERROR','grid file absent for civ1') 1245 errormsg='grid file absent for civ1'; 1246 return 1245 1247 end 1246 1248 end … … 1250 1252 switch CivMode 1251 1253 case 'CivX' 1252 cmd=[cmd...1253 cmd_civ1(filecell.nc.civ1{ifile,j},Param)'\n'];1254 [cmd_civ,errormsg]=cmd_civ1(filecell.nc.civ1{ifile,j},Param); 1255 cmd=[cmd cmd_civ '\n']; 1254 1256 if ~isempty(errormsg) 1255 msgbox_uvmat('ERROR',errormsg)1256 1257 return 1257 1258 end … … 1318 1319 % patch1.gridPatch=[filecell.filebase '_' name_generator(gridname,i1_grid,1,'.grid','_i')]; 1319 1320 if ~exist(patch1.gridPatch,'file') 1320 msgbox_uvmat('ERROR','grid file absent for patch1') 1321 errormsg='grid file absent for patch1'; 1322 return 1321 1323 end 1322 1324 elseif exist(gridname,'file') 1323 1325 patch1.gridPatch=gridname; 1324 1326 else 1325 msgbox_uvmat('ERROR','grid file absent for patch1') 1327 errormsg='grid file absent for patch1'; 1328 return 1326 1329 end 1327 1330 end … … 1456 1459 % patch2.gridPatch=[filecell.filebase '_' name_generator(gridname,i1_grid,1,'.grid','_i')]; 1457 1460 if ~exist(patch2.gridPatch,'file') 1458 msgbox_uvmat('ERROR','grid file absent for patch2') 1461 errormsg='grid file absent for patch2'; 1462 return 1459 1463 end 1460 1464 elseif exist(gridname,'file') 1461 1465 patch2.gridPatch=gridname; 1462 1466 else 1463 msgbox_uvmat('ERROR','grid file absent for patch2') 1467 errormsg='grid file absent for patch2'; 1468 return 1464 1469 end 1465 1470 end … … 1495 1500 [fid,message]=fopen(filename_bat,'w'); 1496 1501 if isequal(fid,-1) 1497 msgbox_uvmat('ERROR', ['creation of .bat file: ' message])1502 errormsg=['creation of .bat file: ' message]; 1498 1503 return 1499 1504 end … … 1516 1521 [fid,message]=fopen(filename_bat,'w'); 1517 1522 if isequal(fid,-1) 1518 msgbox_uvmat('ERROR', ['creation of .bat file: ' message])1523 errormsg= ['creation of .bat file: ' message]; 1519 1524 return 1520 1525 end … … 1537 1542 if isempty(errormsg) 1538 1543 display([filecell.nc.civ1{ifile,j} ' written']) 1539 else1540 msgbox_uvmat('ERROR',errormsg)1544 % else 1545 % msgbox_uvmat('ERROR',errormsg) 1541 1546 end 1542 1547 end … … 3031 3036 else %case civ2 alone 3032 3037 if ~get(handles.CheckCiv2,'Value') && ~get(handles.CheckCiv1,'Value') && ~get(handles.CheckFix1,'Value') && ~get(handles.CheckPatch1,'Value') 3033 if ~exist(fullfile( filepath,subdir_civ2,ext_dir),'dir')3038 if ~exist(fullfile(RootPath,subdir_civ2,ext_dir),'dir') 3034 3039 errordlg(['no civ2 file available: subdirectory ' subdir_civ2 ' does not exist']) 3035 3040 set(handles.ListPairCiv2,'Value',1); … … 3637 3642 end 3638 3643 end 3639 %------------------------------------------------------------------------ 3640 % --- Executes on button press in CheckMask. 3644 3645 %------------------------------------------------------------------------ 3646 % --- Executes on button press in CheckMask: common to all panels (civ1, Civ2..) 3641 3647 function CheckMask_Callback(hObject, eventdata, handles) 3642 3648 %------------------------------------------------------------------------ … … 3645 3651 parent_tag=get(hparent,'Tag'); 3646 3652 hchildren=get(hparent,'children'); 3647 handle_txtbox=findobj(hchildren,'tag','txt_Mask'); 3648 % handle_dx=findobj(hchildren,'tag','num_Dx'); 3649 % handle_dy=findobj(hchildren,'tag','num_Dy'); 3653 handle_txtbox=findobj(hchildren,'tag','Mask');% look for the mask name box in the same panel 3650 3654 testmask=0; 3651 3655 if value … … 3673 3677 end 3674 3678 if testmask 3675 % stage=4;%default3676 3679 if strcmp(parent_tag,'Civ1') 3677 3680 set(handles.Mask,'Visible','on') 3678 3681 set(handles.Mask,'String',filemask) 3679 3682 set(handles.CheckMask,'Value',1) … … 3907 3910 Data.VarDimName= {'ny','nx',{'ny','nx'}}; 3908 3911 Data.A=imread(filecell.ima1.civ1{1}); 3912 if ndims(Data.A)==3 %case of color image 3913 Data.VarDimName= {'ny','nx',{'ny','nx','rgb'}}; 3914 end 3909 3915 Data.ny=[size(Data.A,1) 1]; 3910 3916 Data.nx=[1 size(Data.A,2)]; … … 3915 3921 Param.Civ1=par_civ1; 3916 3922 Grid=civ_matlab(Param);% get the grid of x, y positions set for PIV 3917 hview_field=view_field(Data); 3923 hview_field=view_field(Data); %view the image in the GUI view_field 3918 3924 set(0,'CurrentFigure',hview_field) 3919 3925 hhview_field=guihandles(hview_field); … … 3960 3966 3961 3967 %------------------------------------------------------------------------ 3962 function cmd=cmd_civ1(filename,Param)3968 function [cmd,errormsg]=cmd_civ1(filename,Param) 3963 3969 %------------------------------------------------------------------------ 3964 3970 %pixels per cm and matrix of the image times, read from the .civ file by uvmat 3965 3971 %changes : filename_cmx -> filename ( no extension ) 3966 3972 cmd=''; 3967 errormsg=''; %default3968 3973 filename=regexprep(filename,'.nc',''); %file name for the result 3969 3974 if isequal(Param.Civ1.Dt,0) … … 3972 3977 Param.Civ1.ImageA=regexprep(Param.Civ1.ImageA,'.png',''); 3973 3978 Param.Civ1.ImageB=regexprep(Param.Civ1.ImageB,'.png',''); 3974 fid=fopen([filename '.civ1.cmx'],'w');3979 [fid,errormsg]=fopen([filename '.civ1.cmx'],'w'); 3975 3980 if isequal(fid,-1) 3976 display(['cmd file ' filename ' cannot be created'])3981 errormsg=['cmd file ' filename ' cannot be created: ' errormsg]; 3977 3982 return 3978 3983 end … … 4054 4059 filename=regexprep(filename,'.nc',''); 4055 4060 MaskName_string='';%default 4056 % if Param.(fixname).CheckMask4057 % MaskName_string=[' -maskName "' Param.(fixname).Mask '"'];4058 % end4059 4061 MaxVel_string='';%default 4060 4062 if ~isempty(Param.(fixname).MaxVel) … … 4095 4097 %------------------------------------------------------------------------ 4096 4098 % --- CheckCiv2 CheckCiv2 CheckCiv2 CheckCiv2 4097 function cmd=cmd_civ2(filename,Param)4099 function [cmd,errormsg]=cmd_civ2(filename,Param) 4098 4100 %------------------------------------------------------------------------ 4099 4101 %pixels per cm and matrix of the image times, read from the .civ file by uvmat 4100 4102 % global civ2Bin sge%name of the executable for checkciv1 calculation 4103 cmd=''; 4101 4104 filename=regexprep(filename,'.nc',''); 4102 4105 if isequal(Param.Civ2.Dt,'0') … … 4107 4110 [fid,errormsg]=fopen([filename '.civ2.cmx'],'w'); 4108 4111 if isequal(fid,-1) 4109 msgbox_uvmat('ERROR',errormsg)4110 cmd='';4111 4112 return 4112 4113 end -
trunk/src/civ_matlab.m
r386 r387 14 14 %INPUT: 15 15 % Param: input images and processing parameters 16 % .Civ1: for civ1 17 % .Fix1: 18 % .Patch1: 19 % .Civ2: for civ2 20 % .Fix2: 21 % .Patch2: 16 22 % ncfile: name of a netcdf file to be created for the result (extension .nc) 17 23 % … … 47 53 48 54 if ischar(Param) 49 Param=xml2struct(Param); 55 Param=xml2struct(Param); %if Param is the name of an xml file, read this file as a Matlab structure 50 56 end 51 57 … … 66 72 end 67 73 else 68 if is char(par_civ1.ImageA)74 if isfield(par_civ1,'ImageA') && ischar(par_civ1.ImageA) % case with no image: only the PIV grid is calculated 69 75 par_civ1.ImageA=sum(imread(par_civ1.ImageA),3); 70 76 end 71 if is char(par_civ1.ImageB)77 if isfield(par_civ1,'ImageB')&& ischar(par_civ1.ImageB) 72 78 par_civ1.ImageB=sum(imread(par_civ1.ImageB),3); 73 79 end … … 245 251 end 246 252 mask=''; 247 if par_civ2.CheckMask&&~isempty(par_civ2. maskname)&& ~strcmp(maskname,par_civ2.maskname)% mask exist, not already read in civ1248 mask=imread(par_civ2. maskname);253 if par_civ2.CheckMask&&~isempty(par_civ2.Mask)&& ~strcmp(maskname,par_civ2.Mask)% mask exist, not already read in civ1 254 mask=imread(par_civ2.Mask); 249 255 end 250 256 par_civ2.Searchx=2*isx2+1; -
trunk/src/filter_tps.m
r382 r387 73 73 % if too few selected vectors, increase the subrange for next iteration 74 74 elseif numel(ind_sel)<SubDomain/4 && ~isequal( ind_sel,ind_sel_previous); 75 SubRange(:,1,isub)=SubRange(:,1,isub)-Siz /4;76 SubRange(:,2,isub)=SubRange(:,2,isub)+Siz /4;75 SubRange(:,1,isub)=SubRange(:,1,isub)-Siz'/4; 76 SubRange(:,2,isub)=SubRange(:,2,isub)+Siz'/4; 77 77 % SubRangy(isub,1)=SubRangy(isub,1)-Siz(2)/4; 78 78 % SubRangy(isub,2)=SubRangy(isub,2)+Siz(2)/4; … … 89 89 ind_ind_sel=find(FF(ind_sel)==0); % select the indices of ind_sel corresponding to the remaining vectors 90 90 end 91 % no value exceeds threshold, the result is recorded91 % if no value exceeds threshold, the result is recorded 92 92 if isequal(numel(ind_ind_sel),numel(ind_sel)) 93 93 U_smooth(ind_sel)=U_smooth(ind_sel)+U_smooth_sub; 94 94 V_smooth(ind_sel)=V_smooth(ind_sel)+V_smooth_sub; 95 95 NbSites(isub)=numel(ind_sel); 96 % Indices_tps(1:NbSites(isub),isub)=ind_sel;97 96 Coord_tps(1:NbSites(isub),:,isub)=Coord(ind_sel,:); 98 % Y_tps(1:NbSites(isub),:,isub)=Coord(ind_sel,2);99 97 U_tps(1:NbSites(isub)+3,isub)=U_tps_sub; 100 98 V_tps(1:NbSites(isub)+3,isub)=V_tps_sub; 101 99 nb_select(ind_sel)=nb_select(ind_sel)+1; 102 100 display('good') 103 101 break 104 %too few selected vectors, increase the subrange for next iteration102 % if too few selected vectors, increase the subrange for next iteration 105 103 elseif numel(ind_ind_sel)<SubDomain/4 && ~isequal( ind_sel,ind_sel_previous); 106 SubRange(:,1,isub)=SubRange(:,1,isub)-Siz/4; 107 SubRange(:,2,isub)=SubRange(:,2,isub)+Siz/4; 108 % SubRange(2,isub,1)=SubRangy(2,isub,1)-Siz(2)/4; 109 % SubRange(2,isub,2)=SubRangy(2,isub,2)+Siz(2)/4; 110 % display('fewsmooth') 111 % interpolation-smoothing is done again with the selected vectors 104 SubRange(:,1,isub)=SubRange(:,1,isub)-Siz'/4; 105 SubRange(:,2,isub)=SubRange(:,2,isub)+Siz'/4; 106 % else interpolation-smoothing is done again with the selected vectors 112 107 else 113 [U_smooth_sub,U_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel) ),U(ind_sel(ind_ind_sel)),rho);114 [V_smooth_sub,V_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel) ),V(ind_sel(ind_ind_sel)),rho);108 [U_smooth_sub,U_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel),:),U(ind_sel(ind_ind_sel)),rho); 109 [V_smooth_sub,V_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel),:),V(ind_sel(ind_ind_sel)),rho); 115 110 U_smooth(ind_sel(ind_ind_sel))=U_smooth(ind_sel(ind_ind_sel))+U_smooth_sub; 116 111 V_smooth(ind_sel(ind_ind_sel))=V_smooth(ind_sel(ind_ind_sel))+V_smooth_sub; -
trunk/src/get_file_type.m
r386 r387 40 40 Data=nc2struct(fileinput,'ListGlobalAttribute','absolut_time_T0','Conventions',... 41 41 'CivStage','patch2','fix2','civ2','patch','fix'); 42 if ~isempty(Data.Txt)42 if isfield(Data,'Txt') && ~isempty(Data.Txt) 43 43 error_nc=1; 44 44 else … … 69 69 end 70 70 if error_nc 71 try 71 72 if exist('VideoReader','file')%recent version of Matlab 72 73 Object=VideoReader(fileinput); … … 76 77 FileType='video'; 77 78 FileInfo.NbFrame=get(Object,'NumberOfFrames'); 79 end 78 80 end 79 81 end -
trunk/src/mouse_down.m
r379 r387 311 311 list_str=get(hhuvmat.ListObject,'String'); 312 312 IndexObj_old=get(hhuvmat.ListObject,'Value'); 313 set(hhuvmat.ListObject,'Value',[IndexObj_old(1) IndexObj] );313 % set(hhuvmat.ListObject,'Value',[IndexObj_old(1) IndexObj] ); 314 314 UvData.Object{IndexObj}.DisplayHandle_uvmat=AxeData.CurrentObject; 315 315 object_name=ObjectData.Name; … … 322 322 end 323 323 set(hhuvmat.ListObject,'String',list_str) 324 set(hhuvmat.ListObject,'Value',[IndexObj_old(1) IndexObj] ); 324 325 UvData.Object{IndexObj}.DisplayHandle_view_field=AxeData.CurrentObject; 325 %list_str{end+1}='...';326 % set(hhuvmat.list_object_2,'String',list_str)327 % if strcmp(fig_tag,'view_field')%we are in view_field plot328 % set(hhuvmat.list_object_1,'Value',IndexObj)% the projection field will be plotted in uvmat frame329 % UvData.Object{IndexObj}.DisplayHandle_uvmat=[];330 % UvData.Object{IndexObj}.DisplayHandle_view_field=AxeData.CurrentObject;331 % else%we are in uvmat plot332 % set(hhuvmat.list_object_2,'Value',IndexObj)333 % UvData.Object{IndexObj}.DisplayHandle_uvmat=AxeData.CurrentObject;334 % UvData.Object{IndexObj}.DisplayHandle_view_field=[];335 % end336 326 set(huvmat,'UserData',UvData) 337 327 PlotData=get(AxeData.CurrentObject,'UserData'); -
trunk/src/mouse_motion.m
r379 r387 245 245 end 246 246 [Data,errormsg,result_conv]= civ_matlab(Param); 247 rangx(1)=-(isx2-ibx2)+shiftx; 248 rangx(2)=isx2-ibx2+shiftx; 249 rangy(1)=-(isy2-iby2)-shifty; 250 rangy(2)=(isy2-iby2)-shifty; 251 hcorr=[]; 252 if isfield(AxeData,'CurrentCorrImage') 253 hcorr=AxeData.CurrentCorrImage; 254 if ~ishandle(hcorr) 255 hcorr=[]; 247 if ~isempty(errormsg) 248 text_displ_4=errormsg; 249 else 250 rangx(1)=-(isx2-ibx2)+shiftx; 251 rangx(2)=isx2-ibx2+shiftx; 252 rangy(1)=-(isy2-iby2)-shifty; 253 rangy(2)=(isy2-iby2)-shifty; 254 hcorr=[]; 255 if isfield(AxeData,'CurrentCorrImage') 256 hcorr=AxeData.CurrentCorrImage; 257 if ~ishandle(hcorr) 258 hcorr=[]; 259 end 256 260 end 257 end 258 if isempty(hcorr) 259 corrfig=findobj(allchild(0),'tag','corrfig'); 260 if ~isempty(corrfig) 261 set(0,'CurrentFigure',corrfig(1)) 262 AxeData.CurrentCorrImage=imagesc(rangx,-rangy,result_conv,[0 1]); 263 AxeData.CurrentVector=line([0 Data.Civ1_U],[0 Data.Civ1_V],'Tag','vector'); 264 colorbar 265 set(haxes,'UserData',AxeData) 266 set(get(AxeData.CurrentCorrImage,'parent'),'YDir','normal') 261 if isempty(hcorr) 262 corrfig=findobj(allchild(0),'tag','corrfig'); 263 if ~isempty(corrfig) 264 set(0,'CurrentFigure',corrfig(1)) 265 AxeData.CurrentCorrImage=imagesc(rangx,-rangy,result_conv,[0 1]); 266 AxeData.CurrentVector=line([0 Data.Civ1_U],[0 Data.Civ1_V],'Tag','vector'); 267 colorbar 268 set(haxes,'UserData',AxeData) 269 set(get(AxeData.CurrentCorrImage,'parent'),'YDir','normal') 270 end 271 else 272 set(AxeData.CurrentCorrImage,'CData',result_conv) 273 set(AxeData.CurrentCorrImage,'XData',rangx) 274 set(AxeData.CurrentCorrImage,'YData',-rangy) 275 set(AxeData.CurrentVector,'XData',[0 Data.Civ1_U],'YData',[0 Data.Civ1_V]) 267 276 end 268 else269 set(AxeData.CurrentCorrImage,'CData',result_conv)270 set(AxeData.CurrentCorrImage,'XData',rangx)271 set(AxeData.CurrentCorrImage,'YData',-rangy)272 set(AxeData.CurrentVector,'XData',[0 Data.Civ1_U],'YData',[0 Data.Civ1_V])273 277 end 274 278 end -
trunk/src/set_object.m
r379 r387 97 97 set(handles.z_slider,'Visible','off') 98 98 end 99 if isfield(data,'TypeMenu') 100 set(handles.Type,'String',data.TypeMenu) 101 end 102 if isfield(data,'ProjModeMenu') 103 % set(handles.ProjMode,'String',data.ProjModeMenu) % data.ProjModeMenu as projMode menu 104 set(handles.ProjMode,'UserData',data.ProjModeMenu)% data.ProjModeMenu as default menu (used in Type_Callback) 105 end 99 106 errormsg=fill_GUI(data,handles); 100 % if isfield(data,'StyleMenu') 101 % set(handles.Type,'String',data.StyleMenu); 102 % end 103 % if isfield(data,'Type') 104 % menu=get(handles.Type,'String'); 105 % for iline=1:length(menu) 106 % if isequal(menu{iline},data.Style) 107 % set(handles.Type,'Value',iline) 108 % break 109 % end 110 % end 111 % end 112 Type_Callback(hObject, eventdata, handles) 113 % if isfield(data,'ProjMenu') 114 % set(handles.ProjMode,'String',data.ProjMenu);%overset the standard menu 115 % end 116 % if isfield(data,'ProjMode') 117 % menu=get(handles.ProjMode,'String'); 118 % for iline=1:length(menu) 119 % if isequal(menu{iline},data.ProjMode) 120 % set(handles.ProjMode,'Value',iline) 121 % break 122 % end 123 % end 124 % end 125 % ProjMode_Callback(hObject, eventdata, handles) 126 % if isfield(data,'Coord') 127 % if ischar(data.Coord) 128 % data.Coord=str2num(data.Coord); 129 % elseif iscell(data.Coord) 130 % CoordCell=data.Coord; 131 % data.Coord=zeros(numel(CoordCell),3); 132 % data.Coord(:,3)=zeros(numel(CoordCell),1); % z component set to 0 by default 133 % for iline=1:numel(CoordCell) 134 % line_vec=str2num(CoordCell{iline}); 135 % if numel(line_vec)==2 136 % data.Coord(iline,1:2)=str2num(CoordCell{iline}); 137 % else 138 % data.Coord(iline,:)=str2num(CoordCell{iline}); 139 % end 140 % end 141 % end 142 % if size(data.Coord,2)>=2 143 % sizcoord=size(data.Coord); 144 % for i=1:sizcoord(1) 145 % XObject{i}=num2str(data.Coord(i,1),4); 146 % YObject{i}=num2str(data.Coord(i,2),4); 147 % end 148 % % set(handles.XObject,'String',XObject) 149 % % set(handles.YObject,'String',YObject) 150 % if sizcoord(2)>3 151 % for i=1:sizcoord(1) 152 % ZObject{i}=num2str(data.Coord(i,3),4); 153 % end 154 % set(handles.ZObject,'String',ZObject) 155 % end 156 % end 157 % end 158 % if isfield(data,'DX') 159 % if ~ischar(handles.num_DX) 160 % data.DX=num2str(data.DX,3); 161 % end 162 % set(handles.num_DX,'String',data.DX) 163 % end 164 % if isfield(data,'DY') 165 % if ~ischar(handles.num_DY) 166 % data.DY=num2str(data.DY,3); 167 % end 168 % set(handles.num_DY,'String',data.DX) 169 % end 107 Type_Callback(hObject, eventdata, handles)% update the GUI set_object depending on the object type 108 170 109 if isfield(data,'RangeZ') && length(ZBounds) >= 2 171 110 set(handles.num_RangeZ_2,'String',num2str(max(data.RangeZ),3)) … … 209 148 set(handles.num_Angle_3,'String',num2str(data.Angle(3))) 210 149 end 211 % if isfield(data,'DZ')212 % if ~ischar(handles.num_DZ)213 % data.DY=num2str(data.DZ,3);214 % end215 % set(handles.num_DZ,'String',data.DZ)216 % end217 % if isfield(data,'CoordUnit')218 % set(handles.CoordUnit,'String',data.CoordUnit)219 % end220 150 end 221 151 if enable_plot … … 234 164 end 235 165 236 237 166 %------------------------------------------------------------------------ 238 167 % --- Outputs from this function are returned to the command line. … … 252 181 % make correspondance between different object styles 253 182 Coord=get(handles.Coord,'Data'); 254 %255 % Xcolumn=get(handles.XObject,'String');256 % Ycolumn=get(handles.YObject,'String');257 % if ischar(Xcolumn)258 % sizchar=size(Xcolumn);259 % for icol=1:sizchar(1)260 % Xcolumn_cell{icol}=Xcolumn(icol,:);261 % end262 % Xcolumn=Xcolumn_cell;263 % end264 % if ischar(Ycolumn)265 % sizchar=size(Ycolumn);266 % for icol=1:sizchar(1)267 % Ycolumn_cell{icol}=Ycolumn(icol,:);268 % end269 % Ycolumn=Ycolumn_cell;270 % end271 % Zcolumn={};%default272 % z_new={};273 % if isequal(get(handles.ZObject,'Visible'),'on')274 % %data.NbDim=3; %test 3D object275 % Zcolumn=get(handles.ZObject,'String');276 % if ischar(Zcolumn)277 % Zcolumn={Zcolumn};278 % end279 % end280 % x_new{1}=Xcolumn{1};281 % y_new{1}=Ycolumn{1};282 % x_new{1}=Coord(1,1);283 % y_new{1}=Coord(1,2);284 % z_new{1}=Coord(1,3);285 % if ~isempty(Zcolumn)286 % z_new{1}=Zcolumn{1};287 % end288 % if isequal(style,'line')289 % if strcmp(style_prev,'rectangle')||strcmp(style_prev,'ellipse')290 % num_RangeX_2=get(handles.num_RangeX_2,'String');291 % num_RangeY_2=get(handles.num_RangeY_2,'String');292 % x_new{2}=num2str(num_RangeX_2,4);293 % y_new{2}=num2str(num_RangeY_2,4);294 % set(handles.XObject,'String',x_new)295 % set(handles.YObject,'String',y_new)296 % set(handles.ZObject,'String',z_new)297 % end298 % elseif isequal(style,'polyline')299 % elseif strcmp(style,'rectangle')|| strcmp(style,'ellipse')300 % set(handles.XObject,'String',x_new)301 % set(handles.YObject,'String',y_new)302 % set(handles.ZObject,'String',z_new)303 % end304 183 305 184 %% set the number of lines in the Coord table depending on object type … … 321 200 322 201 %% set the projection menu and the corresponding options 323 switch Type 324 case {'points','line','polyline','plane'} 325 menu_proj={'projection';'interp';'filter';'none'}; 326 case {'polygon','rectangle','ellipse'} 327 menu_proj={'inside';'outside';'mask_inside';'mask_outside'}; 328 case 'volume' 329 menu_proj={'interp';'none'}; 330 otherwise 331 menu_proj={'projection';'interp';'filter';'none'};%default 332 end 202 if isempty(get(handles.ProjMode,'UserData')) 203 switch Type 204 case {'points','line','polyline','plane'} 205 menu_proj={'projection';'interp';'filter';'none'}; 206 case {'polygon','rectangle','ellipse'} 207 menu_proj={'inside';'outside';'mask_inside';'mask_outside'}; 208 case 'volume' 209 menu_proj={'interp';'none'}; 210 otherwise 211 menu_proj={'projection';'interp';'filter';'none'};%default 212 end 213 else 214 menu_proj=get(handles.ProjMode,'UserData'); 215 end 333 216 proj_index=get(handles.ProjMode,'Value'); 334 if proj_index <numel(menu_proj)217 if proj_index>numel(menu_proj) 335 218 set(handles.ProjMode,'Value',1);% value index must not exceed the menu length 336 219 end -
trunk/src/uvmat.m
r386 r387 2647 2647 end 2648 2648 siz=size(UvData.XmlData{2}.Time); 2649 if siz(1)>=max(num_i1,num_i2) && siz(2)>=max(num_j1,num_j2)2649 if ~isempty(num_i1) && siz(1)>=max(num_i1,num_i2) && siz(2)>=max(num_j1,num_j2) 2650 2650 abstime_1=(UvData.XmlData{2}.Time(num_i1,num_j1)+UvData.XmlData{2}.Time(num_i2,num_j2))/2;%overset the time read from files 2651 2651 end … … 4203 4203 end 4204 4204 end 4205 if isfield(ObjectData,'Coord')&& isfield(ObjectData,' Style')4205 if isfield(ObjectData,'Coord')&& isfield(ObjectData,'Type') 4206 4206 if isequal(ObjectData.Type,'polygon') 4207 4207 X=ObjectData.Coord(:,1); … … 4248 4248 masknumber=num2str(length(list)); 4249 4249 maskindex=get(handles.masklevel,'Value'); 4250 mask_name=fullfile_uvmat(RootPath, SubDir,[RootFile '_' masknumber 'mask'],'.png','_1',maskindex);4250 mask_name=fullfile_uvmat(RootPath,'',[RootFile '_' masknumber 'mask'],'.png','_1',maskindex); 4251 4251 %mask_name=name_generator([filebase '_' masknumber 'mask'],maskindex,1,'.png','_i'); 4252 4252 imflag=uint8(255*(0.392+0.608*flag));% =100 for flag=0 (vectors not computed when 20<imflag<200) … … 4270 4270 end 4271 4271 set(handles.ListObject,'Value',1) 4272 set(handles.ListObject,'Max',1)4272 % set(handles.ListObject,'Max',1) 4273 4273 end 4274 4274 … … 4421 4421 data.TypeMenu={'polygon'}; 4422 4422 data.ProjMode='mask_inside';%default 4423 data.ProjM enu={'mask_inside';'mask_outside'};4423 data.ProjModeMenu={'mask_inside';'mask_outside'}; 4424 4424 create_object(data,handles) 4425 4425 -
trunk/src/view_field.m
r356 r387 73 73 if ~isempty(huvmat) 74 74 hhuvmat=guidata(huvmat); 75 % set(hhuvmat.list_object_2,'Visible','on')76 % set(hhuvmat.view_field_title,'Visible','on')77 % handles_mouse.create=hhuvmat.create;78 75 handles_mouse.edit=hhuvmat.edit_object; 79 76 pos_view_field=get(hObject,'Position');
Note: See TracChangeset
for help on using the changeset viewer.