Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
mp_cell_tracking/finding_true_num_2D.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19 lines (15 sloc)
741 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [dis_min, true_num] = finding_true_num_2D(p0,p_s) | |
% ========================================================================= | |
% sub function called by iterative particle reconstruction | |
% determine the true particle in the original volume | |
% that the reconstructed particle corresponds to. | |
% by Tianqi Guo, Aug 2017 | |
% ========================================================================= | |
% calculate the distance in x, y, z the reconstructed particle with | |
% all the true particles in the original volume | |
du_i = (p0(:,1) - p_s(ones(size(p0,1),1),1)); | |
dv_i = (p0(:,2) - p_s(ones(size(p0,1),1),2)); | |
% finding the closest true particle and return the distance | |
g_t = sum([du_i dv_i].^2,2).^0.5; | |
[dis_min, true_num] = min(g_t); | |
end |