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 20, 2021 11:26AM
I return to my topic with a new problem. This problem appeard subsequently in the preprocessing pipeline, more precisely in the regression part.

Let me provide you with short background information about what I intend to do:

- One subject
- Two runs
- Two kinds of stimuli (Self vs. No_Self). Both stimuli are presented as trials in each of the 2 runs (unpredictable for the subject which type comes next; self or non-self)
- 20 trials per run (10 Self; 10 No_Self)

(I only use one subject and two runs in order to reduce the processing time. I have an older laptop with a small HDD; a new Laptop should come soon and then I can hopefully preprocess a whole dataset with many subjects. Meanwhile, I try to atleast go through a whole preprocessing session with 1 or 2 subjects and 1 or 2 corresponding runs. Nonetheless, the following problem described below likewise appears with more than one subject and more than 2 runs. The .1D stimuli-onset textfiles were accordingly adjustet from 6 rows for 6 runs to 2 rows for 2 runs, so that AFNI does not complain here or induce related errors/problems.)


Here is my AFNI_proc.py


# Set directories
directory_subjects=/users/philipp/desktop/fmri/dataset/subjects/subj1_exp1
directory_fMRIruns=$directory_subjects/raw
directory_anatomical=$directory_subjects/raw
directory_stimulionsets=/users/philipp/desktop/fmri/dataset/info
cd $directory_subjects

# AFNI_proc.py
afni_proc.py \
-subj_id Subject_1 \
-out_dir $directory_subjects/Preprocessing \
-dsets \
$directory_fMRIruns/run1to3d+orig \
$directory_fMRIruns/run2to3d+orig \
$directory_fMRIruns/run3to3d+orig \ # Ok, in this try I used 3 runs, all fine, the .1D files were adjusted, this is not the problem.
-blocks despike tshift align tlrc volreg mask blur scale regress \
-copy_anat $directory_anatomical/3dto3d+orig \
-tcat_remove_first_trs 4 \
-align_opts_aea -cost nmi -ginormous_move \
-tlrc_base MNI152_2009_template.nii.gz \
-volreg_align_e2a \
-volreg_align_to MIN_OUTLIER \
-volreg_tlrc_warp \
-volreg_post_vr_allin yes \
-volreg_pvra_base_index MIN_OUTLIER \
-blur_size 6.0 \
-regress_stim_times $directory_stimulionsets/allrun_self.1D $directory_stimulionsets/allrun_nonself.1D \
-regress_stim_labels Self No_Self \
-regress_basis 'BLOCK(2,1)' \
-regress_opts_3dD \
-gltsym 'SYM: Self -No_Self' \
-glt_label 1 S-N \
-jobs 4 \
-regress_motion_per_run \
-regress_apply_mot_types demean deriv \
-regress_est_blur_epits \
-regress_est_blur_errts \
-regress_bandpass 0.01 0.2 \
-html_review_style pythonic \
-execute


Now, the problem is that AFNI gets stuck on the following processing part/message output. Please see screenshot number 1 in the attachments. From here on, nothing happens anymore, even after two to three hours of waiting. It seems that AFNI is stuck without a precise recognition of the problem, since AFNI does not stop to produce an error message. I am able to open all preprocessing files from the -block (despike tshift align tlrc volreg mask blur scale) beside, of course, the regress files. That is to say, opening the output for the scale files to inspect them via the AFNI GUI, to provide an example, works just fine. The processed files look OK to me to. The problem seems to be related to the regression part.



Then, in a next step, I added ptaylor’s suggestion to use @SSwarper first as you can see in my new updated script below. Furthermore, -tlrc_NL_warp was added to the script. I removed -tlrc_NL_warp on my older script above to increase processing time (it takes around 2 to 2.5 hours on my old laptop just for one run!). And you don't wanna know how long SSwarper took for this updated script. :D

Here is the updated AFNI_proc.py script:

# Set directories
directory_subjects=/users/philipp/desktop/fmri/dataset/subjects/subj1_exp1
directory_fMRIruns=$directory_subjects/raw
directory_anatomical=$directory_subjects/raw
directory_stimulionsets=/users/philipp/desktop/fmri/dataset/info
cd $directory_subjects

