%% Here we compute SOAM and DM

clear;
close all;
clc;

art = 'C'; % C = carotid or V = vertebralis
side = 'R'; % R = right or L = left
dL = 1; % step size in SOAM-algorithm is held at 1mm                 
med = 'Segm_LB'; % change user ('Segm_LB','Segm_HL')

% change to the patients for date A or B

id_pat={'001B', '002B'};



T = cell(length(id_pat),3);
 
for h=1:length(id_pat)
    [coords,fol_n] = t01_SOAM(art, id_pat{h},med,side); % read the centerline
    if ~isnan(coords)
        [DM,SOAM] = SOAM_Alg(coords,dL); % compute DM and SOAM
        T(h,:) = {id_pat{h}, DM, SOAM};
    end
end

T = T(~any(cellfun('isempty', T), 2), :); % table with DM and SOAM for each patient



