AFNI QC Rápido - neuropsytox/Documentation GitHub Wiki
AFNI QC Rápido
Este tutorial es para realizar un control de calidad inicial de tus datos de rsfMRI o task fMRI usando AFNI.
Crear un folder individual para QC, yo cree uno llamado afniqc.
Dentro, puedes correr los comandos, o mi preferencia es crear un pequeño script, que llamé afniqc:
ap_run_simple_rest.tcsh -subjid sub-603.qc \
-run_proc -nt_rm 2 \
-anat $curso/data_00_basic/sub-603/ses-01/anat/sub-603_ses-01_run-01_T1w.nii.gz \
-epi $curso/data_00_basic/sub-603/ses-01/func/sub-603_ses-01_task-rest_run-01_bold.nii.gz
El comando ap_run_simple_rest.tcsh es muy sencillo pero puede modificarse:
------------------------------------------------------------------------------
ap_run_simple_rest.tcsh - run a quick afni_proc.py analysis for QC
usage: ap_run_simple_rest.tcsh [options] -anat ANAT -epi EPI1 EPI2 EPI3 ...
This program is meant to run a moderately quick single subject analysis,
treating the EPI as resting state data.
Overview:
0. This program will change over time. Do not rely on a fixed version.
See "ap_run_simple_rest.tcsh -ver" for the current version number.
1. Output files are placed in the current directory, so it is suggested
to run from a "clean" location, generally away from the raw inputs.
2. Template registration is merely affine, to be fast.
3. By default, the first 2 time points are removed as pre-steady state.
It is a good idea to set -nt_rm appropriately.
inputs : anat (optional), EPI
controls : recommended opts: -subjid, -nt_rm
outputs : run_ap_SUBJID - afni_proc.py command script
: proc.SUBJID -_proc script (if AP is run)
: SUBJID.results - proc results dir (if run)
: out.* - text output files from AP and proc scripts
This program may be devoured by afni_proc.py itself, at some point.
------------------------------------------------------------------------------
example 0: just create an afni_proc.py script, run_ap_SUBJ, no data required
ap_run_simple_rest.tcsh -anat anat.nii -epi epi.nii
example 1: quickly process EPI (no anat, so no align/tlrc blocks)
ap_run_simple_rest.tcsh -epi epi.nii -run_proc
example 2: preferred - run an analysis from a clean directory
cd AFNI_data6/FT_analysis
mkdir test.ap
cd test.ap
ap_run_simple_rest.tcsh -subjid ft.qc \
-run_proc -nt_rm 2 \
-anat ../FT/FT_anat+orig \
-epi ../FT/FT_epi_r*.HEAD
------------------------------------------------------------------------------
terminal options:
-help : show this help
-hist : show the program history
-ver : show the version number
required parameters:
-epi EPI_r1 EPI_r2 ... : specify a list of EPI datasets
optional parameters:
-anat ANAT : specify single anatomical dataset
-nt_rm NT : num time points to remove from starts of runs
def: 2
-run_ap : actually run the afni_proc.py command
def: do not, just generate AP command script
-run_proc : do the processing (run the proc script from AP)
def: do not run AP or proc script
-subjid SUBJ_ID : specify subject ID for file names
def: SUBJ
-template TEMPLATE : specify template for standard space
def: MNI152_2009_template_SSW.nii.gz
-compressor COMP : control automatic compression of *.BRIK files.
'COMP' must be one of the allowed keywords for
the AFNI_COMPRESSOR environment variable:
GZIP COMPRESS BZIP2 PIGZ
and you must have the associated program for
compression installed (e.g., 'gzip')
def: not set here
-verb VERB : specify verbosity level (3 == -echo)
def: 1
-echo : set 'echo' in the shell, as if run via 'tcsh -x'
(same as '-verb 3')
------------------------------------------------------------------------------
R Reynolds Apr, 2021
version 0.6
------------------------------------------------------------------------------
Lo importante es saber que el template se puede modificar.
Si se quieren hacer roedores u otros animales, es necesario agregar el -template TEMPLATE y quitar del script -run_proc para que no corra completo.
Al correrlo va a crear el script final, y en ese hay que modificar el -blur a algo que sea para ratas por ejemplo (0.5 en lugar de 6 o 0 incluso).
Se corre el script afniqc, yo lo hago usando bash afniqc. En mi computadora y con estos datos tarda 1 hora y media por sujeto aproximadamente.
Al terminar nos da un folder, en este caso sub-603.qc.results. Dentro, hay que buscar el folder QC_sub-603.qc y el archivo index.html que tiene el resumen de información.
Para abrirlo correctamente, se utiliza el comando:
open_apqc.py -infiles QC_sub-603.qc/index.html
Al abrirlo, podemos interactuar con la pagina y los cambios se guardan.