# Run SSwarper
@SSwarper \
-input $directory_anatomical/3dto3d+orig \
-base MNI152_2009_template_SSW.nii.gz \
-subid Subject_1 \
-odir $directory_subjects/raw

# AFNI_proc.py
afni_proc.py \
-subj_id Subject_1 \
-out_dir $directory_subjects/Preprocessing \
-dsets \
$directory_fMRIruns/run1to3d+orig \
$directory_fMRIruns/run2to3d+orig \ # Only two runs now to save some time. .1D textfiles with stimuli-onset times were adjusted accordingly.
-blocks despike tshift align tlrc volreg mask blur scale regress \
-copy_anat $directory_anatomical/anatSS.Subject_1.nii \
-anat_has_skull no \
-tcat_remove_first_trs 4 \
-align_opts_aea -cost nmi \
-volreg_align_e2a \
-volreg_align_to MIN_OUTLIER \
-volreg_tlrc_warp -tlrc_base MNI152_2009_template_SSW.nii.gz \
-tlrc_NL_warp \ # tlrc_NL_warp added to provide the proper full program.
-tlrc_NL_warped_dsets \
$directory_subjects/raw/anatQQ.Subject_1.nii \
$directory_subjects/raw/anatQQ.Subject_1.aff12.1D \
$directory_subjects/raw/anatQQ.Subject_1_WARP.nii \
-volreg_post_vr_allin yes \
-volreg_pvra_base_index MIN_OUTLIER \
-blur_size 6.0 \
-regress_stim_times $directory_stimulionsets/allrun_self.1D $directory_stimulionsets/allrun_nonself.1D \
-regress_stim_labels Self No_Self \
-regress_basis 'BLOCK(2,1)' \
-regress_opts_3dD \
-gltsym 'SYM: Self -No_Self' \
-glt_label 1 S-N \
-jobs 4 \
-regress_motion_per_run \
-regress_apply_mot_types demean deriv \
-regress_est_blur_epits \
-regress_est_blur_errts \
-regress_bandpass 0.01 0.2 \
-html_review_style pythonic \
-execute

First of all, SSwarper runs fine. After running SSwarper, AFNI_proc.py proceeds fine too (at least in the beginning). Later, however, it gets stuck just like my older script before, and again without providing any error messages concerning what may went wrong. The step in the preprocessing where it "stops" is exactly the same as with the old script. All the data/information on the screenshot that I attached are exactly the same for both scripts, i.e., both scripts fail at the same processing step.

I am stuck here and would kindly ask you for further help. Of course, we can focus on fixing the problem with the second/updated script, since it includes the usage of SSwarper as suggested here and the problem is the same.

Please let me know what you think. Thanks,

Philipp
Attachments:
open | download - Screen1.png (180.6 KB)
Subject Author Posted

AFNI_proc.py - A faulty warped brain Attachments

Philipp August 17, 2021 10:14AM

Re: AFNI_proc.py - A faulty warped brain

ptaylor August 17, 2021 01:48PM

Re: AFNI_proc.py - A faulty warped brain

Philipp August 18, 2021 05:51AM

Re: AFNI_proc.py - A faulty warped brain

rick reynolds August 18, 2021 10:39AM

Re: AFNI_proc.py - A faulty warped brain Attachments

ptaylor August 18, 2021 07:59PM

Re: AFNI_proc.py - A faulty warped brain

ptaylor August 18, 2021 08:20PM

Re: AFNI_proc.py - A faulty warped brain

Philipp August 19, 2021 08:41AM

Re: AFNI_proc.py - A faulty warped brain

rick reynolds August 19, 2021 09:05AM

Re: AFNI_proc.py - A faulty warped brain Attachments

Philipp August 20, 2021 11:26AM

Re: AFNI_proc.py - A faulty warped brain

rick reynolds August 20, 2021 02:58PM

Re: AFNI_proc.py - A faulty warped brain

ptaylor August 20, 2021 03:19PM

Re: AFNI_proc.py - A faulty warped brain

Philipp August 21, 2021 03:24AM

Re: AFNI_proc.py - A faulty warped brain

rick reynolds August 21, 2021 06:59PM