From b5cbe60c9915d0b93c8c6c5456722bc31da9efd8 Mon Sep 17 00:00:00 2001 From: Teun Hujiben Date: Fri, 4 Dec 2020 23:49:24 +0100 Subject: [PATCH] fully documented all matlab functions with comments --- matlab_functions/alignClasses.m | 7 +------ matlab_functions/all2all_class.m | 6 ++---- matlab_functions/one2all_class.m | 4 ++-- matlab_functions/outlier_removal_class.m | 13 +++---------- 4 files changed, 8 insertions(+), 22 deletions(-) diff --git a/matlab_functions/alignClasses.m b/matlab_functions/alignClasses.m index 11ab49c..d0eaa7d 100644 --- a/matlab_functions/alignClasses.m +++ b/matlab_functions/alignClasses.m @@ -20,12 +20,7 @@ % Output: % superParticle_class: the resulting fused particle % -% NOTE: -% First, the function concatenates all the particles as they are. -% Then, each particle is extracted from the stack and registered to -% the rest. This is done until all particles are registered to the -% rest. Once done, the whole process is iterated iter times. - +% % (C) Copyright 2017 QI Group % All rights reserved Faculty of Applied Physics % Delft University of Technology diff --git a/matlab_functions/all2all_class.m b/matlab_functions/all2all_class.m index 17ad349..46e5ce5 100644 --- a/matlab_functions/all2all_class.m +++ b/matlab_functions/all2all_class.m @@ -1,14 +1,12 @@ -% all2all performs all 2 all registration for a given set of particles +% all2all_class performs all2all registration for a given set of particles % % SYNOPSIS: -% all2all(Particles, outdir, scale) +% all2all_class(Particles, scale) % % INPUT % Particles % Cell arrays of particles with localization in the point field and % squared uncertainties in the sigma field. -% outdir -% Output directory where rows of all2all matrix are stored % scale % scale parameter for gmm registration % diff --git a/matlab_functions/one2all_class.m b/matlab_functions/one2all_class.m index ec7c376..852e963 100644 --- a/matlab_functions/one2all_class.m +++ b/matlab_functions/one2all_class.m @@ -19,7 +19,7 @@ % superParticle % % NOTE: -% This function is essentially equivalent to 'one2allm, but without +% This function is essentially equivalent to 'one2all.m', but without % saving the outputFirst, the function concatenates all the particles % as they are. Then, each particle is extracted from the stack and % registered to the rest. This is done until all particles are @@ -34,7 +34,7 @@ % % Teun Huijben, Dec 2020. -function [superParticle, MT,Particles] = one2all_class(Particles, iter, oldM, scale) +function [superParticle, MT, Particles] = one2all_class(Particles, iter, oldM, scale) disp('Bootstapping is started !'); initParticle.points = []; diff --git a/matlab_functions/outlier_removal_class.m b/matlab_functions/outlier_removal_class.m index 92b9256..08cc8c2 100644 --- a/matlab_functions/outlier_removal_class.m +++ b/matlab_functions/outlier_removal_class.m @@ -10,14 +10,15 @@ % Cell array of particles of size 1xN % Results % Structure outputted by all2all_class +% members +% Cell array where each cell contains a vector with the indices +% of the images that belong to one class % % Output: % initAlginedParticles: the aligned particles after outlier removal % M_new: Transformation parameters (rotation+translation), a 4x4xN % matrix where N is the number of particles. % -% NOTE: -% % % (C) Copyright 2017 QI Group % All rights reserved Faculty of Applied Physics @@ -33,20 +34,12 @@ disp('Lie-algebraic averaging started !'); path_matlab = genpath('Optimization'); addpath(path_matlab) -% cvx_solver mosek; -% cvx_solver % initialization RM = zeros(4,4,1); I = zeros(2,1); iter = 1; - % load all2all registration matrix rows from file -% allRows = dir(all2all_dir); -% allNames = {allRows(~[allRows.isdir]).name}; -% allNames = natsortfiles(allNames); -% nRows = numel(allNames); - % stack all relative motion parameteres in RM for j=1:size(Results,1)