function run_parcellation(hemi)

back = pwd;

if upper(hemi)=='R'
    
    %===========================
    % R_frontal
    %===========================
    cd results/parcellation/R_frontal/
    % make R_frontal to R_hemisphere dconn.nii
    crop_dconn('../../../data/dconn/R_hemisphere_R_hemisphere.dconn.nii', 'R_frontal.func.gii','R_frontal_R_hemisphere.dconn.nii' , 'seed', 'R');
    % run AP clustering on R_frontal
    ap_cluster_dconn('R_frontal_R_hemisphere.dconn.nii', 'R_frontal.func.gii', 'R');
    
    %===========================
    % R_parietal
    %===========================
    cd ../R_parietal/
    % make R_parietal to R_hemisphere dconn.nii
    crop_dconn('../../../data/dconn/R_hemisphere_R_hemisphere.dconn.nii', 'R_parietal.func.gii','R_parietal_R_hemisphere.dconn.nii' , 'seed', 'R');
    % run AP clustering on R_parietal
    ap_cluster_dconn('R_parietal_R_hemisphere.dconn.nii', 'R_parietal.func.gii', 'R');
    
elseif upper(hemi)=='L'
    
    %===========================
    % L_frontal
    %===========================
    cd results/parcellation/L_frontal/
    % make L_frontal to L_hemisphere dconn.nii
    crop_dconn('../../../data/dconn/L_hemisphere_L_hemisphere.dconn.nii', 'L_frontal.func.gii','L_frontal_L_hemisphere.dconn.nii' , 'seed', 'L');
    % run AP clustering on L_frontal
    ap_cluster_dconn('L_frontal_L_hemisphere.dconn.nii', 'L_frontal.func.gii', 'L');
    
    %===========================
    % L_parietal
    %===========================
    cd ../L_parietal/
    % make L_parietal to L_hemisphere dconn.nii
    crop_dconn('../../../data/dconn/L_hemisphere_L_hemisphere.dconn.nii', 'L_parietal.func.gii','L_parietal_L_hemisphere.dconn.nii' , 'seed', 'L');
    % run AP clustering on L_parietal
    ap_cluster_dconn('L_parietal_L_hemisphere.dconn.nii', 'L_parietal.func.gii', 'L');
    
end

cd(back);

end