Tuesday, November 29, 2011

All my papers ... need more ... citation is not high ... sign ...

Y Wang, J Xiang, R Kotecha, J Vannest, Y Liu… - Brain topography, 2008 - Springer
... &) 4 J. Xiang 4 R. Kotecha 4 J. Vannest 4 Y. Liu 4 D. Rose 4 M. Schapiro 4 T. Degrauw MEG
Center, Division of Neurology, Cincinnati Children's Hospital Medical Center, MLC 2015, 3333
Burnet Avenue, Cincinnati, OH 45229-3039, USA e-mail: yingying.wang@cchmc.org ...
Cited by 7 - Related articles - Find it with OLinks - Full-Text @ Pratt Library - All 7 versions - Import into EndNote

Y Wang, J Xiang, J Vannest, T Holroyd… - Clinical …, 2011 - Elsevier
... Yingying Wang a , b , c , Corresponding Author Contact Information , E-mail The Corresponding
Author , Jing Xiang b , Jennifer Vannest b , c , Tom Holroyd d , Daria Narmoneva a , Paul Horn ...
d MEG Core Facility, National Institute of Mental Health, Bethesda, MD, United States. ...
Cited by 1 - Related articles - Find Full-Text at UC - OhioLINK OLinks - Check Library Holdings - All 4 versions - Import into EndNote

Y Wang, J Xiang, DF Rose, T Holroyd… - 17th International …, 2010 - Springer
... We adopted accumulated spectrograms because the MEG data recorded from the brain commonly
have very strong low-frequency ... Author: Yingying Wang Institute: Cincinnati Children's Hospital
Medical Center Street: 3333 Burnet Avenue, MLC 2015 City: Cincinnati, OH 45229 ...
Related articles - Find Full-Text at UC - OhioLINK OLinks - Check Library Holdings - All 3 versions - Import into EndNote
 

Second author paper (2)


J Xiang, Y Wang, Y Chen, Y Liu… - Journal of …, 2010 - thejns.org
... Jing Xiang, MD, Ph.D. 1, 2 , Yingying Wang, M.Sc ... 1 , Nat Hemasilpin, MSEE 1 , Ki Lee, MD 2 ,
Francesco T. Mangano, DO 3 , Blaise Jones, MD 4 , and Ton deGrauw, MD, Ph.D. 2. 1 MEG Center,
2 Division of Neurology, 3 Division of Neurosurgery, and 4 Department of Radiology ...
Cited by 4 - Related articles - OhioLINK OLinks - Check Library Holdings - All 3 versions - Import into EndNote


X Huo, Y Wang, R Kotecha, EG Kirtman… - Brain topography, 2011 - Springer
Abstract Recent studies in adults have found consistent contralateral high gamma activities
in the sensorimotor cortex during unilateral finger movement. However, no study has
reported on this same phenomenon in children. We hypothesized that contralateral high ...
Cited by 1 - Related articles - Find it with OLinks - Full-Text @ Pratt Library - All 3 versions - Import into EndNote
 

Third author paper (8)


J Xiang, Y Liu, Y Wang, EG Kirtman, R Kotecha… - Epileptic Disord, 2009 - jle.com
Summary: Purpose. Invasive intracranial recordings have suggested that high-frequency
oscillation is involved in epileptogenesis and is highly localized to epileptogenic zones. The
aim of the present study is to characterize the frequency and spatial patterns of high- ...
Cited by 9 - Related articles - All 4 versions - Import into EndNote


R Zhang, T Wu, Y Wang, H Liu, Y Zou, W Liu… - Seizure, 2011 - Elsevier
... Rui Zhang a , Ting Wu b , Yingying Wang d , e , Hongyi Liu a , Yuanjie Zou a , Wen Liu c , Jing
Xiang d , Chaoyong Xiao c , Lu Yang b and Zhen Fu f , Corresponding Author Contact ... b MEG
Center, Brain Hospital Affiliated of Nanjing Medical University, Nanjing, China. ...
Related articles - Find Full-Text at UC - OhioLINK OLinks - Check Library Holdings - All 2 versions - Import into EndNote

 

Gamma oscillations in the primary motor cortex studied with MEG

X Huo, J Xiang, Y Wang, EG Kirtman… - Brain and …, 2010 - Elsevier
In recent years, there has been a growing interest on the role of gamma band (> 30Hz)
neural oscillations in motor control, although the function of this activity in motor control is
unknown clearly. With the goal of discussing the high frequency sources non-invasively ...
Cited by 4 - Related articles - Find it with OLinks - Full-Text @ Pratt Library - All 6 versions - Import into EndNote 


X Wang, J Xiang, Y Wang, M Pardos… - … : The Journal of …, 2010 - Wiley Online Library
... of motor cortex in the pediatric migraine was altered, this study provides pilot data for further
investigation of the cerebral mechanisms of migraine with MEG and advanced ... (c) Analysis and
Interpretation of DataXiaoshan Wang, Jing Xiang, Xiaolin Huo, Yingying Wang, Andrew D ...
Cited by 1 - Related articles - Find it with OLinks - Full-Text @ Pratt Library - All 3 versions - Import into EndNote


J Xiang, Z Xiao, Y Wang, Y Feng, H Qiao… - International Congress …, 2007 - Elsevier
The present study aimed to investigate whether magnetoencephalography (MEG)
information could result in the detection of subtle anatomical abnormalities at re-review of
conventional magnetic resonance imaging (MRI) by a new MEG guided post-image ...
Related articles - Find it with OLinks - Full-Text @ Pratt Library - Import into EndNote

 

Modeling the developmental patterns of auditory evoked magnetic fields in children

R Kotecha, M Pardos, Y Wang, T Wu, P Horn… - PloS one, 2009 - dx.plos.org
... Rupesh Kotecha 1 , Maria Pardos 1 , Yingying Wang 1 , Ting Wu 1 , Paul Horn 1 , 2 , David Brown
3 , 4 , Douglas Rose 1 , Ton deGrauw 1 , Jing Xiang 1 *. 1 MEG Center, Department of Neurology,
Cincinnati Children's Hospital Medical Center, Cincinnati, Ohio, United States of ...
Cited by 9 - Related articles - Cached - Find it with OLinks - Full-Text @ Pratt Library - All 9 versions - Import into EndNote 


Y Liu, J Xiang, Y Wang, JJ Vannest, AW Byars… - Brain topography, 2008 - Springer
... Yinhong Liu Æ Jing Xiang Æ Yingying Wang Æ Jennifer J. Vannest Æ Anna W. Byars Æ Douglas
F. Rose ... spatial and frequency differences between recognizing concrete and abstract words using
a 275 channel whole head magnetoencephalography (MEG) system. ...
Cited by 5 - Related articles - Find it with OLinks - Full-Text @ Pratt Library - BL Direct - All 3 versions - Import into EndNote



R Kotecha, J Xiang, Y Wang, X Huo… - International Journal of …, 2009 - Elsevier
... a MEG Center, Department of Neurology, Cincinnati Children's Hospital Medical Center, 3333
Burnet Avenue, Cincinnati, OH, 45220, USA. Received 23 September 2008; accepted 31 October
2008. Available online 14 November 2008. Abstract. ... 3.1. Physical MEG waveforms. ...
Cited by 9 - Related articles - Find it with OLinks - Full-Text @ Pratt Library - All 3 versions - Import into EndNote 


4th, 6th, 7th, or 10th author paper (3+4)


…, SK Holland, J Xiang, Y Wang - … , Proceedings of the …, 2010 - ieeexplore.ieee.org
Abstract This paper introduces a source localization technique that exploits the high
temporal resolution of neuronal magnetoencephalography (MEG) data to locate the
originating sources within the head. A traditional frequency beamforming algorithm was ...
Related articles - Find Full-Text at UC - OhioLINK OLinks - Check Library Holdings - All 3 versions - Import into EndNote
 

Aberrant high-gamma oscillations in the somatosensory cortex of children with cerebral palsy: A meg study

…, M Bryce, S Huang, X Huo, Y Wang… - Brain and …, 2011 - Elsevier
Objective: Our study is to investigate somatosensory dysfunction in children with spastic
cerebral palsy (CP) using magnetoencephalography (MEG) and synthetic aperture
magnetometry (SAM). Methods: Six children with spastic CP and six age-and gender- ...
Related articles - Find it with OLinks - Full-Text @ Pratt Library - All 3 versions - Import into EndNote


…, Y Chen, L Meng, X Wang, Y Wang - 17th International …, 2010 - Springer
Our previous studies have demonstrated that Morlet-wavelet transform with an extra large
sigma value could precisely determine the frequency signatures of neuromagnetic signals.
Unfortunately, the increase of frequency sensitivity is associated with a decrease of ...
Related articles - Find Full-Text at UC - OhioLINK OLinks - Check Library Holdings - All 3 versions - Import into EndNote
 
…, D Rose, A Byars, D Brown, JH Seo, Y Wang… - Epilepsy research, 2010 - Elsevier
... Methods. In this magnetoencephalography (MEG) study, 10 patients and 10 age- and
gender-matched healthy controls were investigated with the multi-feature mismatch negativity
(MMN) paradigm. ... Antiepileptic drugs tapered more than 24 h before MEG study, Side, ...
Cited by 3 - Related articles - Find it with OLinks - Full-Text @ Pratt Library - All 4 versions - Import into EndNote
 
…, T Kujala, J Xiang, J Vannest, Y Wang… - 17th International …, 2010 - Springer
... Ki Heyeong Lee1, Hisako Fujiwara1, Teija Kujala3, Jing Xiang1, Jennifer Vannest1,2, Yingying
Wang1, Nat ... In this MEG study we aimed to register two types of event-related ... which gives possibility
to simultaneously register acoustically and visually presented words (Wang et al. ...
Cited by 1 - Related articles - Find Full-Text at UC - OhioLINK OLinks - Check Library Holdings - All 2 versions - Import into EndNote
 
 
…, D Brown, P Horn, Y Wang… - International …, 2011 - informahealthcare.com
... 1,6 David Brown, 3 Paul Horn, 1,4 Yingying Wang, 1 Hisako Fujiwara, 1 Jing Xiang, 1 Marielle
A. Kabbouche, 1,6 Scott W. Powers, 5,6 and Andrew D. Hershey, 1,6 ... We would like to thank Nat
Hemasilphin and Elliah Kirtman for their technical assistance in MEG recordings. ...
Related articles - Find Full-Text at UC - Check Library Holdings - All 4 versions - Import into EndNote

Y Chen, J Xiang, EG Kirtman, Y Wang… - Clinical …, 2010 - Elsevier
... children. Methods. Sixty healthy children and 20 adults were studied with a whole-head
magnetoencephalography (MEG) system. The adults were included to find out when
the markers stabilize. Visual ... 2.3. MEG recordings. The MEG ...
Related articles - Find it with OLinks - Full-Text @ Pratt Library - All 4 versions - Import into EndNote

Monday, November 28, 2011

Good point from Dr. Nicols.

Dear Torsten,

Randomise doesn't give you the critical cluster size threshold by default, but it's easy to obtain.  If you add the -N option to randomise, for each corrp image you'll get a .txt file that gives the permutation distribution of the maximum statistic (whether that's max voxel T, max cluster size, max TFCE score, whatever).  If you find the 95%ile of that distribution, that's the 5% critical threshold based on permutation.  Loading that in Matlab and finding this percentile is easy:

MaxC=load('permdist.txt');
Nperm=length(MaxC);
sMaxC=sort(MaxC);
Level=0.05;
CritC=sMaxC(ceil(Nperm*Crit))

but you're right, it's something that I always report in papers.  I'll try to get that printed out with, say, the -v flag, in an future version.


My problem with 3dcluster, alphasim, and any Monte Carlo based cluster inference tool, is that you have to believe in the Gaussian autocorrelation *and* stationarity that the simulations are based on.  VBM data are widely acknowledged to exhibit nonstationary smoothness, but whenever I've looked at a FWHM image from FMRI data I see hints of structure there too.  Randomise or any permutation-based procedure will automatically account for any nonstationarity in the data, and is not vulnerable to errors in estimated FWHM smoothness (even if the data were stationary).

