function [dim_strats,dim_eps, PssPs3dimvar,PssPs4dimvar,PssPs5dimvar,epsvar_dim,stratvar_dim] = get_dim_strats(PssPs3_match,PssPs4_match,PssPs5_match, normpow3_dim, normpow4_dim, normpow5_dim, ind_common_match, epsvar_match, stratvar_match, numruns)
%Searches through all stratigraphy distributions that match the bright
%region (epsvar_match, stratvar_match) and determines how closely each individual stratigraphy matches reflections 
%OUTSIDE of bright region (metric). Using the most closely matching scenario from each
%distribution, creates new distributions representing reflections from that same stratigraphy outside
%the bright region.

[metric] = match_metric(PssPs3_match, PssPs4_match, PssPs5_match, normpow3_dim, normpow4_dim, normpow5_dim);

[~,scenario_num] = min(metric);

for ii=1:length(scenario_num)
    ii
    strat_ind = ind_common_match(ii);
    stratmat = stratvar_match{strat_ind};
    epsmat = epsvar_match{strat_ind};
    dim_strats{ii} = stratmat(:,scenario_num(ii));
    dim_eps{ii} = epsmat(:,scenario_num(ii));
    [~,~,~,PssPs3dimvar(:,ii),PssPs4dimvar(:,ii),PssPs5dimvar(:,ii),epsvar_dim{ii},stratvar_dim{ii}] = strat_vary_analysis(dim_eps{ii}, dim_strats{ii}, numruns);

end

end