def run_subject_glm(jobfile, protocol, subject, session=None, smooth=None,
                    lowres=False):
    """ Create jobfile and run it """
    if protocol == 'preferences' and subject in ['sub-11']:
        jobfile = 'ini_files/IBC_preproc_preferences_sub-11.ini'
    output_name = os.path.join(
        '/tmp', os.path.basename(jobfile)[:-4] + '_%s.ini' % subject)
    _adapt_jobfile(jobfile, subject, output_name, session)
    list_subjects_update = generate_glm_input(output_name, smooth, lowres)
    clean_anatomical_images(IBC)
    if lowres:
        mask_img = '../ibc_data/gm_mask_3mm.nii.gz'
    else:
        mask_img = '../ibc_data/gm_mask_1_5mm.nii.gz'

    for subject in list_subjects_update:
        subject['onset'] = [onset for onset in subject['onset']
                            if onset is not None]
        clean_subject(subject)
        if len(subject['session_id']) > 0:
            if protocol == 'clips4':
                first_level(subject, compcorr=True,
                            additional_regressors=RETINO_REG,
                            smooth=smooth, mask_img=mask_img)
            else:
                first_level(subject, compcorr=True, smooth=smooth,
                            mask_img=mask_img)
                fixed_effects_analysis(subject, mask_img=mask_img)
Example #2
0
def run_subject_surface_glm(jobfile, subject, session, protocol, lowres=False):
    """ Create jobfile and run it """
    output_name = os.path.join(
        '/tmp',
        os.path.basename(jobfile)[:-4] + '_%s.ini' % subject)
    _adapt_jobfile(jobfile, subject, output_name, session)
    list_subjects_update = generate_glm_input(output_name, lowres)
    clean_anatomical_images(IBC)
    for subject in list_subjects_update:
        clean_subject(subject)
        if len(subject['session_id']) > 0:
            print(len(subject['session_id']))
        if len(subject['session_id']) > 0:
            #if protocol == 'retino':
            #    first_level(subject, compcorr=True,
            #                additional_regressors=RETINO_REG,
            #                smooth=None, surface=True)
            #else:
            first_level(subject, compcorr=True, smooth=None, surface=True)
            fixed_effects_analysis(subject, surface=True, lowres=True)