- Timestamp:
- Jun 12, 2012, 8:53:51 PM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r446 r452 2100 2100 detect=exist(filename,'file')==2; 2101 2101 if detect% if a netcdf file already exists 2102 answer=msgbox_uvmat('INPUT_Y-N',['delete files in ' subdir_civ1_new]); 2103 if ~strcmp(answer,'Yes') 2102 answer=msgbox_uvmat('INPUT_Y-N',['overwrite existing civ files in ' subdir_civ1_new]); 2103 if strcmp(answer,'Yes') 2104 detect=0; 2105 filecell.nc.civ1(ifile,j)={filename}; 2106 else 2104 2107 r=regexp(subdir_civ1_new,'(?<root>.*\D)(?<num1>\d+)$','names');%detect whether name ends by a number 2105 2108 if isempty(r) -
trunk/src/civ_matlab.m
r445 r452 51 51 check_civ1=0;%default 52 52 check_patch1=0;%default 53 53 ImageFileA=Param.Civ1.ImageA; 54 ImageFileB=Param.Civ1.ImageB; 55 if isfield(Param,'Civ2') 56 ImageFileA_civ2=Param.Civ2.ImageA; 57 ImageFileB_civ2=Param.Civ2.ImageB; 58 end 54 59 % case of input Param set by an xml file (batch mode) 55 60 if ischar(Param) … … 98 103 else 99 104 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 [Field,ParamOut,errormsg] = read_field( par_civ1.ImageA,par_civ1.FileTypeA,[],par_civ1.FrameIndexA);105 [Field,ParamOut,errormsg] = read_field(ImageFileA,par_civ1.FileTypeA,par_civ1.ImageA,par_civ1.FrameIndexA); 101 106 if ~isempty(errormsg) 102 107 errormsg=['error in civ_matlab/read_field:' errormsg]; … … 106 111 end 107 112 if isfield(par_civ1,'ImageB')&& (ischar(par_civ1.ImageB)||strcmp(class(par_civ1.ImageB),'VideoReader')) 108 [Field,ParamOut,errormsg] = read_field( par_civ1.ImageB,par_civ1.FileTypeB,[],par_civ1.FrameIndexB);113 [Field,ParamOut,errormsg] = read_field(ImageFileB,par_civ1.FileTypeB,par_civ1.ImageB,par_civ1.FrameIndexB); 109 114 if ~isempty(errormsg) 110 115 errormsg=['error in civ_matlab/read_field:' errormsg]; … … 242 247 if ~isfield (Param,'Civ1') || ~strcmp(Param.Civ1.ImageA,par_civ2.ImageA) 243 248 %read first image if not already done for civ1 244 [Field,ParamOut,errormsg] = read_field( par_civ2.ImageA,par_civ2.FileTypeA,[],par_civ2.FrameIndexA);249 [Field,ParamOut,errormsg] = read_field(ImageFileA_civ2,par_civ2.FileTypeA,par_civ2.ImageA,par_civ2.FrameIndexA); 245 250 if ~isempty(errormsg) 246 251 errormsg=['error in civ_matlab/read_field:' errormsg]; … … 253 258 if ~isfield (Param,'Civ1') || ~strcmp(Param.Civ1.ImageB,par_civ2.ImageB) 254 259 %read first image if not already done for civ1 255 [Field,ParamOut,errormsg] = read_field( par_civ2.ImageB,par_civ2.FileTypeB,[],par_civ2.FrameIndexB);260 [Field,ParamOut,errormsg] = read_field(ImageFileB_civ2,par_civ2.FileTypeB,par_civ2.ImageB,par_civ2.FrameIndexB); 256 261 if ~isempty(errormsg) 257 262 errormsg=['error in civ_matlab/read_field:' errormsg]; -
trunk/src/read_field.m
r450 r452 164 164 %% case of image 165 165 if ~isempty(A) 166 if isstruct(ParamOut) 166 167 ParamOut.FieldName='image'; 167 168 ParamOut.FieldList={'image'}; 169 end 168 170 Npz=1;%default 169 171 npxy=size(A); … … 178 180 Field.AY=[npxy(1)-0.5 0.5]; 179 181 Field.AX=[0.5 npxy(2)-0.5]; % coordinates of the first and last pixel centers 182 if isstruct(ParamOut) 180 183 ParamOut.Npx=npxy(2);% display image size on the interface 181 184 ParamOut.Npy=npxy(1); 185 end 182 186 Field.VarAttribute{3}.Mesh=1; 183 187 else … … 188 192 Field.AY=[npxy(2)-0.5 0.5]; 189 193 Field.AX=[0.5 npxy(3)-0.5]; % coordinates of the first and last pixel centers 194 if isstruct(ParamOut) 190 195 ParamOut.Npx=npxy(3);% display image size on the interface 191 196 ParamOut.Npy=npxy(2); 197 end 192 198 Field.VarAttribute{4}.Mesh=1; 193 199 end -
trunk/src/uvmat.m
r450 r452 1458 1458 axes(handles.axes3) 1459 1459 hold on 1460 MaskData.maskhandle=image(Mask.AX,Mask.AY,imflag,'Tag','mask','HitTest','off','AlphaData',0.6*flagmask); 1460 size(flagmask) 1461 % MaskData.maskhandle=image(Mask.AX,Mask.AY,imflag,'Tag','mask','HitTest','off','AlphaData',0.6*flagmask); 1462 MaskData.maskhandle=image(Mask.AX,Mask.AY,imflag,'Tag','mask','HitTest','off','AlphaData',0.6*ones(size(flagmask))); 1461 1463 % set(MaskData.maskhandle,'AlphaData',0.6*flagmask) 1462 1464 set(handles.CheckMask,'UserData',MaskData) … … 2054 2056 end 2055 2057 end 2058 if isstruct (ParamIn) 2056 2059 ParamIn.FieldName=FieldName; 2057 2060 ParamIn.VelType=VelType; 2058 2061 ParamIn.GUIName='get_field'; 2062 end 2059 2063 [Field{1},ParamOut,errormsg] = read_field(FileName,UvData.FileType{1},ParamIn,frame_index); 2060 2064 if ~isempty(errormsg) … … 2186 2190 end 2187 2191 % display the Fields menu from the input file and pick the selected one: 2192 if isstruct(ParamOut) 2188 2193 field_index=strcmp(ParamOut.FieldName,ParamOut.FieldList); 2189 2194 set(handles.Fields,'String',ParamOut.FieldList); %update the field menu 2190 2195 set(handles.Fields,'Value',find(field_index,1)) 2196 end 2191 2197 2192 2198 %% update the display menu for the second velocity type (second menuline) … … 2194 2200 if isempty(FileName_1) 2195 2201 set(handles.Fields_1,'Value',1); %update the field menu 2202 if isstruct(ParamOut) 2196 2203 set(handles.Fields_1,'String',[{''};ParamOut.FieldList]); %update the field menu 2204 end 2197 2205 elseif ~test_keepdata_1 2198 2206 if (~strcmp(UvData.FileType{2},'netcdf')&&~strcmp(UvData.FileType{2},'civdata')&&~strcmp(UvData.FileType{2},'civx'))|| isequal(FieldName_1,'get_field...') … … 2385 2393 2386 2394 %% calculate scalar 2387 if ~strcmp(ParamOut.FieldName,'get_field...')&& (strcmp(UvData.FileType{1},'civdata')||strcmp(UvData.FileType{1},'civx'))%&&~strcmp(ParamOut.FieldName,'velocity')&& ~strcmp(ParamOut.FieldName,'get_field...');% ~isequal(ParamOut.CivStage,0)%&&~isempty(FieldName)%2395 if isstruct(ParamOut)&&~strcmp(ParamOut.FieldName,'get_field...')&& (strcmp(UvData.FileType{1},'civdata')||strcmp(UvData.FileType{1},'civx'))%&&~strcmp(ParamOut.FieldName,'velocity')&& ~strcmp(ParamOut.FieldName,'get_field...');% ~isequal(ParamOut.CivStage,0)%&&~isempty(FieldName)% 2388 2396 Field{1}=calc_field([{ParamOut.FieldName} {ParamOut.ColorVar}],Field{1}); 2389 2397 end 2390 if numel(Field)==2 && ~strcmp(ParamOut_1.FieldName,'get_field...')&& ~test_keepdata_1 && (strcmp(UvData.FileType{2},'civdata')||strcmp(UvData.FileType{2},'civx')) &&~strcmp(ParamOut_1.FieldName,'velocity') && ~strcmp(ParamOut_1.FieldName,'get_field...')2398 if isstruct(ParamOut_1)&& numel(Field)==2 && ~strcmp(ParamOut_1.FieldName,'get_field...')&& ~test_keepdata_1 && (strcmp(UvData.FileType{2},'civdata')||strcmp(UvData.FileType{2},'civx')) &&~strcmp(ParamOut_1.FieldName,'velocity') && ~strcmp(ParamOut_1.FieldName,'get_field...') 2391 2399 Field{2}=calc_field([{ParamOut_1.FieldName} {ParamOut_1.ColorVar}],Field{2}); 2392 2400 end
Note: See TracChangeset
for help on using the changeset viewer.