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  

|
August 23, 2007 09:47AM
If you wish to try the very latest (1 day old) technique, you can use the hidden '-lpc' (local Pearson correlation) cost function in 3dAllineate. This has worked well on my test problems, but is still very experimental. In my test problems, it was used as follows:

1) skull strip the anat
2) resample with linear interpolation the EPI to the same grid/resolution as the skull stripped anat, and automask it
3) compute the square of the EPI image to use as a weight, as in
  set aaa = `3dBrickStat -automask -percentile 90 1 90 epi+orig`
  set mmm = $aaa[2]
  echo "90th percentile in EPI is $mmm"
  3dcalc -datum float -prefix epiww2 -a epi+orig -expr "min(1,(a/$mmm))**2.0"

4) 3dAllineate -base epi+orig -weight epiww2+orig -source ssanat+orig -source_automask+4 -weight_frac 1 -maxrot 6 -maxshf 10 -onepass -lpc -cmass+xy -VERB -warp shr -prefix ssanatLPC

* the '-cmass+xy' option says to start the alignment by matching the centers of mass in the x and y direction (R-L and A-P), but not in the z-direction (assuming that you have axial EPI slices)

* the '-warp shr' option means to use shift+rotate only; if you want to allow for general affine, you probably don't want stretching in the z-direction, so then '-warp aff -parfix 9 1.0' might be something to try.

* the epi+orig dataset should only be 1 sub-brick -- you are aligning the anat to the EPI with this, not vice versa. If you want to align the EPI to the anat, you could use -1Dmatrix_save, and then cat_matvec to invert the matrix, and then -1Dmatrix_apply to transform the EPI time series to the anat coordinates -- you can register the EPI time series within itself using 3dvolreg, save those matrices with 3dvolreg's -1Dmatrix_save option, and combine those with 3dAllineate's matrix via cat_matvec, and so forth.

* This approach is still experimental, and you should only try it if you understand what is going on, and if you examine the results carefully at each step (e.g., make sure you have a good skull strip). It gave good to excellent anat-to-EPI alignment (based on sulcal and ventricular matching) in 90+% of the cases I tried. It didn't work particularly well with low quality anats (noisy and poor contrast), or with low quality EPIs (badly shimmed, low contrast). Which emphasizes the importance above all of gathering good data -- something I'd say only about half of FMRI users do. (I've not had my coffee yet this morning, though, so maybe I de-grump later.)

* Using the (scaled) square of the EPI data as a weight emphasizes the bright parts of the EPI -- which is CSF. The idea is that bright EPI CSF in sulci and ventricles will then align to the dark anat CSF in the same structures. Which is why it seems to work well with high quality images and not so well with crappy data (although it still was generally better than the default '-hel' or the '-mi' cost functions in most cases).

* Someday this may get packaged up to be simpler to use, but that will require more time than I have at this moment.
Subject Author Posted

alignment suggestions

Drew August 22, 2007 03:50PM

Re: alignment suggestions

bob cox August 23, 2007 09:47AM

Re: alignment suggestions

jackie yang October 08, 2007 07:02AM

Re: alignment suggestions

Drew August 23, 2007 10:57AM

Re: alignment suggestions

bob cox August 23, 2007 11:08AM