Select Page

BDP: File formats


BrainSuite Diffusion Pipeline (BDP) uses the following file formats during its processing:

DICOM Format

When DICOM format is used as input, it must first be converted to a a 4-D NIfTI-1 file before further processing. DICOM files usually contain both the diffusion weighted images (DWIs) and the scan parameters of the diffusion sequence. You can use a program such as dcm2nii.

NIfTI-1 Data Format (.nii or .nii.gz)

BDP uses NIfTI-1 format for most image input/output operations. The NIfTI-1 format includes an implicit spatial transformation which can consistently describe orientation of the imaging data into a right-handed coordinate system. This helps to avoid confusions related to left-right orientation of the data. BDP relies on the included spatial transform to interpret the orientation information of all images. NIfTI-1 format can describe the spatial transform by sform and/or qform. BDP can read and interpret files with valid qform and/or sform, with preference to sform when both are present. However, as of now, BDP only writes NIfTI-1 files with valid sform (qform_code=0). BDP will add support for valid qform in future releases. BDP can also read both uncompressed (.nii) and compressed (.nii.gz) files and would usually write out compressed files (.nii.gz). Further, BDP supports reading and writing of both 3-D and 4-D images, saved in any of the valid NIfTI-1 datatypes.

B-Value File

BDP requires diffusion gradient information to fit diffusion tensors and orientation distribution functions (ODFs). b-value is a scalar value for each diffusion weighted image, which is related to the diffusion gradient strength. BDP can read/write b-values saved in a plain-text file, usually but not necessarily, saved with .bval extension. The file should contain exactly same number of scalar values as total number of diffusion images in 4D NIfTI files. The file should have a 0 value corresponding to the image with no diffusion encoding (or zero b-value). An example of b-value file can be found here.

Diffusion Gradient Table

Similar to b-values, BDP requires diffusion gradient information to fit diffusion tensors and orientation distribution functions (ODFs). Gradient table describes the diffusion encoding direction for each diffusion weighted image. BDP can read/write gradient tables saved in a plain-text file, usually but not necessarily, saved with .bvec extension. The file should contain exactly same number of gradient directions as total number of diffusion images in 4D NIfTI files. Gradient direction corresponding to no diffusion encoding (or b-value of 0) should also be specified in the file (and could be all zeros). All gradient direction, except b-value of zero, must be a unit vector and should be save in separate row/column. Examples of gradient table file can be found here and here.

B-Matrices

The diffusion scan parameters described by b-value and diffusion gradient table can also be described by a 3×3 matrix, here referred to as “b-matrix”. BDP can read/write b-matrices saved in a plain-text file, usually but not necessarily, saved with .bmat extension. The file should contain exactly same number of b-matrices as the total number of diffusion images in 4D NIfTI files. Zero matrices should be specified corresponding to images with no diffusion encoding. An example of .bmat file can be found here.

Diffusion Tensor File (.eig.nii.gz)

BDP saves eigen-values and eigen-vectors of the fitted diffusion tensor in a file with extension .eig.nii.gz. This file can be loaded in BrainSuite GUI to visualize diffusion tensors, perform tensor based tractography and connectivity analysis. While they are NIfTI files, these files use a non-standard datatype and hence may not be readable by other NIfTI-1 viewers (see eig2nifti converter for saving to standard NIfTI-1 format). The diffusion tensor file also includes orientation information.

Spherical Harmonics Description File (.odf)

BDP describes (and saves) orientation distribution functions (ODFs) by coefficients of Spherical Harmonics (SH). Number of coefficients are truncated after a pre-determined degree of SH. BDP uses the SH described in Haldar and Leahy, 2013. Each SH coefficient is saved in a separate 3-D NIfTI-1 file (see BDP outputs for file names). BrainSuite can read the SH coefficient files via a plain-text file with .odf extension. The .odf files must contains the ordered list of coefficient file-names. The coefficient NIfTI-1 files should be computed and saved  in right-handed coordinate system with RAS convention to avoid any confusion with directions (i.e. the most rapidly increasing voxel index should increase along Right side of subject, followed by Anterior side and then by Superior side of the subject).

Comma-Separated Value

BDP can also compute ROI wise statistics of different estimated diffusion parameters. The computed statistics are written in a comma separated value (.csv) file. .csv files stores tabular data (numbers and text) in plain-text form separated by comma. BDP writes relevant information in first column/row of each .csv files to describe the data appropriately (see Statistics section of Flag description for more details). These files can also be imported in different statistic packages, like Microsoft Excel, for further analysis.