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 15, 2020 11:22AM
Hi Paul,
These two subjects have some special circumstances. 
First, both datasets have unusually large non-uniformity with very high enhancement in the cortex. That meant a solution usually involved targeting that higher percentile value at 98% to keep most of the cortex. 
There is also very little structural contrast, that is very little difference between white and gray matter and CSF and larger voxels than we typically see nowadays. The default cost functions, lpc or lpc+ZZ, rely on that contrast for alignment. Instead, nmi and lpa+ZZ were generally more reliable for these subjects. 
Subject 1 had an additional complication of being extremely oblique; so much so, that the starting cardinal grids of each barely overlaid. That makes the alignment (without a giant_move or ginormous_move option) move onto a grid that won't get most of the brain and presents complications for the intermediate datasets. The solution is to use the -master_anat option to that of the EPI but use the voxel resolution of the anatomical dataset or use the grid of the deobliqued anatomical dataset. 
I will note that both subjects started off with a good alignment, as acquired. For the oblique acquisition of subject 1, really only a 3dWarp command was needed to verify that. With the low structural contrast, it's difficult to tell where edges are and if anything gets improved. In this case, the "ginormous_move" option can make things worse for data that is already aligned by moving them apart and then searching with hazy data to get back to the start. The rigid_body option excludes scaling and shearing. 
Although I didn't use it here, I am glad to see that you used the check_flip option. It is a good idea to use that with multi-site and scanner studies.
Here are various formulations of align_epi_anat.py that worked well for these subjects.
Subj 1 (Oblique - 27 degrees)
3dAutomask -apply_prefix epi_am.nii.gz epi_short.nii'[5]'
align_epi_anat.py -anat T1_ns.nii -epi epi_am.nii.gz -epi_base 0 -perc 98 -cost lpa+ZZ -suffix _al10 -overwrite -epi_strip None -anat_has_skull no
align_epi_anat.py -anat T1_ns.nii -epi epi_am.nii.gz -epi_base 0 -perc 98 -cost nmi -suffix _al12 -overwrite -epi_strip None -anat_has_skull no -rigid_body

Subj 2
align_epi_anat.py -anat T1.nii -epi epi_short.nii -epi_base 5 -cost lpc+ZZ -suffix _al2 -master_anat epi_short.nii -master_anat_dxyz 1 -overwrite -epi_strip 3dAutomask

align_epi_anat.py -anat T1.nii -epi epi_short.nii -epi_base 5 -cost lpc+ZZ -perc 98 -suffix _al5 -master_anat epi_short.nii -master_anat_dxyz 1 -overwrite -epi_strip None -anat_has_skull no
align_epi_anat.py -anat T1.nii -epi epi_am_un.nii.gz -epi_base 0 -cost lpc+ZZ -suffix _al6 -master_anat epi_short.nii -master_anat_dxyz 1 -overwrite -epi_strip None -anat_has_skull no
align_epi_anat.py -anat T1_ns.nii -epi epi_am.nii.gz -epi_base 0 -perc 98 -cost lpa+ZZ -suffix _al11 -overwrite -epi_strip None -anat_has_skull no -rigid_body
align_epi_anat.py -anat T1_ns.nii -epi epi_am.nii.gz -epi_base 0 -perc 98 -cost nmi -suffix _al12 -overwrite -epi_strip None -anat_has_skull no -rigid_body

I would recommend also that you avoid storing the EPI datasets as float, and convert to short 16-bit integers.
3dcalc -a 'epi.nii' -expr 'a' -datum short -prefix epi_short.nii

Also I am not clear where your Dice Coefficient comes from.
Subject Author Posted

toward an even more perfect align_epi_anat cool smiley

paul.hamilton December 08, 2020 01:51PM

Re: toward an even more perfect align_epi_anat cool smiley

Daniel Glen December 09, 2020 03:27PM

Re: toward an even more perfect align_epi_anat cool smiley

Daniel Glen December 15, 2020 11:22AM

Re: toward an even more perfect align_epi_anat cool smiley

paul.hamilton December 16, 2020 08:11AM

Re: toward an even more perfect align_epi_anat cool smiley

Daniel Glen December 17, 2020 04:42PM

Re: toward an even more perfect align_epi_anat cool smiley

paul.hamilton February 26, 2021 09:21AM

Re: toward an even more perfect align_epi_anat cool smiley

Daniel Glen February 26, 2021 06:41PM