The files mask.m and maskpolyg.m provide a way of masking out a region of your flow after all the calculations have been performed. Ideally this should be done before processing to save calculation time, but this feature will probably take a while before is included in MatPIV.
The first step is to create a mask based on the image:
[mask,Xverti,Yverti]=mask(Image1,worldcofile);.This will make an image pop up and the user should define the polygon that should be excluded from the measurements. This is done using the left mouse button and the session is ended by pressing the right button. A file called polymask.mat will be saved automatically and should be used as input to maskpolyg.m when processing the velocity fields:
>> [x,y,u,v]=maskpolyg(x,y,u,v,'polymask.mat');.Alternatively one can use the vectors [Xverti,Yverti] as input directly:
>> [x,y,u,v]=maskpolyg(x,y,u,v,[Xverti,Yverti]);.