Basically, a parameter NetCDF file is composed by 3 main sections:
-
Dimensions
-
Variables
-
Correlation mesh:
One defines here, the meshes on which the correlation will be done (grid dimensions, number of dimensions...). Let's use the following python code to estimate the appropriate meshsize : VerifMesh.py
-
Correlation method:
One defines here, the different type of correlation that will be used in the correlation sequence (Metric, Shape functions, Interpolator, parameters...) and the connection with previously defined meshes.
-
Correlation sequence:
One defines here, a sequence of correlation, i.e. a set of correlation methods used, one after one in a pyramidal filter process, to converge toward the required result.
-
-
Data
netcdf DIC_parameter_file { dimensions: dim_sample = UNLIMITED;// Allow adding automatically, correlation field along a "time" or "sample" dimension, function of image_list size. This option doesn't work thus dim_tmp (temporarly) has been added (by default Unlimited - don't change) dim_tmp = 4;// Number of image couple to correlate. If image_list is larger, only dim_tmp correlation will be done. If image_list is smaller a crash will occur after the last correlation. dim_system = 1;// number of image composing the observed field (by default 1 - don't change) dim_camera = 1;// 1 for correlation or more for stereocorrelation (by default 1 - don't change) dim_image = 2;// couple of image to correlate (by default 2 - don't change) dim_string = 180;// image name (by default 180 - don't change except for larger image name) // change only if mod_image dim_mode = 1;//number of image modes plus 1 (1=default) dim_space = 2;//associated dimensions variables: //input_outpout format definition. Different format exist: double_double, float_float, char_float byte format; format:type = "float_float"; //---------------------------Mesh------------------------------ // Only used Meshes (in correlation method) are taken into account // mesh template for local transformation (Block Matching) byte mesh_IC;// give the name you want mesh_IC:path = "none";// for external mesh (not activated yet) mesh_IC:type = "generate_centroid";// mesh are automatically generated on images (at least one node at each image corner) and displacement is calculated at element centroid. (by default "generate_centroid" - don't change) mesh_IC:pitch = 32, 32;// number of pixels between nodes or centroids. (Warning: pitch can be automatically reduced or increased at boundaries depending on image dimensions) mesh_IC:window = 64, 64;// dimension of Elements. Each one is centered around its centroid (warning: according to pitch and window dimensions an overlap can exist: the element overlap is here of 50%) mesh_IC:component = "x,y";// spatial dimensions. (Warning: if 3D, "z" is required as well as a 3rd component on pitch and window) mesh_IC:store_peak = 1;// number of intercorrelation peak to store (usually 3 in PIV) // mesh template for Elastic transformation (local with unity partition - Finite Element Method) byte mesh_OFFEM;// give the name you want mesh_OFFEM:path = "none";// for external mesh (not activated yet) mesh_OFFEM:type = "generate_regularFem";// regular mesh is automatically generated on image (at least one node at each image corner) mesh_OFFEM:pitch = 64, 64;// number of pixels between nodes or element size. In the case of finite element, due to unity partition, pitch = window, contrary to mesh_IC. mesh_OFFEM:component = "x,y";// spatial dimensions. (Warning: if 3D, "z" is required as well as a 3rd component on pitch and window) // mesh template for global transformation (rigid, affine...) byte mesh_OFI; mesh_OFI:path = "none";// for external mesh (not activated yet) mesh_OFI:type = "global";// there is no mesh for global transformation (by default "global" - don't change) mesh_OFI:component = "x,y";// spatial dimensions. (Warning: if 3D, "z" is required) // mesh template for Local transformation (rigid, affine...) byte mesh_OFIB; mesh_OFIB:path = "none";// for external mesh (not activated yet) mesh_OFIB:type = "generate_centroid_integrated";// default for OFIB (don't change) mesh_OFIB:pitch = 16,16;// pitch between two windows mesh_OFIB:window = 16,16;// windows size (in this example overlap = 0%) mesh_OFIB:component = "x,y";// space component (x,y and z-if 3D) //---------------------------Mesh------------------------------ //---------------------------Correlation Method---------------- //example of "Inter-Correlation" method definition byte IC;// Give the name you want IC:type = "IC_fftw";// define the correlation method: "IC_direct", "IC_fftw", "IC_fftw_phase", "IC_fft", "IC_fft_phase" IC:mesh = "mesh_IC";// associate the correlation method and the mesh IC:peak = "interpP";// define the sub-pixel precision strategy: "max", "interpP", "interpG", "interpBiLin", "barycenter" IC:median_filter = 3;// box for median filter [+-(mf-1)/2] in elements IC:store_correlogram = 0;// allow storing the correlogram : 0 = no storage, otherwise correlogram are stored in netcdf format //example of "Optical Flow Integrated" method definition for "Homogenous strain" byte OFI_H; // Give the name you want OFI_H:type = "OFI";// Optical-Flow Integrated OFI_H:mesh = "mesh_OFI";// associated mesh OFI_H:shape = "homogeneous";// assumed kinematics [rigid_body, homogeneous, blade,brasilian,image] OFI_H:modes = "Tx,Ty,Rz,Exx,Eyy,Exy";// desired modes OFI_H:refX = -1;//shape function X reference, -1 = automatic, i.e. system reference at the center of image, otherwise provide location in pix OFI_H:refY = -1;//shape function Y reference, -1 = automatic, i.e. system reference a the center of image, otherwise provide location in pix OFI_H:refZ = -1;//shape function Z reference, -1 = automatic, i.e. system reference a the center of image, otherwise provide location in pix OFI_H:convergence_speed = 1e-3;//convergence criterion (Epsilon_(i+1) - Epsilon(i)<convergence_speed) OFI_H:interpolation_loop = "cubic";//Subpixel interpolation : cubic or linear by default - during iterations OFI_H:interpolation_final = "cubic";//Subpixel interpolation : cubic or linear by default - at the final iteration //example of "Optical Flow Integrated" method definition for "rigid body motion" byte OFI_RB;// Give the name you want OFI_RB:type = "OFI";// Optical-Flow Integrated OFI_RB:mesh = "mesh_OFI";// associated mesh OFI_RB:shape = "rigid_body";// assumed kinematics [rigid_body, homogeneous, blade,brasilian,image] OFI_RB:modes = "Tx,Ty,Rz";// desired modes OFI_RB:refX = -1;//shape function X reference OFI_RB:refY = -1;//shape function Y reference OFI_RB:refZ = -1;//shape function Z reference OFI_RB:convergence_speed = 1e-3;//convergence criterion (Epsilon_(i+1) - Epsilon(i)<convergence_speed) OFI_RB:interpolation_loop = "cubic"; OFI_RB:interpolation_final = "cubic"; //example of "Optical Flow Integrated per block" method definition byte OFIB;// Give the name you want OFIB:type = "OFIB";// Optical-Flow Integrated per Block OFIB:mesh = "mesh_OFIB";// associated mesh OFIB:shape = "rigid_body";// assumed kinematics [rigid_body, homogeneous, blade,brasilian,image] OFIB:modes = "Tx,Ty,Rz";// desired modes OFIB:refX = -1;//shape function X reference OFIB:refY = -1;//shape function Y reference OFIB:refZ = -1;//shape function Z reference OFIB:convergence_speed = 1e-3;//convergence criterion (Epsilon_(i+1) - Epsilon(i)<convergence_speed) OFIB:median_filter = 3;// box for median filter [+-(mf-1)/2] in elements OFIB:interpolation_loop = "cubic";//cubic or linear by default - during iterations OFIB:interpolation_final = "cubic";//cubic or linear by default - at the final iteration //example of "Optical Flow Finite Element Method" method definition byte OFFEM;// Give the name you want OFFEM:type = "OFFEM";// Optical-Flow Finite Element Method OFFEM:mesh = "mesh_OFFEM";// associated mesh OFFEM:method = "gradient";// optimization method - newton (warning : not suitable for large 2D images and 3D images) or gradient OFFEM:alpha0 = 5e-1;// init coef for gradient method OFFEM:shape = "Q4";// assumed kinematics : C8 for 3D OFFEM:convergence_speed = 1e-3;//convergence criterion (Epsilon_(i+1) - Epsilon(i)<convergence_speed) OFFEM:median_filter = 3;// box for median filter [+-(mf-1)/2] in elements OFFEM:iter_max = 100;//max number of authorized iterations : thus calcul stop either if iter_max is reached, if convergence_speed is reached or if the result diverges OFFEM:interpolation_loop = "cubic";//cubic or linear by default - during iterations OFFEM:interpolation_final = "cubic";//cubic or linear by default - at the final iteration //---------------------------Correlation Method---------------- //------------Correlation sequence per image couple------------ byte sequence; sequence:analysis = "OFI_H,OFI_H,OFFEM,OFFEM,OFFEM,OFFEM,OFFEM";//correlation sequence list sequence:filter = 6,5,4,3,2,1,0;//associated pyramidal filter: super-pixel = 2^i x 2^i pix, e.g. i=0 -> 1x1, i=6 -> 64x64 //------------Correlation sequence per image couple------------ //------------------------image list--------------------------- char image_list(dim_sample, dim_tmp, dim_image, dim_string); image_list:type = "File";//image capture from File or on-fly Grab(not activated yet) image_list:mask = "mask.png";// mask name (must be in "path" directory) image_list:mode = 0;// 0:dependent mode (Image sequence) - 1:separate mode (PIV) image_list:path = "./img/";// image location //declare desired outputs and physical pixel size float output; output:display_mode = 0;//Allow a real time field display (not activated yet) output:store_img = 0;//store input data in netcdf format output:store_def = 1;//store the deformed image after deformation output:store_field = 1;//store converged displacement fields on image resolution (Warining: avoid in 3D -> in every cases displacement fields are stored using mesh resolution) output:store_res = 1;//store converged residue fields output:store_strain = 0;//store converged strain field (not activated yet) output:ratio_pxmm = 65;//Allow to output fields in physical units (Warning bug : only put integers, i.e. not 6.5 um but 650 nm for example) output:format = "";//tiff or netcdf default //------------------------image list--------------------------- char mode_img(dim_sample, dim_mode, dim_space, dim_string); //------------------------image list--------------------------- // allocate variables data: format = 1; mesh_IC = 1; mesh_OFIB = 1; mesh_OFI = 1; mesh_OFFEM = 1; IC = 1; OFI_H = 1; OFI_RB = 1; OFIB = 1; OFFEM = 1; sequence =1; image_list = "00000001.jpg", "00000100.jpg", "00000001.jpg", "00000150.jpg", "00000001.jpg", "00000200.jpg", "00000001.jpg", "00000250.jpg"; //only for mod_image: i.e. you have created your own image modes as follows, for example: mode_img = "T.png", "zero.png", "zero.png", "T.png", "Exx.png", "zero.png", "zero.png", "Eyy.png", "Eyy.png", "Exx.png"; }