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  

|
August 10, 2016 04:23PM
Hi Rick,
Since I used 3 PCs for csf and sagittal sinus each, along with anaticor for white matter etc within afni_proc.py, getting all of the "noise" might be a bit difficult as I am not sure I can just add the files together (since some have censored timepoints etc). Would the easiest way to calculate the noise residuals be the following for resting state:

1) Use 3dTproject to censor pb04 (blurred file) so that it has the same timepoints as errts.fanaticor. This file would represent my signal+noise total file. Then I would substract errts.fanaticor (bold like resting state signal) from pb04.censor.

The result should represent all of the "noise" of csf, sagittal sinus, motion, white matter etc rolled into one file. I would then warp this file to MNI space (same grid as my stats) so that any warping smoothness is added into the estimation. I would then run 3dFWHMx -acf -detrend on this warped noise file to get my estimation of the acf parameters. Finally I would use an average of all subjects to estimate my acf input into 3dClustSim to estimate my clustersize.

Below is the code generated which is run........maybe you can specify which file from there would work if my option above does not seem correct.


2) On a separate note I noticed my 3dTproject cenmode was zero instead of kill from afni_proc.py. Do you think I should update this or leave as is? I am not sure which is considered the best option currently.


Code Run from AFNI
# make ROI PCs and uncensor (zero-pad) : FSvent
3dpc -mask follow_ROI_FSvent+orig -pcsave 3 -prefix roi_pc_01_FSvent \
rm.det_pcin_rall+orig"[$ktrs]"
1d_tool.py -censor_fill_parent censor_${subj}_combined_2.1D \
-infile roi_pc_01_FSvent_vec.1D -write roi_pc_01_FSvent_noc.1D

# make ROI PCs and uncensor (zero-pad) : FSsinus
3dpc -mask follow_ROI_FSsinus+orig -pcsave 3 -prefix roi_pc_02_FSsinus \
rm.det_pcin_rall+orig"[$ktrs]"
1d_tool.py -censor_fill_parent censor_${subj}_combined_2.1D \
-infile roi_pc_02_FSsinus_vec.1D -write roi_pc_02_FSsinus_noc.1D

# ------------------------------
# run the regression analysis
3dDeconvolve -input pb04.$subj.r*.blur+orig.HEAD \
-mask full_mask.$subj+orig \
-censor censor_${subj}_combined_2.1D \
-ortvec bandpass_rall.1D bandpass \
-ortvec roi_pc_01_FSvent_noc.1D ROI.PC.FSvent \
-ortvec roi_pc_02_FSsinus_noc.1D ROI.PC.FSsinus \
-polort 3 -float \
-num_stimts 12 \
-stim_file 1 motion_demean.1D'[0]' -stim_base 1 -stim_label 1 roll_01 \
-stim_file 2 motion_demean.1D'[1]' -stim_base 2 -stim_label 2 pitch_01 \
-stim_file 3 motion_demean.1D'[2]' -stim_base 3 -stim_label 3 yaw_01 \
-stim_file 4 motion_demean.1D'[3]' -stim_base 4 -stim_label 4 dS_01 \
-stim_file 5 motion_demean.1D'[4]' -stim_base 5 -stim_label 5 dL_01 \
-stim_file 6 motion_demean.1D'[5]' -stim_base 6 -stim_label 6 dP_01 \
-stim_file 7 motion_deriv.1D'[0]' -stim_base 7 -stim_label 7 roll_02 \
-stim_file 8 motion_deriv.1D'[1]' -stim_base 8 -stim_label 8 pitch_02 \
-stim_file 9 motion_deriv.1D'[2]' -stim_base 9 -stim_label 9 yaw_02 \
-stim_file 10 motion_deriv.1D'[3]' -stim_base 10 -stim_label 10 dS_02 \
-stim_file 11 motion_deriv.1D'[4]' -stim_base 11 -stim_label 11 dL_02 \
-stim_file 12 motion_deriv.1D'[5]' -stim_base 12 -stim_label 12 dP_02 \
-fout -tout -x1D X.xmat.1D -xjpeg X.jpg \
-x1D_uncensored X.nocensor.xmat.1D \
-fitts fitts.$subj \
-errts errts.${subj} \
-x1D_stop \
-bucket stats.$subj

