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  

|
October 12, 2009 01:08PM
Hi I have four sets of functional data that are obtained before and after two sets of anatomical data. I used @auto_tlrc for transformation. I used align_epi_anat to align these EPI data to respective anatomical and tlrc transformation.

I have preprocessed data then to use 3dDeconvolve for final analysis. (please see attached script).

# Arash Babaei
# Medical College of Wisconsin
# Date: 2009.10.1

cd af1/SW3post
set ANA = 'anat2'
set EPI = 'SW3post'

# Remove cardiovascular noise from resting state data
rm -f ${EPI}_icor+orig*
3dretroicor -ignore 4 -prefix ${EPI}_icor -resp ${EPI}_resp.1D -card ${EPI}_puls.1D ${EPI}+orig

# Perform Talairach transformation of anatomical image
rm -f ${ANA}_at+tlrc*
rm -f ${ANA}_ns+orig*
rm -f ${ANA}_al_mat.aff12.1D*
rm -f ${ANA}_ns.Xaff12.1D*
rm -f ${ANA}_ns_WarpDrive.log*
@auto_tlrc -base TT_icbm452+tlrc -input ${ANA}+orig

# Volume register & align functional data to anatomical data
rm -f ${EPI}_icor_al+orig*
rm -f ${EPI}_icor_tlrc_al+tlrc*
rm -f ${EPI}_icor_al_mat.aff12.1D*
rm -f ${EPI}_icor_al_reg_mat.aff12.1D*
rm -f ${EPI}_icor_al_tlrc_mat.aff12.1D*
rm -f ${EPI}_icor_tsh_vr_motion.1D*
align_epi_anat.py -anat ${ANA}+orig -epi ${EPI}_icor+orig \
-epi2anat \
-epi_base 5 \
-epi_strip 3dAutomask \
-tlrc_apar ${ANA}_at+tlrc

# Remove spikes from resting state data
rm -f ${EPI}_dspk+orig*
3dDespike -ignore 4 -cut 2.5 4.0 -prefix ${EPI}_dspk ${EPI}_icor_al+orig

# Remove trend from resting state data
rm -f ${EPI}_dspk+orig*
3dDetrend -prefix ${EPI}_dtrn -polort 2 ${EPI}_dspk+orig

# Perform spatial smoothing
rm -f ${EPI}_blur+orig*
3dmerge \
-doall \
-1blur_fwhm 4.0 \
-prefix ${EPI}_blur \
${EPI}_dspk+orig

# Make high resolution wm anat mask
rm -f ${ANA}_wm+orig*
3dcalc \
-a ${ANA}_ns+orig \
-expr "step(a-3200)" \
-prefix ${ANA}_wm

# Make high resolution csf anat mask
rm -f ${ANA}_csf+orig*
3dcalc \
-a ${ANA}_ns+orig \
-expr "step(a)*step(1050-a)" \
-prefix ${ANA}_csf

# Create mask for in-brain voxels
rm -f ${EPI}_msk+orig*
3dAutomask -dilate 1 -prefix ${EPI}_msk ${EPI}_blur+orig'[5]'

# Transform high resolution wm anat mask to low resolution wm EPI mask
rm -f ${EPI}_wm+orig*
3dfractionize -template ${EPI}_msk+orig \
-input ${ANA}_wm+orig \
-clip 0.90 -prefix ${EPI}_wm

# Transform high resolution csf anat mask to low res csf EPI mask
rm -f ${EPI}_csf+orig*
3dfractionize -template ${EPI}_msk+orig \
-input ${ANA}_csf+orig \
-clip 0.6 -prefix ${EPI}_csf

# Extract time series average over wm voxels
3dmaskave -quiet -mask ${EPI}_wm+orig \
${EPI}_blur+orig > ${EPI}_wm.1D

# Extract time series average over csf voxels
3dmaskave -quiet -mask ${EPI}_csf+orig \
${EPI}_blur+orig > ${EPI}_csf.1D

# Orthogonlize functional data to motion parameters, csf, and wm
rm -f ${EPI}_fit*
rm -f ${EPI}_irf*
rm -f ${EPI}_err*
rm -f ${EPI}_res*
rm -f seed.xmat.1D*
rm -f seed.REML_cmd
3dDeconvolve \
-input ${EPI}_blur+orig \
-mask ${EPI}_msk+orig \
-jobs 2 \
-CENSORTR 435..510 \
-polort A \
-nfirst 3 \
-num_stimts 9 \
-basis_normall 1 \
-stim_times 1 '1D:150 510' 'TENT(5,100,15)' \
-stim_label 1 seed \
-stim_file 2 "${EPI}_icor_tsh_vr_motion.1D[0]" -stim_base 2 -stim_label 2 Roll \
-stim_file 3 "${EPI}_icor_tsh_vr_motion.1D[1]" -stim_base 3 -stim_label 3 Pitch \
-stim_file 4 "${EPI}_icor_tsh_vr_motion.1D[2]" -stim_base 4 -stim_label 4 Yaw \
-stim_file 5 "${EPI}_icor_tsh_vr_motion.1D[3]" -stim_base 5 -stim_label 5 dS \
-stim_file 6 "${EPI}_icor_tsh_vr_motion.1D[4]" -stim_base 6 -stim_label 6 dL \
-stim_file 7 "${EPI}_icor_tsh_vr_motion.1D[5]" -stim_base 7 -stim_label 7 dP \
-stim_file 8 "${EPI}_wm.1D" -stim_base 8 -stim_label 8 wm \
-stim_file 9 "${EPI}_csf.1D" -stim_base 9 -stim_label 9 csf \
-gltsym 'SYM: +seed' \
-glt_label 1 seed \
-float \
-iresp 1 ${EPI}_irf \
-bout \
-fout \
-rout \
-tout \
-fitts ${EPI}_fit \
-errts ${EPI}_err \
-bucket ${EPI}_res



echo "Preprocessing ************** Finished"


#End of script
#3dAllineate -cubic -1Dmatrix_apply SW3post_al_tlrc_mat.aff12.1D -prefix SW3post_volresults+tlrc SW3post_volresults+orig

1- I used to be able to joggle between orig and tlrc when I manually transformed to tlrc my data. It appears that name tag with auto-tlrc and align_epi_anat is different so it does not do that automatically. Is there a reason for that?could I just change the names to EPI+tlrc or anatomical to anat+tlrc ? I want to be able to look at where am I? option on my functional data where I have significant difference.

2-If I want to look at my results in +tlrc, could I transform my results with EPI_al_tlrc_mat.aff12.1D using 3dallineate to results +tlrc or I should run 3dDeconvolve on my EPI+tlrc data again to obtain desirable results?

3- In each individual if I need to align all of the scans together (anat2 to anat1) and all functionals to them (EPI1& EPI2&EPI3 & EPI4) what is the best way for alignment to have least interpolation
Subject Author Posted

align_epi_anat

Arash Babaei October 12, 2009 01:08PM

Re: align_epi_anat

rick reynolds October 12, 2009 02:49PM

Re: align_epi_anat

Arash Babaei October 12, 2009 04:22PM

Re: align_epi_anat

rick reynolds October 13, 2009 09:22AM

Re: align_epi_anat

Arash Babaei November 13, 2009 12:05PM

Re: align_epi_anat

Arash Babaei November 13, 2009 12:14PM

Re: align_epi_anat

Daniel Glen November 13, 2009 01:23PM

Re: align_epi_anat

Arash Babaei November 16, 2009 09:42AM