SIM_ICP2 - kpmoorse/sim_reg GitHub Wiki
SR = sim_icp2(scene, scn_im, model, mdl_im, varargin)
Core function implementing similarity-weighted ICP
Take as inputs:
- scene [Mx2 numeric array]: point cloud containing the centroids of all neuron footprints in the anatomical image
- scn_im [MxN numeric array]: image containing raw fluorescence data from the anatomical image
- model [Mx2 numeric array]: point cloud containing the centroids of all neuron footprints in the functional image
- mdl_im [MxN numeric array]: image containing raw fluorescence data from the functional stack, averaged over the time dimension
- varargin:
- Num_iters [int > 0]: maximum number of iterations of ICP to run before quitting (ICP will quit automatically if registration stops improving); default is 10
- Lambda [0 <= num]: constrained least squares parameter, lambda=0 is unconstrained (currently non-functional for l>0); default is 0
- T_init [3x3 numeric array]: initial guess for transformation matrix; default is identity
- Trim [0 <= num <= 1]: proportion of points to utilize in the each ICP iteration (the rest are ignored); default is 0.75
- Order [0 <= int]: maximum order of Zernike moments to calculate for image similarity; default is 20
- Simfun [string]: function used for generating a similarity value from two zernike moment vectors; default is 'vcorr'
Begin by pre-calculating Zernike moments, via ZERN2, up to the specified order for a local region defined by SUBMASK around each point in the model and scene clouds. Since each order
contains
moments, calculation time is roughly proportional to the square of the maximum order.
Run ICP algorithm
- Approximate point correspondences via nearest neighbor search
- Calculate similarity for corresponding points via VCORR or MINFO
- Generate weight matrix from similarity values
- Trim (ignore) points whose correspondences have high Euclidean distance error in point cloud space
- Calculate rigid transform
- Repeat above steps for the specified number of iterations
Manually check correspondence per model point
- Display overlaid registered images, as well as SUBMASK regions and moment comparisons for the current point
- Prompt user to accept, reject, or adjust the correspondence
- Repeat for all model points