function anon_pairwise_registration_test(iter)

anon = 1;
SD_atlas = CreateEmptyAtlas('lh');
parms = SD_atlas.parms;

if(anon)
    parms.subject_cell = {'sub01' 'sub02' 'sub03' 'sub04' 'sub05' 'sub06' 'sub07' 'sub08' 'sub09' 'sub10' ...
                          'sub11' 'sub12' 'sub13' 'sub14' 'sub15' 'sub16' 'sub17' 'sub18' 'sub19' 'sub20' ...
                          'sub21' 'sub22' 'sub23' 'sub24' 'sub25' 'sub26' 'sub27' 'sub28' 'sub29' 'sub30' ... 
                          'sub31' 'sub32' 'sub33' 'sub34' 'sub35' 'sub36' 'sub37' 'sub38' 'sub39'};
    parms.SUBJECTS_DIR = '/autofs/space/tensor_017/users/thomas/AnonBuckner39/';
    iter = '10';
else
    parms.SUBJECTS_DIR = '/autofs/space/tensor_017/users/thomas/ManualLabeled/';
end
parms.unfoldBool = 0;

for i = 1:38
    
    if(anon)
        mris_SD_pairwise_register(fullfile(parms.SUBJECTS_DIR, parms.subject_cell{i+1}, 'surf', 'lh.sphere'), ...
            fullfile(parms.SUBJECTS_DIR, parms.subject_cell{i}, 'surf', 'lh.sphere'), ...
            fullfile('./output/', ...
            ['lh_MatlabSphericalDemons_' parms.subject_cell{i} 'To' parms.subject_cell{i+1} '.reg']), iter);
    else
        mris_SD_pairwise_register(fullfile(parms.SUBJECTS_DIR, parms.subject_cell{i+1}, 'surf', 'lh.sphere'), ...
            fullfile(parms.SUBJECTS_DIR, parms.subject_cell{i}, 'surf', 'lh.sphere'), ...
            fullfile(parms.SUBJECTS_DIR, parms.subject_cell{i+1}, 'surf', ...
            ['lh.MatlabSphericalDemons_' iter '_' parms.subject_cell{i} 'To' parms.subject_cell{i+1} '.reg']), iter);
        
        parms.SUBJECT = parms.subject_cell{i+1};
        parms.surf_filename = ['MatlabSphericalDemons_' iter '_' parms.subject_cell{i} 'To' parms.subject_cell{i+1} '.reg'];
        parms.metric_surf_filename = 'white';
        parms.annot_filename = 'aparc_edited.annot';
        fixed_subject = MARS2_readSbjMesh(parms);
        fixed_subject.metricVerts = fixed_subject.metricVerts/fixed_subject.surface_scaling_factor;
        weights = MARS_computeWeightsOfMeshVertices(fixed_subject, 'metric');

        parms.SUBJECT = parms.subject_cell{i};
        parms.surf_filename = 'sphere';
        parms.metric_surf_filename = 'white';
        parms.annot_filename = 'aparc_edited.annot';
        moving_subject = MARS2_readSbjMesh(parms);
        moving_subject.metricVerts = moving_subject.metricVerts/moving_subject.surface_scaling_factor;

        OutputLabels = MARS_NNInterpolate(fixed_subject.vertices, moving_subject, moving_subject.MARS_label);

        [temp, dice_overall(i)] = MARS_computeDice(fixed_subject, OutputLabels, 1, weights);

        save(['pairwise_dice.' iter '.mat'], 'dice_overall');
    end
end

