Changeset 444
- Timestamp:
- Jun 7, 2012, 9:56:19 AM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r441 r444 3958 3958 Data.ListVarName={'ny','nx','A'}; 3959 3959 Data.VarDimName= {'ny','nx',{'ny','nx'}}; 3960 3960 3961 Data.A=imread(filecell.ima1.civ1{1}); % read the first image 3961 3962 if ndims(Data.A)==3 %case of color image … … 3966 3967 Data.CoordUnit='pixel';% used to set equal scaling for x and y in image dispaly 3967 3968 par_civ1=read_GUI(handles.Civ1); 3969 par_civ1.FileTypeA=get_file_type(filecell.ima1.civ1{1}); 3968 3970 par_civ1.ImageWidth=size(Data.A,2); 3969 3971 par_civ1.ImageHeight=size(Data.A,1); -
trunk/src/civ_matlab.m
r437 r444 97 97 end 98 98 else 99 if isfield(par_civ1,'ImageA')%&&(ischar(par_civ1.ImageA)||strcmp(class(par_civ1.ImageA),'VideoReader')) % case with no image: only the PIV grid is calculated 100 99 if isfield(par_civ1,'ImageA')&&(ischar(par_civ1.ImageA)||strcmp(class(par_civ1.ImageA),'VideoReader')) % case with no image: only the PIV grid is calculated 101 100 [Field,ParamOut,errormsg] = read_field(par_civ1.ImageA,par_civ1.FileTypeA,[],par_civ1.FrameIndexA); 102 101 if ~isempty(errormsg) … … 106 105 par_civ1.ImageA=Field.A;%= image matrix A in the first input field 107 106 end 108 if isfield(par_civ1,'ImageB') %&& (ischar(par_civ1.ImageB)||strcmp(class(par_civ1.ImageA),'VideoReader'))107 if isfield(par_civ1,'ImageB')&& (ischar(par_civ1.ImageB)||strcmp(class(par_civ1.ImageA),'VideoReader')) 109 108 [Field,ParamOut,errormsg] = read_field(par_civ1.ImageB,par_civ1.FileTypeB,[],par_civ1.FrameIndexB); 110 109 if ~isempty(errormsg) -
trunk/src/geometry_calib.m
r379 r444 234 234 % testhandle=1; 235 235 RootPath=get(hhuvmat.RootPath,'String'); 236 RootFile=get(hhuvmat.RootFile,'String'); 237 filebase=fullfile(RootPath,RootFile); 238 outputfile=[filebase '.xml'];%xml file associated with the currently displayed image 236 SubDir=get(hhuvmat.SubDir,'String'); 237 % RootFile=get(hhuvmat.RootFile,'String'); 238 % filebase=fullfile(RootPath,RootFile); 239 outputfile=[fullfile(RootPath,SubDir) '.xml'];%xml file associated with the currently displayed image 239 240 else 240 241 question={'save the calibration data and point coordinates in'}; -
trunk/src/mouse_up.m
r432 r444 55 55 %% finalize the fabrication or the translation/deformation of an object and plot the corresponding projected field 56 56 if ~isempty(huvmat) && isfield(AxeData,'Drawing') && ~isequal(AxeData.Drawing,'off') && isfield(AxeData,'CurrentObject')... 57 57 && ~isempty(AxeData.CurrentObject) && ishandle(AxeData.CurrentObject) 58 58 xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 59 PlotData=get(AxeData.CurrentObject,'UserData');%get data attached to the current projection object 59 PlotData=get(AxeData.CurrentObject,'UserData');%get data attached to the current projection object 60 60 IndexObj=PlotData.IndexObj; 61 ObjectData=UvData.Object{IndexObj}; 62 % ObjectData.enable_plot=1; 63 if strcmp(ObjectData.Type,'rectangle')||strcmp(ObjectData.Type,'ellipse') 64 NbDefPoint=1; 65 elseif strcmp(ObjectData.Type,'line')|| strcmp(ObjectData.Type,'plane'); 66 NbDefPoint=2; 67 else 68 NbDefPoint=3; 69 end 61 ObjectData=UvData.Object{IndexObj}; 62 check_multiple=0; 70 63 % ending translation 71 64 if isequal(AxeData.Drawing,'translate') … … 82 75 ObjectData.Coord(ind_move,2)=xy(1,2); 83 76 84 %creating object 85 else 77 %creating object 78 else 86 79 switch ObjectData.Type 87 80 case {'line'} … … 91 84 xy(1,3)=0; % z coordinate set to 0 by default 92 85 end 93 % if ~isequal(ObjectData.Coord,xy(1,:))94 86 % if ~isequal(ObjectData.Coord,xy(1,:)) 87 if ~isequal(ObjectData.Coord(end,1:2),xy(1,1:2)) 95 88 ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the second point of the line if different from the first one 96 97 % end89 end 90 % end 98 91 case {'rectangle','ellipse','volume'} 99 92 XYData=AxeData.CurrentOrigin; … … 112 105 end 113 106 end 107 otherwise 108 check_multiple=1; 114 109 end 115 110 end … … 123 118 set(hh_set_object.num_RangeY_2,'String',num2str(ObjectData.RangeY,4)); 124 119 end 125 if NbDefPoint<=2 || isequal(get(currentfig,'SelectionType'),'alt') ||... 126 strcmp(AxeData.Drawing,'translate') || strcmp(AxeData.Drawing,'deform');%stop drawing 120 121 %stop drawing and plot projected field if the object manipulation is finished 122 if check_multiple==0 || isequal(get(currentfig,'SelectionType'),'alt') 127 123 AxeData.CurrentOrigin=[]; %suppress the current origin 128 if isequal(ObjectData.Type,'line') && size(ObjectData.Coord,1)>=2 129 AxeData.Drawing='off'; 130 set(currentaxes,'UserData',AxeData); 131 % return % line needs at leqst two points 132 end 133 if ~isempty(ObjectData) 134 % testmask=0; 135 % hmask=findobj(huvmat,'Tag','makemask'); 136 % if ~isempty(hmask) 137 % testmask=get(hmask,'Value'); 138 % end 139 140 %% update the object representation 141 % ObjectData.DisplayHandle_uvmat=UvData.Object{IndexObj}.DisplayHandle_uvmat; 142 % ObjectData.DisplayHandle_view_field=UvData.Object{IndexObj}.DisplayHandle_view_field; 143 % UvData.Object{IndexObj}=ObjectData;%update the current object properties 144 % hhuvmat=guidata(huvmat); 145 % IndexObj_1=get(hhuvmat.ListObject_1,'Value'); 146 % IndexObj_2=get(hhuvmat.ListObject,'Value'); 147 % UvData.Object=update_obj(UvData,IndexObj_1,IndexObj_2); 148 149 %% plot the field projected on the object 124 % if isequal(ObjectData.Type,'line') && size(ObjectData.Coord,1)>=2 125 % % AxeData.Drawing='off'; 126 % % set(currentaxes,'UserData',AxeData); 127 % 128 % end 129 if ~isempty(ObjectData) 130 % testmask=0; 131 % hmask=findobj(huvmat,'Tag','makemask'); 132 % if ~isempty(hmask) 133 % testmask=get(hmask,'Value'); 134 % end 135 136 % plot the field projected on the object 150 137 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData 151 138 if ~isempty(ProjData) 152 139 if strcmp(tagfig,'uvmat')% uvmat plot selected, projection plot seen in view_field 153 140 hview_field=findobj(allchild(0),'tag','view_field'); 154 141 if isempty(hview_field) 155 142 hview_field=view_field(ProjData); %open the view_field GUI for plot … … 160 147 end 161 148 ViewFieldData=get(hview_field,'UserData'); 162 % ViewFieldData.axes3=ProjData;149 % ViewFieldData.axes3=ProjData; 163 150 haxes=findobj(hview_field,'tag','axes3'); 164 151 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Coordinates)% case of no plot display (pure text table) … … 172 159 set(hview_field,'Position',ViewFieldData.GUISize) 173 160 end 174 175 % Data=get(hview_field,'UserData');176 % if isempty(hview_field)177 % hview_field=view_field(ProjData);178 % else179 % hhview_field=guidata(hview_field);180 % [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%update an existing field plot181 % write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object182 % end183 % ViewFieldData=get(hview_field,'UserData');184 % ViewFieldData.axes3=ProjData;185 % set(hview_field,'UserData',ViewFieldData)186 161 else 187 162 UvData.axes3=ProjData; … … 189 164 write_plot_param(hhuvmat,PlotParam); %update the display of plotting parameters for the current object 190 165 end 191 %[PlotType,PlotParam]=plot_field(ProjData,hh_plotfield.axes3,read_plot_param(hh_plotfield));%update an existing field plot192 193 166 end 194 167 set(hhuvmat.ViewField,'Value',1);% … … 199 172 set(hhuvmat.MenuEdit,'Enable','on');% 200 173 end 201 e nd202 AxeData.CurrentOrigin=[xy(1,1) xy(1,2)]; %the current point becomes the new current origin203 test_drawing=1;%allow continuation of drawing object204 UvData.Object{IndexObj}=ObjectData;205 % end 174 else 175 test_drawing=1;%allow continuation of drawing object 176 AxeData.CurrentOrigin=[xy(1,1) xy(1,2)]; %the current point becomes the next current origin 177 end 178 UvData.Object{IndexObj}=ObjectData; 206 179 hother=findobj('Tag','deformpoint');%find all the deformpoints 207 set(hother,'Color','b');%reset all the deformpoints in 'blue' 208 else 209 test_drawing=0; 180 set(hother,'Color','b');%reset all the deformpoints in 'blue' 210 181 end 211 182 -
trunk/src/uvmat.m
r441 r444 1359 1359 errormsg='no file browsed'; 1360 1360 end 1361 [RootDir,tild,RootFile,tild,tild,tild,tild,tild,Mask.NomType]=fileparts_uvmat(maskname); 1362 % [RootDir,RootFile,x1,x2,xa,xb,xext,Mask.NomType]=name2display(maskname); 1363 Mask.Base=fullfile(RootDir,RootFile); 1361 [RootDir,SubDir,RootFile,tild,tild,tild,tild,tild,Mask.NomType]=fileparts_uvmat(maskname); 1362 Mask.Base=fullfile(RootDir,SubDir,RootFile); 1364 1363 Mask.NbSlice=1; 1365 1364 set(handles.CheckMask,'UserData',Mask); … … 1398 1397 [RootPath,RootFile]=fileparts(MaskData.Base); 1399 1398 MaskName=fullfile_uvmat(RootPath,'',RootFile,'.png',MaskData.NomType,num_i1_mask,[],num_j1); 1400 %MaskName=name_generator(MaskData.Base,num_i1_mask,num_j1,'.png',MaskData.NomType);1401 % huvmat=get(handles.CheckMask,'parent');1402 1399 UvData=get(handles.uvmat,'UserData'); 1403 1400 %update mask image if the mask is new … … 4716 4713 %mask name 4717 4714 RootPath=get(handles.RootPath,'String'); 4715 SubDir=get(handles.SubDir,'String'); 4718 4716 RootFile=get(handles.RootFile,'String'); 4719 4717 if ~isempty(RootFile)&&(isequal(RootFile(1),'/')|| isequal(RootFile(1),'\')) 4720 4718 RootFile(1)=[]; 4721 4719 end 4722 filebase=fullfile(RootPath,RootFile);4720 % filebase=fullfile(RootPath,RootFile); 4723 4721 list=get(handles.masklevel,'String'); 4724 4722 masknumber=num2str(length(list)); 4725 4723 maskindex=get(handles.masklevel,'Value'); 4726 mask_name=fullfile_uvmat(RootPath,'',[RootFile '_' masknumber 'mask'],'.png','_1',maskindex);4727 %mask_name=name_generator([filebase '_' masknumber 'mask'],maskindex,1,'.png','_i');4724 % mask_name=fullfile_uvmat(RootPath,'',[RootFile '_' masknumber 'mask'],'.png','_1',maskindex); 4725 mask_name=fullfile_uvmat(RootPath,[SubDir '.mask'],'mask','.png','_1',maskindex); 4728 4726 imflag=uint8(255*(0.392+0.608*flag));% =100 for flag=0 (vectors not computed when 20<imflag<200) 4729 4727 imflag=flipdim(imflag,1); … … 4740 4738 mask_dir=fileparts(answer); 4741 4739 if ~exist(mask_dir,'dir') 4742 msgbox_uvmat('ERROR',['directory ' mask_dir ' does not exist']) 4743 return 4740 [xx,msg1]=mkdir(mask_dir); 4741 if ~strcmp(msg1,'') 4742 errormsg=['cannot create ' mask_dir ': ' msg1];%error message for directory creation 4743 return 4744 end 4744 4745 end 4745 4746 imwrite(imflag,answer,'BitDepth',8); 4746 4747 end 4747 4748 set(handles.ListObject,'Value',1) 4748 % set(handles.ListObject,'Max',1)4749 4749 end 4750 4750
Note: See TracChangeset
for help on using the changeset viewer.