From e63f066263ffd8462ddce2256bf0523d6d2cedf9 Mon Sep 17 00:00:00 2001 From: jlefortbesnard Date: Tue, 13 Feb 2024 16:18:24 +0100 Subject: [PATCH] add first level 27SS --- narps_open/pipelines/team_27SS.firstlevel | 52 +---------- narps_open/pipelines/team_6VV2.firstlevel | 107 ++++++++++++++++++++++ 2 files changed, 112 insertions(+), 47 deletions(-) create mode 100644 narps_open/pipelines/team_6VV2.firstlevel diff --git a/narps_open/pipelines/team_27SS.firstlevel b/narps_open/pipelines/team_27SS.firstlevel index 9d1ba399..0531f48d 100755 --- a/narps_open/pipelines/team_27SS.firstlevel +++ b/narps_open/pipelines/team_27SS.firstlevel @@ -5,17 +5,10 @@ # version afni used by the team: AFNI 18.3.12 # version afni used by the reproducibility team: AFNI Version 23.0.02 Commodus -# Store arguments (directory where to store results, subjects list, directory where data are stored) -set expdir="$1" # /home/jlefortb/narps_open_pipelines/data/results/team_27SS_afni/firstlevel/ -set subject="$2" # sub-001 -set datadir="$3" # /home/jlefortb/narps_open_pipelines/data/original/ds001734/ - # In a terminal, path /home/jlefortb/narps_open_pipelines, run: # /home/jlefortb/narps_open_pipelines/narps_open/pipelines/team_27SS.firstlevel /home/jlefortb/narps_open_pipelines/data/results/team_27SS_afni/firstlevel/, sub-001, /home/jlefortb/narps_open_pipelines/data/original/ds001734/ - - # Store arguments (directory where to store results, subjects list, directory where data are stored) set expdir="$1" set subject="$2" @@ -23,84 +16,49 @@ set datadir="$3" afni_proc.py \ - # Spécification du script de sortie -script ${expdir}/proc.${subject}.block \ - # Autoriser l'écrasement du script existant -scr_overwrite \ - # Spécification de l'identifiant du sujet -subj_id ${subject} \ - # Spécification du répertoire de sortie -out_dir ${expdir}/${subject}.results.block \ - # Spécification des ensembles de données EPI -dsets ${datadir}/${subject}/func/${subject}_task-MGT_run-01_bold.nii.gz \ ${datadir}/${subject}/func/${subject}_task-MGT_run-02_bold.nii.gz \ ${datadir}/${subject}/func/${subject}_task-MGT_run-03_bold.nii.gz \ ${datadir}/${subject}/func/${subject}_task-MGT_run-04_bold.nii.gz \ - # Copie de l'image anatomique -copy_anat ${datadir}/${subject}/anat/${subject}_T1w.nii.gz \ - # Spécification de la présence du crâne dans l'image anatomique -anat_has_skull yes \ - # Blocs de prétraitement inclus dans le pipeline -blocks despike tshift align tlrc volreg blur mask scale regress \ - # Option de déspike -despike_new yes \ - # Spécification de la base TLRC -tlrc_base MNI152_T1_2009c+tlrc \ - # Specify blur size -blur_size 6.0 \ - # Options d'alignement -align_opts_aea \ - # Déplacement géant -giant_move \ - # Coût de l'alignement -cost lpc+ZZ \ - # Options for temporal shift -tshift_opts_ts -quintic \ - # Alignement des volumes EPI sur l'outlier minimal -volreg_align_to MIN_OUTLIER \ - # Interpolation method for volume registration -volreg_interp cubic \ - # Alignement EPI vers anatomique -volreg_align_e2a \ - # Flou dans le masque automatique -blur_in_automask \ - # Model motion per run -regress_motion_per_run \ - # Censor motion outliers with framewise displacement greater than 1.5 mm -regress_censor_motion 1.5 \ - # Specify the regressors and their corresponding labels -regress_stim_times \ ${datadir}/${subject}/func/times+gain.1D \ ${datadir}/${subject}/func/times+loss.1D \ - -regress_stim_labels task nuisance \ - # Modélisation des régresseurs de stimulus + -regress_stim_types AM2 \ + -regress_stim_labels \ + GAIN \ + LOSS \ -regress_basis 'BLOCK(4,1)' \ - # Application du masque anatomique -mask_apply anat \ - # Options supplémentaires pour 3dDeconvolve -regress_opts_3dD \ -GOFORIT 8 \ -jobs 6 \ -ortvec ${datadir}/${subject}/func/motion_parameters.1D motion_params \ -allzero_OK \ - # Application des types de mouvement pour la régression -regress_apply_mot_types demean \ - # Censure des premiers TRs -regress_censor_first_trs 3 \ - # Estimation des erreurs de flou - # Estimate the blur epochs -regress_est_blur_epits \ - # Estimate the blur error times -regress_est_blur_errts \ - # Exécution du pipeline directement après création du script TCSH - - # No gradient distortion correction specified - # No distortion correction specified - # No intensity correction specified - # No intensity normalization specified - # No spatial smoothing specified - # Execute the pipeline script -# -execute + # -execute # # extract beta values # 3dbucket -prefix GAIN ${expdir}/${subject}.results.block/stats.sub-001+tlrc.BRIK[3] diff --git a/narps_open/pipelines/team_6VV2.firstlevel b/narps_open/pipelines/team_6VV2.firstlevel new file mode 100644 index 00000000..e7d89ce7 --- /dev/null +++ b/narps_open/pipelines/team_6VV2.firstlevel @@ -0,0 +1,107 @@ +#!/bin/tcsh + +# created by team 6VV2, reproduced by Narps reproducibility team +# creation date: 22 June 2023 +# read and ran by team_6VV2.py script +# version afni used by the team : AFNI Version 19.0.01 Tiberius +# version afni used by the reproducibility team :AFNI Version 23.0.02 Commodus +# Last update: June 2023 + + +# exemple run: +# In a terminal, path /home/jlefortb/narps_open_pipelines, run: +# tcsh /home/jlefortb/narps_open_pipelines/narps_open/pipelines/team_6VV2.firstlevel /home/jlefortb/narps_open_pipelines/data/results/team_6VV2_afni/firstlevel/, sub-001, /home/jlefortb/narps_open_pipelines/data/original/ds001734/ + + + + +# Store arguments (directory where to store results, subjects list, directory where data are stored) +set expdir="$1" +set subject="$2" +set datadir="$3" + + +afni_proc.py \ + -script ${expdir}/proc.${subject}.block \ + -scr_overwrite \ + -subj_id ${subject} \ + -out_dir ${expdir}/${subject}.results.block \ + -dsets ${datadir}/${subject}/func/${subject}_task-MGT_run-01_bold.nii.gz \ + ${datadir}/${subject}/func/${subject}_task-MGT_run-02_bold.nii.gz \ + ${datadir}/${subject}/func/${subject}_task-MGT_run-03_bold.nii.gz \ + ${datadir}/${subject}/func/${subject}_task-MGT_run-04_bold.nii.gz \ + -copy_anat ${datadir}/${subject}/anat/${subject}_T1w.nii.gz \ + -anat_has_skull yes \ + -blocks despike tshift align tlrc volreg blur mask scale regress \ + -despike_new yes \ + -tlrc_base MNI152_T1_2009c+tlrc \ + -tlrc_NL_warp \ + -align_opts_aea \ + -giant_move \ + -cost lpc+ZZ \ + -volreg_align_to MIN_OUTLIER \ + -volreg_tlrc_warp \ + -volreg_align_e2a \ + -blur_in_automask \ + -regress_stim_times \ + ${datadir}/${subject}/func/times+gain.1D \ + ${datadir}/${subject}/func/times+loss.1D \ + -regress_stim_types AM2 \ + -regress_stim_labels \ + GAIN \ + LOSS \ + -regress_basis \ + 'BLOCK(4,1)' \ + -mask_apply anat \ + -regress_motion_per_run \ + -test_stim_files no \ + -regress_opts_3dD \ + -GOFORIT 8 \ + -jobs 6 \ + -regress_censor_motion 0.2 \ + -regress_apply_mot_types demean deriv \ + -regress_censor_first_trs 3 \ + -regress_est_blur_errts \ + # -execute + + +# # extract beta values +# 3dbucket -prefix GAIN ${expdir}/${subject}.results.block/stats.sub-001+tlrc.BRIK[3] +# 3dbucket -prefix LOSS ${expdir}/${subject}.results.block/stats.sub-001+tlrc.BRIK[8] + +# # convert BRIK to nii +# 3dAFNItoNIFTI -prefix GAIN ${subject}_GAIN+tlrc +# 3dAFNItoNIFTI -prefix LOSS ${subject}_LOSS+tlrc + + + +# run this file with "tcsh 6VV2_afni_proc.simple" + +# create 1D stimuli file : +# import pandas as pd + +# df_run1 = pd.read_csv("/home/jlefortb/narps_open_pipelines/data/original/ds001734/sub-001/func/sub-001_task-MGT_run-01_events.tsv", sep="\t") +# df_run1 = df_run1[["onset", "gain", "loss"]].T +# df_run2 = pd.read_csv("/home/jlefortb/narps_open_pipelines/data/original/ds001734/sub-001/func/sub-001_task-MGT_run-02_events.tsv", sep="\t") +# df_run2 = df_run2[["onset", "gain", "loss"]].T +# df_run3 = pd.read_csv("/home/jlefortb/narps_open_pipelines/data/original/ds001734/sub-001/func/sub-001_task-MGT_run-03_events.tsv", sep="\t") +# df_run3 = df_run3[["onset", "gain", "loss"]].T +# df_run4 = pd.read_csv("/home/jlefortb/narps_open_pipelines/data/original/ds001734/sub-001/func/sub-001_task-MGT_run-04_events.tsv", sep="\t") +# df_run4 = df_run4[["onset", "gain", "loss"]].T + +# df_gain = pd.DataFrame(index=range(0,4), columns=range(0,64)) +# df_gain.loc[0] = ["{}*{}".format(df_run1[col].loc['onset'], df_run1[col].loc['gain']) for col in range(0, 64)] +# df_gain.loc[1] = ["{}*{}".format(df_run2[col].loc['onset'], df_run2[col].loc['gain']) for col in range(0, 64)] +# df_gain.loc[2] = ["{}*{}".format(df_run3[col].loc['onset'], df_run3[col].loc['gain']) for col in range(0, 64)] +# df_gain.loc[3] = ["{}*{}".format(df_run4[col].loc['onset'], df_run4[col].loc['gain']) for col in range(0, 64)] +# df_loss = pd.DataFrame(index=range(0,4), columns=range(0,64)) +# df_loss.loc[0] = ["{}*{}".format(df_run1[col].loc['onset'], df_run1[col].loc['loss']) for col in range(0, 64)] +# df_loss.loc[1] = ["{}*{}".format(df_run2[col].loc['onset'], df_run2[col].loc['loss']) for col in range(0, 64)] +# df_loss.loc[2] = ["{}*{}".format(df_run3[col].loc['onset'], df_run3[col].loc['loss']) for col in range(0, 64)] +# df_loss.loc[3] = ["{}*{}".format(df_run4[col].loc['onset'], df_run4[col].loc['loss']) for col in range(0, 64)] + + +# df_gain.to_csv('/home/jlefortb/narps_open_pipelines/data/original/ds001734/sub-001/func/times+gain.1D', +# sep='\t', index=False, header=False) +# df_loss.to_csv('/home/jlefortb/narps_open_pipelines/data/original/ds001734/sub-001/func/times+loss.1D', +# sep='\t', index=False, header=False)