function make_matrices_for_dice

project_dir = pwd;

%==========================================================================
% min(S)
%==========================================================================
cd supplementary_material/dice_coeff_numk_does_not_matter/R_frontal_minS
load('R_frontal_minS.mat')
seed_exemplars = original_ind(cluster_centres);
clearvars -except seed_exemplars project_dir

cd ../R_parietal_pref/
load('R_parietal_pref.mat')
target_exemplars = original_ind(exemplars_pos_parietal);
clearvars -except seed_exemplars target_exemplars project_dir

dconn_file = [project_dir '/data/dconn/R_hemisphere_R_hemisphere.dconn.nii'];
cd([project_dir '/supplementary_material/dice_coeff_numk_does_not_matter/dice_coefficient'])

make_hierarchy_matrix(dconn_file, seed_exemplars, target_exemplars, 'minS_data_hierarchy_F40_P15');

cd(project_dir)
clearvars -except project_dir

%==========================================================================
% median(S)
%==========================================================================
cd supplementary_material/dice_coeff_numk_does_not_matter/R_frontal_medianS
load('R_frontal_medianS.mat')
seed_exemplars = original_ind(cluster_centres);
clearvars -except seed_exemplars project_dir

cd ../R_parietal_pref/
load('R_parietal_pref.mat')
target_exemplars = original_ind(exemplars_pos_parietal);
clearvars -except seed_exemplars target_exemplars project_dir

dconn_file = [project_dir '/data/dconn/R_hemisphere_R_hemisphere.dconn.nii'];
cd([project_dir '/supplementary_material/dice_coeff_numk_does_not_matter/dice_coefficient'])

make_hierarchy_matrix(dconn_file, seed_exemplars, target_exemplars, 'medianS_data_hierarchy_F67_P15');

cd(project_dir)
clearvars -except project_dir

%==========================================================================
% pref := min(S)-(max(S)-min(S))
%==========================================================================
cd supplementary_material/dice_coeff_numk_does_not_matter/R_frontal_pref
load('R_frontal_pref.mat')
seed_exemplars = original_ind(exemplars_frontal);
clearvars -except seed_exemplars project_dir

cd ../R_parietal_pref/
load('R_parietal_pref.mat')
target_exemplars = original_ind(exemplars_pos_parietal);
clearvars -except seed_exemplars target_exemplars project_dir

dconn_file = [project_dir '/data/dconn/R_hemisphere_R_hemisphere.dconn.nii'];
cd([project_dir '/supplementary_material/dice_coeff_numk_does_not_matter/dice_coefficient'])

make_hierarchy_matrix(dconn_file, seed_exemplars, target_exemplars, 'pref_data_hierarchy_F26_P15');

cd(project_dir)

end