Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Community » Message Board

History of AFNI updates   Suggested reading for beginners   Add yourself to the AFNI map!

Know left from right - the flipping problem

|
May 25, 2016 05:50PM
A new feature in AFNI allows for checking if data has been left-right flipped between two datasets. Far too often, we find data that has been left-right flipped between an EPI scan and a corresponding anatomical dataset for the same subject. This is typically a subtle problem to detect visually because most subjects' brains are approximately left-right symmetric. This issue came to our attention a number of years ago because an observant AFNI user, Brad Buchsbaum (shoutout to Brad!), noticed that one of the sites in the FCON-1000 database was initially released with all their data flipped. Notably, he was able to identify this because the AFNI visualization and alignment tools made it fairly clear that the flipped data aligned better than the original dataset.

The new option (-check_flip) automates the discovery of this flipping problem by using the alignment cost value as a metric to determine whether the original or flipped dataset gives a better alignment. It doesn't determine left or right, only that two datasets do not match in their definitions of left and right.

How does data get flipped in the first place?
- incorrect DICOM data from the scanner
- DICOM/PACS servers that mangle the DICOM header
- Pipelines that use Analyze format, missing coordinate information
- Processing pipelines that assume a single orientation and apply it to other output datasets
- Incorrect or missing NIFTI header information

One of the principal goals of the NIFTI format has been to enforce orientation and coordinate information, that information can be bypassed, so we need to be careful even with that format.

How do I use the new feature?
Simple. Add "-check_flip" to your align_epi_anat.py command. Here is a simple example:

align_epi_anat.py -anat anat+orig -epi epi_r1+orig -epi_base 0 -giant_move -check_flip

The output will include this warning if the data is flipped:

WARNING: ************ flipped data aligns better than original data
Check for left - right flipping in the GUI ************************


If everything is okay, this message appears instead:

Data does not need flipping

The option also causes additional output files including the aligned and flipped dataset, the cost values for all cost functions for both the flipped and original datasets in two 1D text files and the alignment transformation for the flipped dataset. You can view the two aligned datasets that are produced, the normally aligned and the flipped aligned datasets in AFNI. Here's an example image using the edge enhance feature to help visualize the quality of the alignment where the image on the right shows the better alignment.



The alignment uses the alignment specified for the original dataset, so if "-giant_move", "-rigid_body" or any other option is specified, the flipped dataset would get the same treatment including the same cost function.

The help has some more information on the new options:

-check_flip : check if data may have been left/right flipped by aligning
original and flipped versions and then comparing costs
between the two. This option produces the L/R flipped
and aligned anat/dset1 dataset. A warning is printed
if the flipped data has a lower cost function value
than the original dataset when both are aligned to the
epi/dset2 dataset.
This issue of left-right confusion can be caused
by problems with DICOM files or pipelines
that include Analyze format datasets. In these cases,
the orientation information is lost, and left-right may
be reversed. Other directions can also be confused, but
A-P and I-S are usually obvious. Note this problem has
appeared on several major publicly available databases.
Even if other software packages may proceed without errors
despite inconsistent, wrong or even missing coordinate
and orientation information, this problem can be easily
identified with this option.
This option does not identify which of the two datasets
need to be flipped. It only determines there is likely
to be a problem with one or the other of the two input
datasets. Importantly, we recommend properly visualizing
the datasets in the afni GUI. Look for asymmetries in the
two aligned anat/dset1 datasets, and see how they align
with the epi/dset2 dataset. To better determine the left
and right of each dataset, we recommend relying on tags
like vitamin E or looking for surgical markers.

-flip_giant : apply giant_move options to flipped dataset alignment
even if not using that option for original dataset
alignment


https://www.nitrc.org/forum/forum.php?thread_id=1310&forum_id=1243
https://openfmri.org/dataset-orientation-issues/
Subject Author Posted

Know left from right - the flipping problem

Daniel Glen May 25, 2016 05:50PM

Re: Know left from right - the flipping problem

sxd110430@utdallas.edu September 09, 2016 09:42AM

Re: Know left from right - the flipping problem

Daniel Glen September 09, 2016 01:28PM



Sorry, only registered users may post in this forum.

Click here to login


Powered by Plone

phorum.org

This site conforms to the following standards: