Changeset 435 for trunk/src/civ.m
Legend:
- Unmodified
- Added
- Removed
-
trunk/src
- Property svn:ignore
-
old new 4 4 XML_SCHEMAS 5 5 bin 6 check_files.m 6 7 toolbox_calib 7 8 uvmat_doc
-
- Property svn:ignore
-
trunk/src/civ.m
r427 r435 1 1 2 %'civ': function associated with the interface 'civ.fig' for PIV, spline interpolation and stereo PIV (patch) 2 3 %------------------------------------------------------------------------ … … 63 64 t=xmltree(xmlfile); 64 65 sparam=convert(t); 65 catch 66 errormsg={' Unable to read the file PARAM.xml defining the civx binaries:'; lasterr};66 catch ME 67 errormsg={' Unable to read the file PARAM.xml defining the civx binaries:';ME.message}; 67 68 end 68 69 else … … 409 410 % end 410 411 switch FileType 411 case {'image','multimage','video' }412 case {'image','multimage','video','mmreader'} 412 413 otherwise 413 414 errormsg='invalid input file: enter an image, a movie or civ .nc file'; … … 1059 1060 1060 1061 1061 %-------------- ----------------------------------------------------------1062 %--------------orm---------------------------------------------------------- 1062 1063 % --- Main lauch command, called by RUN and BATCH 1063 1064 function errormsg=launch_jobs(hObject, eventdata, handles, batch) … … 1227 1228 if ~strcmp(CivMode,'CivX') 1228 1229 if Param.CheckCiv1 1229 [Param.Civ1.FileTypeA,FileInfo,Param.Civ1.ImageA]=get_file_type(filecell.ima1.civ1{1});1230 [Param.Civ1.FileTypeB,FileInfo,Param.Civ1.ImageB]=get_file_type(filecell.ima2.civ1{1});1230 [Param.Civ1.FileTypeA,FileInfo,Param.Civ1.ImageA]=get_file_type(filecell.ima1.civ1{1}); 1231 [Param.Civ1.FileTypeB,FileInfo,Param.Civ1.ImageB]=get_file_type(filecell.ima2.civ1{1}); 1231 1232 end 1232 1233 if Param.CheckCiv2 1233 [Param.Civ2.FileTypeA,FileInfo,Param.Civ2.ImageA]=get_file_type(filecell.ima1.civ2{1});1234 [Param.Civ2.FileTypeB,FileInfo,Param.Civ2.ImageB]=get_file_type(filecell.ima2.civ2{1});1234 [Param.Civ2.FileTypeA,FileInfo,Param.Civ2.ImageA]=get_file_type(filecell.ima1.civ2{1}); 1235 [Param.Civ2.FileTypeB,FileInfo,Param.Civ2.ImageB]=get_file_type(filecell.ima2.civ2{1}); 1235 1236 end 1236 1237 end … … 1271 1272 if Param.CheckCiv1 1272 1273 % read image-dependent parameters 1273 Param.Civ1.ImageA=filecell.ima1.civ1{ifile,j}; 1274 Param.Civ1.ImageB=filecell.ima2.civ1{ifile,j}; 1274 1275 1275 if ~checkframe% && size(time,1)>=i2_civ1(ifile) && size(time,2)>=j2_civ1(j) 1276 1276 Param.Civ1.Dt=(time(i2_civ1(ifile)+1,j2_civ1(j)+1)-time(i1_civ1(ifile)+1,j1_civ1(j)+1)); … … 1280 1280 Param.Civ1.Time=((time(i2_civ1(ifile)+1,j2_civ1(j)+1)+time(i1_civ1(ifile)+1,j1_civ1(j)+1))/2); 1281 1281 if strcmp(CivMode,'CivX') 1282 Param.Civ1.term_a=num2stra(j1_civ1(j),nom_type_nc);%UTILITE? 1283 Param.Civ1.term_b=num2stra(j2_civ1(j),nom_type_nc);% 1284 end 1285 form=imformats(regexprep(get(handles.ImaExt,'String'),'^.',''));%look for image formats 1286 if isempty(form) 1287 ImageInfo=get(VideoReader(filecell.ima1.civ1{1,1})); 1282 Param.Civ1.term_a=num2stra(j1_civ1(j),nom_type_nc);%UTILITE? 1283 Param.Civ1.term_b=num2stra(j2_civ1(j),nom_type_nc);% 1284 end 1285 if strcmp(Param.Civ1.FileTypeA,'video')|| strcmp(Param.Civ1.FileTypeA,'mmreader') 1286 % ImageInfo=get(VideoReader(fullfile(Param.RootPath,[Param.RootFile Param.ImaExt]))); 1287 ImageInfo=get(Param.Civ1.ImageA); 1288 % elseif strcmp(Param.Civ1.FileTypeA,'mmreader') 1289 % ImageInfo=get(mmreader(fullfile(Param.RootPath,[Param.RootFile Param.ImaExt]))); 1288 1290 Param.Civ1.ImageBitDepth=ImageInfo.BitsPerPixel/3; 1291 if batch 1292 Param.Civ1.ImageA=filecell.ima1.civ1{ifile,j};%file name must be used for batch instead of video object 1293 Param.Civ1.ImageB=filecell.ima2.civ1{ifile,j}; 1294 end 1289 1295 else 1296 Param.Civ1.ImageA=filecell.ima1.civ1{ifile,j}; 1297 Param.Civ1.ImageB=filecell.ima2.civ1{ifile,j}; 1298 form=imformats(regexprep(get(handles.ImaExt,'String'),'^.',''));%look for image formats 1290 1299 ImageInfo=imfinfo(filecell.ima1.civ1{1,1});%read the first image to get the size 1291 1300 Param.Civ1.ImageBitDepth=ImageInfo.BitDepth; 1292 1301 end 1302 1293 1303 Param.Civ1.ImageWidth=ImageInfo.Width; 1294 1304 Param.Civ1.ImageHeight=ImageInfo.Height; 1295 Param.Civ1. i1=i1_civ1(ifile);1296 Param.Civ1. i2=i2_civ1(ifile);1297 % read mask parameters1305 Param.Civ1.FrameIndexA=i1_civ1(ifile); 1306 Param.Civ1.FrameIndexB=i2_civ1(ifile); 1307 % read mask )parameters 1298 1308 if Param.Civ1.CheckMask % the lines below should be changed with the new gui 1299 1309 if ~exist(Param.Civ1.Mask,'file') … … 1312 1322 i1_grid=mod(i1_civ1(ifile)-1,nbslice_grid)+1; 1313 1323 Param.Civ1.Grid=[filecell.filebase '_' fullfile_uvmat('','',Param.Civ1.Grid,'.grid','_1',i1_grid)]; 1314 % Param.Civ1.Grid=[filecell.filebase '_' name_generator(Param.Civ1.Grid,i1_grid,1,'.grid','_i')];1324 % Param.Civ1.Grid=[filecell.filebase '_' name_generator(Param.Civ1.Grid,i1_grid,1,'.grid','_i')]; 1315 1325 if ~exist(Param.Civ1.GridName,'file') 1316 1326 errormsg='grid file absent for civ1'; … … 1424 1434 end 1425 1435 if Param.CheckCiv2==1 1426 Param.Civ2.ImageA=filecell.ima1.civ2{ifile,j}; 1427 Param.Civ2.ImageB=filecell.ima2.civ2{ifile,j}; 1436 if strcmp(Param.Civ2.FileTypeA,'video')|| strcmp(Param.Civ2.FileTypeA,'mmreader') 1437 % ImageInfo=get(VideoReader(fullfile(Param.RootPath,[Param.RootFile Param.ImaExt]))); 1438 ImageInfo=get(Param.Civ2.ImageA); 1439 % elseif strcmp(Param.Civ1.FileTypeA,'mmreader') 1440 % ImageInfo=get(mmreader(fullfile(Param.RootPath,[Param.RootFile Param.ImaExt]))); 1441 Param.Civ2.ImageBitDepth=ImageInfo.BitsPerPixel/3; 1442 if batch 1443 Param.Civ2.ImageA=filecell.ima1.civ2{ifile,j};%file name must be used for batch instead of video object 1444 Param.Civ2.ImageB=filecell.ima2.civ2{ifile,j}; 1445 end 1446 else 1447 Param.Civ2.ImageA=filecell.ima1.civ2{ifile,j}; 1448 Param.Civ2.ImageB=filecell.ima2.civ2{ifile,j}; 1449 form=imformats(regexprep(get(handles.ImaExt,'String'),'^.',''));%look for image formats 1450 ImageInfo=imfinfo(filecell.ima1.civ2{1,1});%read the first image to get the size 1451 Param.Civ2.ImageBitDepth=ImageInfo.BitDepth; 1452 end 1453 1428 1454 if ~checkframe %&& size(time,1)>=i2_civ2(ifile) && size(time,2)>=j2_civ2(j) 1429 1455 Param.Civ2.Dt=time(i2_civ2(ifile)+1,j2_civ2(j)+1)-time(i1_civ2(ifile)+1,j1_civ2(j)+1); … … 1463 1489 form=imformats(regexprep(get(handles.ImaExt,'String'),'^.',''));%look for image formats 1464 1490 if isempty(form) 1465 ImageInfo=get(VideoReader(filecell.ima1.civ2{1,1}));1491 % ImageInfo=get(VideoReader(fullfile()); 1466 1492 Param.Civ2.ImageBitDepth=ImageInfo.BitsPerPixel/3; 1467 1493 else … … 1471 1497 Param.Civ2.ImageWidth=ImageInfo.Width; 1472 1498 Param.Civ2.ImageHeight=ImageInfo.Height; 1473 Param.Civ2.i1=i1_civ2(ifile); 1474 Param.Civ2.i2=i2_civ2(ifile); 1499 Param.Civ2.FrameIndexA=i1_civ2(ifile); 1500 Param.Civ2.FrameIndexB=i2_civ2(ifile); 1501 % Param.Civ2.i1=i1_civ2(ifile); 1502 % Param.Civ2.i2=i2_civ2(ifile); 1475 1503 switch CivMode 1476 1504 case 'CivX' … … 4000 4028 par_civ1.ImageHeight=size(Data.A,1); 4001 4029 par_civ1.Mask='all';% will provide only the grid set for PIV, no image correlation 4002 par_civ1. i1=i1;4003 par_civ1. i2=i2;4030 par_civ1.FrameIndexA=num2str(i1); 4031 par_civ1.FrameIndexB=num2str(i2); 4004 4032 Param.Civ1=par_civ1; 4005 4033 Grid=civ_matlab(Param);% get the grid of x, y positions set for PIV
Note: See TracChangeset
for help on using the changeset viewer.