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  

|
July 01, 2019 05:40PM
Hello,

I am responsible for most of the content of this repository, and got guidance implementing the distortion correction tools from various members of the AFNI team.

The B0 correction module using AFNI tools runs from approximately lines 250 to 300 in the "distortionFix.py" file.

The input to this module are a BIDS ID for 1 subject's data for a given session, the magnitude image from a B0 field map acquisition, the frequency map from the B0 field map acquisition (essentially a scaled phase map - more details below), a mask of the B0 (usually generated by running 3dAutomask on the magnitude B0 data), the effective echo spacing between lines of EPI acquisition (in seconds), and the EPI phase FOV (in mm).

The first step here is to take the information in the frequency map, scale it "appropriately", according to the following formula:

Frequency Map * EPI Echo Spacing (in seconds) * EPI Phase FOV (in mm)

The field map is then smoothed using gaussian blurring.

The scaled and smoothed field map is then used to "self distort" - so that its distortions now match the EPI distortions. This is the "fmapInHz-smoothed-warped2epi_" data set.

Finally, this distorted field map is used to unwarp the EPI data.

In addition to the timing and geometric data put in above, you would also need to know your phase encoding direction. As far as I know, the vendors don't have a standard way to denote +y / -y / +AP / -AP. I would say try both orientations on a handful of subjects - it should be pretty apparent which is correct from the visual changes in distortion. Once you've figured this out, and the acquisition for your study remained consistent, this should "just work".

As to integration with the AFNI processing stream, I've not done this work. The distorted field map generated above is essentially another warp field that should be able to be concatenated with other warps, but I think other members of the AFNI team can better answer that particular part of your question.

Glad you found this repository - and hope you can use the methods in there!

Vinai
Subject Author Posted

distortion correction using field maps in AFNI

gsaber July 01, 2019 11:41AM

Re: distortion correction using field maps in AFNI

roopchansinghv July 01, 2019 05:40PM

Re: distortion correction using field maps in AFNI

gsaber July 03, 2019 05:12PM

Re: distortion correction using field maps in AFNI

roopchansinghv July 05, 2019 07:50AM

Re: distortion correction using field maps in AFNI

gsaber July 11, 2019 01:29PM

Re: distortion correction using field maps in AFNI

roopchansinghv July 11, 2019 05:05PM

Re: distortion correction using field maps in AFNI

gsaber July 12, 2019 02:48PM

Re: distortion correction using field maps in AFNI

roopchansinghv July 16, 2019 08:58AM

Re: distortion correction using field maps in AFNI

gsaber July 16, 2019 03:27PM