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  

|
December 01, 2022 07:23AM
Note: ptaylor split this message off from this thread:
[afni.nimh.nih.gov]
... into this new one, because it starts a new/different topic (albeit related to alignment).

-------------------------------------------------------------------------------------------------------------------------------------

Thank you so much, we are running with the new prepp data and with and without -align_unifize_epi local \.
I'll update you when it's done.

I have another question that is probably related.

I have made my own neuro-feedback engine (based on AFNI). And yes, I know AFNI has it's own :D. But I'm trying to make this work.

I have run into one issue. I implemented your prepp-steps in this process as well which helps but I have one epi 2 epi alignment that does not work. I'll try to be super breif:

Step1: Collect T1
Step2: Run localizer task: Goal is to find subject specific region to give feedback from
Step3: Run the prepp-steps on epi + aligment of epi and anat (default is that anat is moved to epi space, right):
afni_proc.py -subj_id $sub_id \
    -dsets EPI_do.nii \
    -copy_anat T1_do_zp.nii \
    -align_opts_aea -cost lpc+ZZ -giant_move \
    -blocks despike align volreg blur regress \
    -tcat_remove_first_trs 0 \
    -volreg_align_to MIN_OUTLIER \
    -regress_censor_motion 0.3 \
    -regress_censor_outliers 0.1 \
    -regress_apply_mot_types demean deriv \
	-regress_basis 'BLOCK(8,1)' \
    -regress_stim_times $stim/stimfile.1D \
    -regress_stim_labels localizer_task \
    -regress_local_times \
        -regress_opts_3dD \
	-jobs $cpu_num \
	-html_review_style none \
	-execute

Step4: In this localizer epi space we make the mask, (threshold the stats file, top 10% voxels) within a salience network mask that I warped to the anat.final file.
Looking at vr_min_outlier as underlay and the mask as overlay looks good! (attached)

Step5: We start the live run.
These EPIs are collected one by one. Let's focus on the first TR that arrives into the system.
I want this EPI to overlap with the vr_minimum outlier map from the localizer (since there the mask matches the anatomy we want to give feedback from).
The arriving TR1.nii file is in it's own native space (but close to vr_min_outlier since the subject is still in the scanner and hopefully don't move A LOT).
On each arriving TR I would do:

cp $nii_dir/TR1.nii.gz .
3drefit -oblique_recenter TR1.nii.gz
3drefit -deoblique TR1.nii.gz
###
3dvolreg -zpad 1 -base vr_minimum_outlier+orig. \
          -1Dfile dfile_TR1 -prefix TR1.volreg \
          -cubic TR1.nii.gz

My idea was just to volume register to vr_minimum outlier but it seems like this does not actually move the EPI (TR1) to the space of the localizer (vr_min_outlier). But 3dvolreg does not seem to do it (attached).

So, how to I best (and fastest) move a single EPI TR image onto another (in space close) EPI (vr_min_outlier) from the previous scan?

I tried this:
@Align_Centers \
-cm \
-base vr_base_min_outlier+orig \
-dset 11+orig

And 11_shft+orig (the output) does look much much better but I don't think they are "aligned".

Heeelp and thanks again!



Edited 3 time(s). Last edit at 12/01/2022 09:02AM by ptaylor.
Attachments:
open | download - vr_origspace_mask.png (20.5 KB)
open | download - min_outlier_TR1.png (238.5 KB)
Subject Author Posted

alignment in afni_proc.py during neurofeedback Attachments

Robin December 01, 2022 07:23AM

Re: alignment in afni_proc.py during neurofeedback

ptaylor December 01, 2022 09:27AM

Re: alignment in afni_proc.py during neurofeedback

Robin December 01, 2022 09:38AM

Re: alignment in afni_proc.py during neurofeedback

rick reynolds December 01, 2022 11:26AM

Re: alignment in afni_proc.py during neurofeedback

Robin December 02, 2022 07:35AM

Re: alignment in afni_proc.py during neurofeedback Attachments

Robin December 02, 2022 10:01AM

Re: alignment in afni_proc.py during neurofeedback

rick reynolds December 05, 2022 06:14PM