# -- use 3dTproject to project out regression matrix --
3dTproject -polort 0 -input pb04.$subj.r*.blur+orig.HEAD \
-mask full_mask.$subj+orig \
-censor censor_${subj}_combined_2.1D -cenmode ZERO \
-ort X.nocensor.xmat.1D -prefix errts.${subj}.tproject



# if 3dDeconvolve fails, terminate the script
if ( $status != 0 ) then
echo '---------------------------------------'
echo '** 3dDeconvolve error, failing...'
echo ' (consider the file 3dDeconvolve.err)'
exit
endif


# display any large pairwise correlations from the X-matrix
1d_tool.py -show_cormat_warnings -infile X.xmat.1D |& tee out.cormat_warn.txt

# create an all_runs dataset to match the fitts, errts, etc.
3dTcat -prefix all_runs.$subj pb04.$subj.r*.blur+orig.HEAD

# --------------------------------------------------
# generate fast ANATICOR result: errts.$subj.fanaticor+orig

# --------------------------------------------------
# fast ANATICOR: generate local FSWe time series averages
# create catenated volreg dataset
3dTcat -prefix rm.all_runs.volreg pb03.$subj.r*.volreg+orig.HEAD

# mask white matter before blurring
3dcalc -a rm.all_runs.volreg+orig -b follow_ROI_FSWe+orig \
-expr "a*bool(b)" -datum float -prefix rm.all_runs.volreg.mask

# generate ANATICOR voxelwise regressors via blur
3dmerge -1blur_fwhm 30 -doall -prefix Local_FSWe_rall \
rm.all_runs.volreg.mask+orig

# -- use 3dTproject to project out regression matrix --
3dTproject -polort 0 -input pb04.$subj.r*.blur+orig.HEAD \
-mask full_mask.$subj+orig \
-censor censor_${subj}_combined_2.1D -cenmode ZERO \
-dsort Local_FSWe_rall+orig \
-ort X.nocensor.xmat.1D -prefix errts.$subj.fanaticor





Best,
Ajay



Edited 1 time(s). Last edit at 08/10/2016 04:45PM by AjaySK.
Subject Author Posted

3dttest++ -clustsim vs 3dClustSim very different

AjaySK August 03, 2016 01:04PM

Re: 3dttest++ -clustsim vs 3dClustSim very different

AjaySK August 04, 2016 09:53AM

Re: 3dttest++ -clustsim vs 3dClustSim very different

Bob Cox August 08, 2016 10:58AM

Re: 3dttest++ -clustsim vs 3dClustSim very different

AjaySK August 09, 2016 09:54AM

Re: 3dttest++ -clustsim vs 3dClustSim very different

Bob Cox August 09, 2016 11:31AM

Re: 3dttest++ -clustsim vs 3dClustSim very different

AjaySK August 09, 2016 01:00PM

Re: 3dttest++ -clustsim vs 3dClustSim very different

Bob Cox August 09, 2016 01:38PM

Re: 3dttest++ -clustsim vs 3dClustSim very different

AjaySK August 10, 2016 02:44PM

Re: 3dttest++ -clustsim vs 3dClustSim very different

rick reynolds August 10, 2016 03:19PM

Re: 3dttest++ -clustsim vs 3dClustSim very different

AjaySK August 10, 2016 04:23PM

Re: 3dttest++ -clustsim vs 3dClustSim very different

AjaySK August 10, 2016 04:27PM

Re: 3dttest++ -clustsim vs 3dClustSim very different

rick reynolds August 11, 2016 08:17AM

Re: 3dttest++ -clustsim vs 3dClustSim very different

AjaySK August 14, 2016 12:49AM