Permutation is "exact", in that it guaranteed to control false positive risk with very weak assumptions, but it's not perfect: Parametric models can provide better power *when* all the assumptions are satisfied [1].  But if lots and lots of people find better results with the Monte Carlo method than with permutation, it might be that the Monte Carlo method is inflating significances.  The traditional way of comparing methods, with Monte Carlo simulations of homogeneous smooth Gaussian noise, won't reveal this (as the parametric assumptions *define* the Monte Carlo method, and permutation can't out-perform that).  A large body of null data with real (i.e. messy) spatial structured noise would be needed to tested to see if there is a substantial statistical inefficiency in permutation cluster size inference.

Hope this helps!

-Tom

[1] However, in all the standard settings, e.g. t-tests, permutation tests have asymtotic relative efficiency of 1, i.e. will be as powerful as parametric tests when larger and larger sample sizes are considered.
[2] Random Field Theory makes these assumptions too, and additionally approximations in the P-value formulas, but these are just more reasons not to use RFT---thought RFT does at least have a way of handling nonstationarity.

Sunday, November 20, 2011

A BME tries hard to understand these basic resesarch question rasied in neurosciene field.

With a BME background, I had a hard time to remember all these brain anatomy and try to understand the rationale behind the imaging results.  Well, I read a lot online to build up my knowledge base.  Here is an article which grabbed my attention.

Forward:

July 31, 2009

Chimp Study Offers New Clues to Language

BrocaHuman
Why don’t chimpanzees have language the way humans do? Researchers are confident that it has something to do with differences in their brains that arose sometime in the past 5 million to 7 million years, when the chimp and human lines went their evolutionary ways. But exactly what differences account for human language are not entirely clear. Size might have something to do with it, because the modern human brain is about 3.6 times as big as that of a chimp. And yet chimp brains appear to share many features with their human counterparts, including a frontal lobe region called Broca’s area (purple in image) that in humans is closely associated with speech and language.

Most studies of Broca’s area in human brains have concluded that it is larger on the left side than the right, which seems to correlate with the finding that 94% of right-handers do most of their speech and language processing on the left sides of their brains. Scientists had long assumed that this asymmetrical enlargement of Broca’s area in humans was key to language abilities. But in 2001, researchers led by William Hopkins, a primate neuroanatomist at Emory University in Atlanta, began reporting that the brains of many apes also had asymmetrical Broca’s areas. The first such report, in the 29 November 2001 issue of Nature, found enlarged left-side Broca’s areas in the brains of chimpanzees, bonobos, and gorillas. And in a 2008 paper in Current Biology, Hopkins and his colleagues reported that Broca’s area is activated in chimp brains when they communicate with gestures or vocalizations. Hopkins and his co-workers concluded that the enlargement of Broca’s area, and its role in communication, began before the chimp-human split and was not unique to humans.

Yet a new paper, published online last week in Cerebral Cortex, challenges some of these findings and argues once again that the language centers of human brains are special.
The new study, led by evolutionary neuroanatomist Chet Sherwood of George Washington University in Washington, D.C., finds that Broca’s area in the chimpanzee brain does not show a clear asymmetry. And here’s a surprise: One of the co-authors is none other than William Hopkins. How can researchers come up with such conflicting results on such a fundamental issue, one important to understanding the evolution of language?

The answer lies largely with the difficulties in studying Broca’s area. For starters, researchers do not always agree about exactly what part of the frontal lobe should be included under that name. Thus, many brain experts define Broca’s area as two adjacent regions, called Brodmann’s areas 44 and 45, which have been associated respectively with the verbal production of speech and giving meaning to speech. But others have included a somewhat larger area in their studies, called the inferior frontal gyrus (IFG), which includes areas 44 and 45 but a few other structures as well, such as Brodmann’s area 47. Hopkins’s 2008 study, for example focused on the IFG, whereas his 2001 study targetted only area 44.

Another obstacle is that there is great variation among both humans and chimps in the sizes of their Broca’s areas, how asymmetric they are, and even their exact location in the brain. Thus, one key study in 10 humans (five male and five female), led by neuroanatomist Katrin Amunts of the Institute of Medicine in Jülich, Germany, found that area 44 was larger on the left side of the brain in all subjects, but the difference was only statistically significant for the men—whereas area 45 was only significantly larger on the left side for the women! (Nevertheless, this study did confirm the overall enlargement of Broca’s area on the left side.)

For the new study, Sherwood and his colleagues focused primarily on areas 44 and 45. The team studied the brains of 12 chimpanzees that had lived at the Yerkes National Primate Research Center in Atlanta. Within 14 hours of each chimp’s death, its brain was removed and preserved to avoid shrinkage and other artifacts; it was then scanned with MRI and eventually sectioned into tissue blocks. The boundaries of Brodmann’s areas 44 and 45 were defined using special software, and parameters including the volume of Broca’s area and the number of neurons it contained were measured.

The team found that although some of the chimps had what they called “notable asymmetry” in their Broca’s areas—defined as more than a 10% difference in volume or number of neurons between the two sides of their brains—there was no consistent pattern in the direction of the asymmetry. In other words, there was no evidence that chimps have enlarged Broca’s areas on the left side of their brains as humans do.

As for why the new study differs with Hopkins’s previous work, the researchers suggested, among several possibilities, that the earlier studies—which relied upon MRI but not additional tissue sectioning to more exactly define areas 44 and 45—might have picked up differences in underlying white matter, which forms connections with other parts of the brain rather than restricting itself to the gray matter of Broca’s area, where speech processing takes place. If so, the team concludes, the common ancestor of chimps and humans may have evolved symmetries in white matter connectivity before the chimp-human split, possibly associated with gestural or vocal communication, and only afterward did the speech- and language-processing areas themselves become asymmetric.
Although Hopkins, as a co-author of the paper, signed off on this suggestion, he told me in an e-mail that he thinks the jury is still out on whether the Broca’s area of chimps is really asymmetric. For example, he thinks that the team’s data could still be interpreted to indicate that area 44 in chimps is larger on the left side, although probably not area 45. “I think there is much more to the Broca’s story,” Hopkins says. Dean Falk, an anthropologist at Florida State University in Tallahassee, told me that although the paper has “important implications,” she is not convinced by the authors’ suggestions about why the new results differ from Hopkins’s earlier work. Falk thinks the researchers should have included Brodmann’s area 47 in their study because, she says, this area “is now known to be important in semantic processing and might even be more important for evolutionary studies” than areas 44 and 45.

Nevertheless, the authors say that their results argue anew for human uniqueness. Although the human brain is 3.6 times larger than the chimp brain, they say, the new work shows that on average the left-brain Brodmann’s area 44 is 6.6 times larger in humans and left-brain Brodmann’s area 45 is 6.0 times larger than in chimpanzees. “Because areas 44 and 45 are among the most greatly expanded cortical areas yet identified in humans,” the team writes, “this evidence supports the conclusion that enlargement of Broca’s area on the left side is an evolutionary specialization.”

—Michael Balter
Photo credit: Patrick Hof

Tuesday, November 1, 2011

A bash script to do DTI analysis.

Tzipi, who is our new post-doc from Israel, is a newbie to Linux.  She is interested in DTI and fMRI studies.

For helping her and also for my own good (convenience for future analysis), I wrote a nice small script to do DTI analysis. I would like to distribute it here freely.  I am a big fan of open-source.  Thus, feel free to use it.  Well, if you want to sponsor my research, also feel free to support me!



Downloads:
My script:  yw_dti_pipeline_for1subject.sh
A sample data: Test data

I tried to test Tzipi's data.  Well, the DTI protocol is weird compared with regular 32 dir data from philips 3T.  I need to change the script a little bit for her.

===================================================================
Updated Nov.2. 2011  script downloading: yw_dti_for1subject_v20111102.sh
Tzipi's bvals & bvecs:  bvals  bvecs
Tzipi's sample data: Tzipi test data

Small perl programs to share:
(1) convert bvals and bvecs into one file for AFNI 3dDWItoDT:  fsl_bvals_bvecs2afni.zip
(2) convert bvals and bvecs into one file for DTIStudio: fsl_bvals_bvecs2dtistudio.zip
(3) rotate the vecs: rotate_bvecs

Download all together:  All Together!

Please report bugs to Yingying at yingying.wang@cchmc.org or leave your comments here.
====================================================================

You can modify it  according to your own needs.  This is a very basic one.

#! /bin/bash

# get dti from dwi using FSL or AFNI pipeline
# Yingying [yingying.wang@cchmc.org]
# Advisor: Scott K. Holland [scott.holland@cchmc.org]
# 9.30.2011

# get started
echo "Welcome to DTI processing pipeline Beta 1.0! Any questions, please contact Yingying at 513-636-3495 or yingying.wang@cchmc.org"
echo "please enter the subject's folder name (highly recommend to use the subject id as the folder name):"
read -e subid
# check directory exist
if [[ ! -d "$subid" ]]
then
    echo "Oops, subject name given but the directory \"$subid\" does not exist! Please double check your subject folder name."
    exit 1
fi

echo "Checking the integrity of your data (we need subject's DWI nii image, bveces and bvals)"

orig_image=`imglob $subid/data_orig`

if [[ -z "orig_image" ]]
then
    echo "The subject's directory is there but the data_orig image is not"
    exit 1
fi

if [[ ! -f "$subid/data_orig.bvals" ]] || [[ ! -f "$subid/data_orig.bvecs" ]]
then
    echo "Either one of these files does not exist $subid/data_orig.bvals $subid/data_orig.bvecs, they should both exist"
    exit 1
fi

if [[ -z `imglob $subid/data_notrace` ]]
then
    remtrace=0
    echo "Pre-processing is almost ready ... check for the DWI and make sure the data bvecs is right"
    echo "Do you need to remove the trace volume?(No:0,YES:1)default:No"
    read -e remtrace
    if [[ $remtrace -eq 1 ]]
    then
        echo "Accordint to your input $remtrace, Your option is YES"
        echo "Now dealing with the tract volume"
        orig_vol=`fslsize $subid/data_orig | grep -e "^dim4" | awk '{ print $2 }'`
        newvol_notrace=`expr $orig_vol - 1`
        fslroi $subid/data_orig $subid/data_notrace 0 $newvol_notrace
        notrace_foreddy="data_notrace"
        cut -f `seq -s, 1 $newvol_notrace` -d \  $subid/data_orig.bvals > $subid/bvals
        cut -f`seq -s, 1 $newvol_notrace` -d \  $subid/data_orig.bvecs > $subid/bvecs
        echo "Congratulations! Trace volume has been successfully removed!"
    else
        echo "No trace volume according to your input $remtrace"
        notrace_foreddy="data_orig"
        cp $subid/data_orig.bvals $subid/bvals
        cp $subid/data_orig.bvecs $subid/bvecs
    fi
fi

if [[ -z `imglob $subid/data` ]]
then
    echo "Now eddy_current correction starts ... it may take a while, go to get a cup of coffee or chat with Dr. Holland, Ha Ha ..."
    cd $subid/
    eddy_correct $notrace_foreddy data 0
    rm -f bvecs_old
    rotate_bvecs data.ecclog bvecs
    cd ../
    echo "Successfully done!"
fi

if [[ -z `imglob $subid/nodif` ]]
then
    echo "Get the B0 image"
    #make the first volume the nodif (B=0 reference)
    fslroi $subid/data $subid/nodif 0 1
    echo "B0 image has been generated!"
fi

if [[ -z `imglob $subid/nodif_brain_mask` ]]
then
    # default mask threshold
    betthr=0.3
    echo "Please input a threshold for the brain mask(default:0.3):"
    read -e betthr
    echo "making a brain mask using threshold \"$betthr\"..."
    bet $subid/nodif $subid/nodif_brain -R -f $betthr -m
    echo "Brain mask is done!"
fi

echo "The real DTI process is ready to go!"
echo "Do you want to use FSL(option:1),AFNI(option:2),Both(option:3)"
read -e opts
case $opts in
1 )
    # make folder to put fsl results in
    rm -fr $subid/fsl_results
    rm -fr $subid/tmp
    mkdir -p $subid/fsl_results
    mkdir -p $subid/tmp
   
    echo "FSL processing is undergoing ..."
    dtifit -k $subid/data -o $subid/fsl_results/${subid}_dtifit -m $subid/nodif_brain_mask -r $subid/bvecs -b $subid/bvals -w 1> $subid/tmp/fsl_stdoutput 2> $subid/tmp/fsl_errors
   
    imcp $subid/fsl_results/${subid}_dtifit_L1 $subid/fsl_results/${subid}_dtifit_AD 1>> $subid/tmp/fsl_stdoutput 2>> $subid/tmp/fsl_errors
   
    fslmaths $subid/fsl_results/${subid}_dtifit_L2 -add $subid/fsl_results/${subid}_dtifit_L3 -div 2 $subid/fsl_results/${subid}_dtifit_RD 1>> $subid/tmp/fsl_stdoutput 2>> $subid/tmp/fsl_errors
   
    if [[ -s $subid/tmp/fsl_errors ]]
    then
        echo "Something is wrong:"
        echo `cat $subid/tmp/fsl_errors`
    else
        echo "YEAH! FSL process is done! See you soon! :-)"
    fi
    ;;
   
2 )
    # make AFNI folder and put AFNI results there   
    rm -fr $subid/afni_results
    mkdir -p $subid/afni_results
    rm -fr $subid/tmp
    mkdir -p $subid/tmp
   
    echo "AFNI processing is undergoing ..."
   
    # preparation: copy files to the afni_results folder
    imcp $subid/data $subid/afni_results/data 1> $subid/tmp/afni_stdoutput 2> $subid/tmp/afni_errors
    imcp $subid/nodif_brain_mask $subid/afni_results/nodif_brain_mask 1>> $subid/tmp/afni_stdoutput 2>> $subid/tmp/afni_errors
   
    # use nodif as the anatomical image
    imcp $subid/nodif_brain $subid/afni_results/nodif_brain 1>> $subid/tmp/afni_stdoutput 2>> $subid/tmp/afni_errors
   
    # convert bvals and bvecs to afni format
    cd $subid
    bvals_bvecs_fsl2afni.pl > afni_results/grad.afni
   
    cd afni_results
    fslchfiletype NIFTI data 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    fslchfiletype NIFTI nodif_brain_mask 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    fslchfiletype NIFTI nodif_brain 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
   
    # copy data to AFNI format
    3dcopy data.nii data 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dcopy nodif_brain_mask.nii mask 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dcopy nodif_brain.nii b0_anat 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
   
    # compute dti from dwis
    3dDWItoDT -prefix DT -mask mask+orig -reweight -max_iter 10 -max_iter_rw 10 -eigs grad.afni data+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dbucket -prefix ${subid}_afni_L1 -fbuc 'DT+orig[6]' 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dbucket -prefix ${subid}_afni_L2 -fbuc 'DT+orig[7]' 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dbucket -prefix ${subid}_afni_L3 -fbuc 'DT+orig[8]' 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dbucket -prefix ${subid}_afni_FA -fbuc 'DT+orig[18]' 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dbucket -prefix ${subid}_afni_MD -fbuc 'DT+orig[19]' 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
   
    # Get AD and RD from L1, L2, L3
    3dcopy ${subid}_afni_L1+orig ${subid}_afni_AD+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dcalc -a ${subid}_afni_L2+orig -b ${subid}_afni_L3+orig -expr '(a+b)/2' -prefix ${subid}_afni_RD 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
   
    # convert to nii
    3dAFNItoNIFTI ${subid}_afni_L1+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dAFNItoNIFTI ${subid}_afni_L2+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dAFNItoNIFTI ${subid}_afni_L3+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dAFNItoNIFTI ${subid}_afni_FA+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dAFNItoNIFTI ${subid}_afni_MD+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
   
    fslchfiletype NIFTI_GZ ${subid}_afni_L1 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    fslchfiletype NIFTI_GZ ${subid}_afni_L2 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    fslchfiletype NIFTI_GZ ${subid}_afni_L3 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    fslchfiletype NIFTI_GZ ${subid}_afni_FA 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    fslchfiletype NIFTI_GZ ${subid}_afni_MD 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
   
    imcp ${subid}_afni_L1 ${subid}_afni_AD 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_errors
   
    fslmaths ${subid}_afni_L2 -add ${subid}_afni_L3 -div 2 ${subid}_afni_RD.nii.gz 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_errors
   
    if [[ -s ../tmp/afni_errors ]]
    then
        echo "Something is wrong:"
        echo `cat ../tmp/afni_errors`
    else
        echo "AFNI process is done without Talairach! See you soon! :-)"
    fi
   
    echo "Do you want to Talairach(No:0,YES:1) default:No"
    read -e opts2   
    case $opts2 in
    0 )   
        echo "No talariach will be applied!"
        echo "Job is Done!"
        exit 1
        ;;
    1 )
        echo "Apply Talairach ...It is time for a break."
        # Get afni folder
        afnidirs=`which afni`
       
        # First, Talairach of anatomical image
        @auto_tlrc -base ${afnidirs%/afni}/TT_icbm452+tlrc -input b0_anat+orig 1> ../tmp/afni_stdoutput 2> ../tmp/afni_stdoutput
       
        # Talairach transform
        @auto_tlrc -apar b0_anat+tlrc -input $subid_afni_AD+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
        @auto_tlrc -apar b0_anat+tlrc -input $subid_afni_FA+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
        @auto_tlrc -apar b0_anat+tlrc -input $subid_afni_MD+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
        @auto_tlrc -apar b0_anat+tlrc -input $subid_afni_RD+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
       
        if [[ -s ../tmp/afni_errors ]]
        then
            echo "Something is wrong:"
            echo `cat ../tmp/afni_errors`
        else
            echo "Successfully Talairached! See you soon! :-)"   
        fi
        exit 1
        ;;
    * ) echo "Sorry, invalid option!"
        exit 1
        ;;
    esac
    ;;
