questions > Recalculating bvecs?
Showing 1-3 of 3 posts
Display:
Results per page:
Aug 18, 2017  08:08 PM | Jacob Stubbs - Department of Psychiatry, University of British Columbia, Canada
Recalculating bvecs?
Hi all,

Our scanner acquires the B0 volume at the end (vol0060 out of vol0060) instead of the beginning. The entire FSL diffusion imaging pipeline relies on the B0 being acquired at the beginning (vol0000). After converting from PAR/REC to NIFTI using dcm2nii, I can easily switch the B0 volume to the front, but the bvecs still show my 0's at the end.

Is there a way to use dcm2nii to recalculate the bvecs with the B0 volume at the front? All I need is a modified bvec file that has the 0's at the beginning of each row vs the end

Thanks for any help thrown my way!

Jacob
Aug 19, 2017  11:08 AM | Chris Rorden
RE: Recalculating bvecs?
Hello Jacob,
 While it is convenient if the initial volume is a B=0 volume (e.g. without the directional diffusion weighting and eddy current artifacts), this is not required by FSL. Below are the ways I detect the B=0 (reference) volume(s) in Matlab and Shell scripting and call FSL appropriately
 https://github.com/rordenlab/spmScripts/blob/master/nii_dtibatch.m
 https://github.com/neurolabusc/nii_preprocess/blob/master/dti_1_eddy_correct.sh
The basic issue is that by default Siemens sequences always acquire the B=0 first, and Philips as the last (I could be wrong, but I think that Philips can also average several B=0 images and save this as the last volume). There seem to be four ways to address this:
 1.) Customize the acquisition to have a B=0 as your first image. Default sequences tend to only acquire one B=0, and it is generally a good idea to acquire multiple B=0 volumes to get better MD estimates. If you specify your own direction, it is easy to make the first one be a B=0 volume. I describe this here:
  http://www.mccauslandcenter.sc.edu/crnl/tools/advanced-dti
 2.) Request that authors of DICOM-to-NIfTI converters reorder the output to enforce that the reference volume is stored first. The concern here is that you breaking the correspondence between input images and saved images, which can make troubleshooting harder. 
 3.) Update your scripts to detect the reference volumes.
 4.) Request that FSL tools detect the reference volumes automatically.

Note that what you are requesting is (2), and it requires reordering the BVec, BVal and NIfTI data. While this is do-able, it does mean that the data you get our of the converter is unlike the data you put in. I will think about this, but it does add complexity to my code and it makes the relationship between input DICOMs and output NIfTI much less clear. Personally, it seems like options 1,3,4 are more elegant.
Aug 21, 2017  12:08 PM | Chris Rorden
RE: Recalculating bvecs?
Jacob
 I have added a feature to sort volumes by B-value. You can enable or disable this feature using "-b y" / "-b n". A lot of changes were required since we have to reorder the bvalues, bvectors, volumes and also detect and expunge ADC maps from Philips data. Since I do not have a Philips system, I would suggest you validate the latest version (v1.0.20170821) before we release it. 
  https://github.com/rordenlab/dcm2niix
Since one can toggle this option on and off, it should allow some transparency for troubleshooting acquisitions.