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  

|
Daniel Glen
April 20, 2007 04:08PM
I've taken a look at this data and had some success. Based on the information in the DICOM header, all the EPI data you sent seems to be oblique by an angle of 36.9 degrees. I am working on providing our users with a more integrated method, but I am able to provide you with a good interim solution. We were able to take advantage of the 3doblique script from your very helpful colleagues there at Princeton who provided us with their perl script for doing oblique corrections. Michael Benharrosh there provided us with their script. The angle can be calculated several ways from the DICOM header. One way is included in the script below.

Running this tcsh script (that calls the Princeton perl script) rotates the oblique EPI data to match the anatomical dataset. A DICOM slice file and the oblique AFNI format dataset should be changed in this script for each dataset.

If you'd like, I can post an image of your rotated EPI dataset overlaying the anatomical with your permission. Next week I hope to have something working completely within standard AFNI commands without additional scripting.

#!/bin/tcsh
# obliscript
# use simple inverse cosine of vector element with Princeton's 3doblique script
# to remove obliquity
# some data needed an additional 90 degrees added to the computed data
set dicomslice = '1.3.12.2.1107.5.2.0.35119.30000006052308570565600033293.dcm'
set oblique_dset = 'EPI_run_003'
#
# Shift the times to match across slices
3dTshift -prefix {$oblique_dset}_tshift -quintic {$oblique_dset}+orig
# Add blank spaces above and below volume
3dZeropad -I 20 -S 20 -prefix {$oblique_dset}_zpad {$oblique_dset}_tshift+orig
set IMAGEORIENT = `dicom_hdr $dicomslice | grep '//REL Image Orientation' \
| awk '{print$9}' `
echo "Image orientation field is $IMAGEORIENT"
# now get just 5th element
set IMAGEORIENT = `dicom_hdr $dicomslice | grep '//REL Image Orientation' \
| awk '{print$9}' | awk -F\\ '{print $5}'`
set ANGLEDEGREES = `ccalc "-180 / PI * acos($IMAGEORIENT)"`
echo "Computed rotation angle is $ANGLEDEGREES around the R-L axis"
~/oblique/3doblique --prefix {$oblique_dset}_deoblique -dcm $dicomslice \
-r {$ANGLEDEGREES}R {$oblique_dset}_zpad+orig


If your other datasets are similarly acquired, it might be possible to duplicate the operations. So extracting the commands using 3dinfo shows these steps (after to3d):

3dTshift -prefix EPI_run_003_tshift -quintic EPI_run_003+orig
3dZeropad -I 20 -S 20 -prefix EPI_run_003_zpad EPI_run_003_tshift+orig
3dcopy EPI_run_003_zpad+orig tmp_EPI_run_003_deoblique
3drefit -dxorigin 1.5 -dyorigin -76.38889830485 -dzorigin -11.340135593 tmp_EPI_run_003_deoblique+orig
3dZeropad -prefix EPI_run_003_deoblique_pad -A 8.16770046638663 -P 8.16770046638663 tmp_EPI_run_003_deoblique+orig
3drotate -prefix EPI_run_003_deoblique -cubic -rotate -36.399980 0A 0I EPI_run_003_deoblique_pad+orig

Let me know how this works for you. I'll try to keep everyone updated on the status of obliquity inside AFNI.
Subject Author Posted

EPI/MPRAGE Misalignment

Andrew April 05, 2007 02:52PM

Re: EPI/MPRAGE Misalignment

rick reynolds April 06, 2007 02:33PM

Re: EPI/MPRAGE Misalignment

Andrew April 09, 2007 07:47AM

Re: EPI/MPRAGE Misalignment

rick reynolds April 10, 2007 02:36PM

Re: EPI/MPRAGE Misalignment

Andrew April 10, 2007 03:26PM

Re: EPI/MPRAGE Misalignment

Andrew April 12, 2007 05:22AM

Re: EPI/MPRAGE Misalignment & 3dAllineate

Andrew Engell April 17, 2007 06:06PM

Re: EPI/MPRAGE Misalignment & 3dAllineate

Daniel Glen April 18, 2007 11:29AM

Re: EPI/MPRAGE Misalignment & 3dAllineate

Andrew Engell April 18, 2007 02:57PM

Re: EPI/MPRAGE Misalignment & 3dAllineate

Daniel Glen April 18, 2007 03:13PM

Re: EPI/MPRAGE Misalignment & 3dAllineate

Andrew Engell April 18, 2007 03:45PM

Re: EPI/MPRAGE Misalignment & 3dAllineate

Daniel Glen April 20, 2007 04:08PM

Re: EPI/MPRAGE Misalignment & 3dAllineate

Andrew Engell April 23, 2007 01:09PM

Re: EPI/MPRAGE Misalignment & 3dAllineate

Daniel Glen April 23, 2007 04:51PM

Re: EPI/MPRAGE Misalignment & 3dAllineate

Richard Bruno October 12, 2007 01:14PM

Re: EPI/MPRAGE Misalignment & 3dAllineate

Daniel Glen October 12, 2007 01:28PM

Re: EPI/MPRAGE Misalignment & 3dAllineate

Richard Bruno October 12, 2007 01:41PM

Re: EPI/MPRAGE Misalignment & 3dAllineate

Daniel Glen October 12, 2007 02:03PM