3 )
    # make folder to put fsl results in
    rm -fr $subid/fsl_results
    rm -fr $subid/tmp
    mkdir -p $subid/fsl_results
    mkdir -p $subid/tmp
   
    echo "FSL processing is undergoing ..."
    dtifit -k $subid/data -o $subid/fsl_results/${subid}_dtifit -m $subid/nodif_brain_mask -r $subid/bvecs -b $subid/bvals -w 1> $subid/tmp/fsl_stdoutput 2> $subid/tmp/fsl_errors
   
    imcp $subid/fsl_results/${subid}_dtifit_L1 $subid/fsl_results/${subid}_dtifit_AD 1>> $subid/tmp/fsl_stdoutput 2>> $subid/tmp/fsl_errors
   
    fslmaths $subid/fsl_results/${subid}_dtifit_L2 -add $subid/fsl_results/${subid}_dtifit_L3 -div 2 $subid/fsl_results/${subid}_dtifit_RD 1>> $subid/tmp/fsl_stdoutput 2>> $subid/tmp/fsl_errors
   
    if [[ -s $subid/tmp/fsl_errors ]]
    then
        echo "Something is wrong:"
        echo `cat $subid/tmp/fsl_errors`
    else
        echo "YEAH! FSL process is done! Next is AFNI!"
    fi
   
        # make AFNI folder and put AFNI results there   
    rm -fr $subid/afni_results
    mkdir -p $subid/afni_results
    rm -fr $subid/tmp
    mkdir -p $subid/tmp
   
    echo "AFNI processing is undergoing ..."
   
    # preparation: copy files to the afni_results folder
    imcp $subid/data $subid/afni_results/data 1> $subid/tmp/afni_stdoutput 2> $subid/tmp/afni_errors
    imcp $subid/nodif_brain_mask $subid/afni_results/nodif_brain_mask 1>> $subid/tmp/afni_stdoutput 2>> $subid/tmp/afni_errors
   
    # use nodif as the anatomical image
    imcp $subid/nodif_brain $subid/afni_results/nodif_brain 1>> $subid/tmp/afni_stdoutput 2>> $subid/tmp/afni_errors
   
    # convert bvals and bvecs to afni format
    cd $subid
    bvals_bvecs_fsl2afni.pl > afni_results/grad.afni
   
    cd afni_results
    fslchfiletype NIFTI data 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    fslchfiletype NIFTI nodif_brain_mask 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    fslchfiletype NIFTI nodif_brain 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
   
    # copy data to AFNI format
    3dcopy data.nii data 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dcopy nodif_brain_mask.nii mask 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dcopy nodif_brain.nii b0_anat 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
   
    # compute dti from dwis
    3dDWItoDT -prefix DT -mask mask+orig -reweight -max_iter 10 -max_iter_rw 10 -eigs grad.afni data+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dbucket -prefix ${subid}_afni_L1 -fbuc 'DT+orig[6]' 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dbucket -prefix ${subid}_afni_L2 -fbuc 'DT+orig[7]' 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dbucket -prefix ${subid}_afni_L3 -fbuc 'DT+orig[8]' 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dbucket -prefix ${subid}_afni_FA -fbuc 'DT+orig[18]' 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dbucket -prefix ${subid}_afni_MD -fbuc 'DT+orig[19]' 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
   
    # Get AD and RD from L1, L2, L3
    3dcopy ${subid}_afni_L1+orig ${subid}_afni_AD+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dcalc -a ${subid}_afni_L2+orig -b ${subid}_afni_L3+orig -expr '(a+b)/2' -prefix ${subid}_afni_RD 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
   
    # convert to nii
    3dAFNItoNIFTI ${subid}_afni_L1+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dAFNItoNIFTI ${subid}_afni_L2+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dAFNItoNIFTI ${subid}_afni_L3+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dAFNItoNIFTI ${subid}_afni_FA+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    3dAFNItoNIFTI ${subid}_afni_MD+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
   
    fslchfiletype NIFTI_GZ ${subid}_afni_L1 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    fslchfiletype NIFTI_GZ ${subid}_afni_L2 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    fslchfiletype NIFTI_GZ ${subid}_afni_L3 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    fslchfiletype NIFTI_GZ ${subid}_afni_FA 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
    fslchfiletype NIFTI_GZ ${subid}_afni_MD 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
   
    imcp ${subid}_afni_L1 ${subid}_afni_AD 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_errors
   
    fslmaths ${subid}_afni_L2 -add ${subid}_afni_L3 -div 2 ${subid}_afni_RD.nii.gz 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_errors
   
    if [[ -s ../tmp/afni_errors ]]
    then
        echo "Something is wrong:"
        echo `cat ../tmp/afni_errors`
    else
        echo "AFNI process is done without Talairach! See you soon! :-)"
    fi
   
    echo "Do you want to Talairach(No:0,YES:1) default:No"
    read -e opts2   
    case $opts2 in
    0 )   
        echo "No talariach will be applied!"
        echo "Job is Done!"
        exit 1
        ;;
    1 )
        echo "Apply Talairach ...It is time for a break."
        # Get afni folder
        afnidirs=`which afni`
       
        # First, Talairach of anatomical image
        @auto_tlrc -base ${afnidirs%/afni}/TT_icbm452+tlrc -input b0_anat+orig 1> ../tmp/afni_stdoutput 2> ../tmp/afni_stdoutput
       
        # Talairach transform
        @auto_tlrc -apar b0_anat+tlrc -input $subid_afni_AD+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
        @auto_tlrc -apar b0_anat+tlrc -input $subid_afni_FA+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
        @auto_tlrc -apar b0_anat+tlrc -input $subid_afni_MD+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
        @auto_tlrc -apar b0_anat+tlrc -input $subid_afni_RD+orig 1>> ../tmp/afni_stdoutput 2>> ../tmp/afni_stdoutput
       
        if [[ -s ../tmp/afni_errors ]]
        then
            echo "Something is wrong:"
            echo `cat ../tmp/afni_errors`
        else
            echo "Successfully Talairached! See you soon! :-)"   
        fi
        exit 1
        ;;
    * ) echo "Sorry, invalid option!"
        exit 1
        ;;
    esac
    ;;
* )
    echo "Sorry, invalid option!"
    exit 1
    ;;               
esac

Found a good website (sharing with you):  http://www.psychology.gatech.edu/cabi/Resources/DTI/index.shtml