ME-ICA / ME-ICA/open-multi-echo-data
Finalize `afni_proc.py` settings
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
@handwerkerd do you have any recommendations for running `afni_proc.py` on multi-echo data? Is there a way to ensure that the outputs are roughly similar to BIDS format?
Here's a copy from the help (feel free to edit as you wish):
```tcsh
#!/bin/tcsh
# --------------------------------------------------
# note fixed top-level directories
set data_root = /main/location/of/all/data
set input_root = $data_root/scanner_data
set output_root = $data_root/subject_analysis
# --------------------------------------------------
# get a list of subjects, or just use one (consider $argv)
cd $input root
set subjects = ( subj* )
cd -
# or perhaps just process one subject?
set subjects = ( subj_017 )
# --------------------------------------------------
# process all subjects
foreach subj_id ( $subjects )
# --------------------------------------------------
# note input and output directories
set subj_indir = $input_root/$subj_id
set subj_outdir = $output_root/$subj_id
# --------------------------------------------------
# if output dir exists, this subject has already been processed
if ( -d $subj_outdir ) then
echo "** results dir already exists, skipping subject $subj_id"
continue
endif
# --------------------------------------------------
# otherwise create the output directory, write an afni_proc.py
# command to it, and fire it up
mkdir -p $subj_outdir
cd $subj_outdir
# create a run.afni_proc script in this directory
cat > run.afni_proc << EOF
# notes:
# - consider different named inputs (rather than OutBrick)
# - verify how many time points to remove at start (using 5)
# - note which template space is preferable (using MNI)
# - consider non-linear alignment via -tlrc_NL_warp
# - choose blur size (using FWHM = 4 mm)
# - choose basis function (using BLOCK(2,1), for example)
# - assuming 4 CPUs for linear regression
# - afni_proc.py will actually run the proc script (-execute)
afni_proc.py -subj_id $subj_id \
-blocks tshift align tlrc volreg blur mask regress \
-copy_anat $subj_indir/anat+orig \
-dsets \
$subj_indir/epi_r1+orig \
$subj_indir/epi_r2+orig \
$subj_indir/epi_r3+orig \
-tcat_remove_first_trs 5 \
-align_opts_aea -cost lpc+ZZ \
-tlrc_base MNI152_2009_template.nii.gz \
-tlrc_NL_warp \
-volreg_align_to MIN_OUTLIER \
-volreg_align_e2a \
-volreg_tlrc_warp \
-blur_size 4.0 \
-regress_motion_per_run \
-regress_censor_motion 0.3 \
-regress_reml_exec -regress_3dD_stop \
-regress_stim_times \
$stim_dir/houses.txt \
$stim_dir/faces.txt \
$stim_dir/doughnuts.txt \
$stim_dir/pizza.txt \
-regress_stim_labels \
house face nuts za \
-regress_basis 'BLOCK(2,1)' \
-regress_opts_3dD \
-jobs 4 \
-gltsym 'SYM: house -face' -glt_label 1 H-F \
-gltsym 'SYM: nuts -za' -glt_label 2 N-Z \
-regress_est_blur_errts \
-blocks tshift align tlrc volreg mask combine blur scale regress \
-dsets_me_echo epi_run*_echo_01.nii \
-dsets_me_echo epi_run*_echo_02.nii \
-dsets_me_echo epi_run*_echo_03.nii \
-echo_times 15 30.5 41 \
-mask_epi_anat yes \
-combine_method OC
-execute
EOF
# EOF terminates the 'cat > run.afni_proc' command, above
# (it must not be indented in the script)
# now run the analysis (generate proc and execute)
tcsh run.afni_proc
# end loop over subjects
end
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the embedded tcsh example and review the afni_proc.py options for multi-echo inputs, echo times, combining, and output organization. Read the 14-comment thread for existing recommendations; the work is done when the settings and any BIDS-format guidance are finalized in the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100