AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
May 27, 2009 05:16PM
Hi,

I have been using afni_proc.py to generate AFNI scripts (which has worked great, by the way), and I am trying to censor large changes in motion individually, instead of adding in the motion files as regressors.

However, the output from 3dvolreg appears to be giving underestimates of the actual motion. Attached is the output from 1dplot -sepscl -volreg dfile.rall.1D. I would expect there to be at least some motion greater than a millimeter (which I would censor in 3dDeconvolve), but it appears as though there is almost no motion at all. Am I somehow looking at this incorrectly?

Here is the code up until and including 3dvolreg:

#!/usr/bin/env tcsh

echo "auto-generated by afni_proc.py, Fri May 22 11:34:09 2009"
echo "(version 1.33, Dec 10, 2008)"

# execute via : tcsh -x AndyScript |& tee output.AndyScript

# --------------------------------------------------
# script setup

#the user may specify a single subject to run with
if ( $#argv > 0 ) then
set subj = $argv[1]
else
set subj = JULY10_2007A
endif
#
## assign output directory name
set output_dir = $subj.results
#
## verify that the results directory does not yet exist
if ( -d $output_dir ) then
echo output dir "$subj.results" already exists
exit
endif

cd $subj

# set list of runs
set runs = (`count -digits 2 1 7`)
#
## create results directory
mkdir $output_dir

# create stimuli directory, and copy stim files
mkdir $output_dir/stimuli
cp dPass4_n.1D dPass6_n.1D dPass8_n.1D dTake4_n.1D dTake6_n.1D dTake8_n.1D \
out_take_bad.1D out_take_both.1D out_take_good.1D out_take_none.1D \
out_pass_bad.1D out_pass_both.1D out_pass_good.1D out_pass_none.1D \
$output_dir/stimuli

#Convert NIFTI files to AFNI format
3dcopy s002.nii s001a001
3dcopy s003.nii s002a001
3dcopy s004.nii s003a001
3dcopy s005.nii s004a001
3dcopy s006.nii s005a001
3dcopy s007.nii s006a001
3dcopy s008.nii s007a001

foreach run ( $runs )
3drefit -TR 2s s0{$run}a001+orig
end

#
## -------------------------------------------------------
## apply 3dTcat to copy input dsets to results dir, while
## removing the first 5 TRs
3dTcat -prefix $output_dir/pb00.$subj.r01.tcat s001a001+orig'[5..$]'
3dTcat -prefix $output_dir/pb00.$subj.r02.tcat s002a001+orig'[5..$]'
3dTcat -prefix $output_dir/pb00.$subj.r03.tcat s003a001+orig'[5..$]'
3dTcat -prefix $output_dir/pb00.$subj.r04.tcat s004a001+orig'[5..$]'
3dTcat -prefix $output_dir/pb00.$subj.r05.tcat s005a001+orig'[5..$]'
3dTcat -prefix $output_dir/pb00.$subj.r06.tcat s006a001+orig'[5..$]'
3dTcat -prefix $output_dir/pb00.$subj.r07.tcat s007a001+orig'[5..$]'

# and enter the results directory
cd $output_dir
#
## -------------------------------------------------------
## run 3dToutcount and 3dTshift for each run
foreach run ( $runs )
3dToutcount -automask pb00.$subj.r$run.tcat+orig > outcount_r$run.1D

3dTshift -tzero 0 -tpattern alt+z -quintic -prefix pb01.$subj.r$run.tshift \
pb00.$subj.r$run.tcat+orig
end
#
##-------------------------------------------------------
##Deoblique the data (after slice-timing correction)
foreach run ( $runs )
3dWarp -deoblique -prefix pb02.$subj.r$run.deob pb01.$subj.r$run.tshift+orig
end

# -------------------------------------------------------
# align each dset to the base volume
foreach run ( $runs )
3dvolreg -verbose -zpad 1 -base pb02.$subj.r01.deob+orig'[0]' \
-1Dfile dfile.r$run.1D -prefix pb02.$subj.r$run.volreg \
-cubic \
pb02.$subj.r$run.deob+orig
end
#
## make a single file of registration params
cat dfile.r??.1D > dfile.rall.1D


===============================



Assuming that the motion files are right, and I wanted to censor certain time points, would I use 1dFlagMotion on the concatenated movement files:

1dFlagMotion -MaxTrans 0.1 dfile.rall.1D
#Max Translation in mm: 0.100000
#Max Rotation in Degrees: 1.250000
#You may wish to consider censoring the following points:

#roll_diff: 0.047800 pitch_diff: 0.306600 yaw_diff: 0.041900
#dS_diff: 0.025900 dL_diff: 0.034300 dP_diff: 0.131700 at image:
720


And then feed image 720 into the CENSORTR option of 3dDeconvolve? (I am using global times).


Finally, one last question: how necessary is 3dFourier for filtering the data? I am more worried about having a lowpass filter remove potential signal, and have heard that 3dDeconvolve does a good job of filtering the data by itself in any case. Assuming the data is relatively clean and noise-free, what would be recommended?


Thank you for helping me with my first levels!

-Andrew
Subject Author Posted

Censoring Motion Points

Andrew Jahn May 27, 2009 05:16PM

Re: Censoring Motion Points

rick reynolds May 27, 2009 06:00PM

Re: Censoring Motion Points

Andrew Jahn May 28, 2009 04:50PM

Re: Censoring Motion Points

rick reynolds May 28, 2009 06:14PM