# DTI Nifti data import via DWI Convert Module

**URL:** <https://discourse.slicer.org/t/dti-nifti-data-import-via-dwi-convert-module/1460>\
**Category:** Support\
**Tags:** dwiconvert, dwi\
**Created:** [November 14, 2017, 11:48pm UTC](https://discourse.slicer.org/t/dti-nifti-data-import-via-dwi-convert-module/1460 "2017-11-14T23:48:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DTI](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@DTI](https://discourse.slicer.org/u/DTI)\
**Post date:** [November 14, 2017, 11:48pm UTC](https://discourse.slicer.org/t/dti-nifti-data-import-via-dwi-convert-module/1460/1 "2017-11-14T23:48:09Z")

</div>

Hi

I am trying to import DTI data (connectome nifti format) into slicer with the DWI NiftiFSL to Nrrd Converter (Mac OS X 10.12.6, Slicer 4.9). It runs for 120s, but completes with errors\*.

* * *

\*Diffusion-weighted DICOM Import (DWIConvert) standard error:

libc++abi.dylib: terminating with uncaught exception of type itk::ExceptionObject: /Users/kitware/Dashboards/Nightly/Slicer-0-build/BRAINSTools/DWIConvert/DWIConvertLib.cxx:108:  
itk::ERROR: Exception creating converter  
itk::ExceptionObject (0x103e03ae8)  
Location: "unknown"  
File: /Users/kitware/Dashboards/Nightly/Slicer-0-build/BRAINSTools/DWIConvert/DWIConverter.cxx  
Line: 220  
Description: itk::ERROR: Mismatch between count of B Vectors (1) and B Values (143)

* * *

I already tried to reformat the bval and bvec files into columns (delimiter ‘,’ or ’ '), but it still doesn’t work.

Can you tell me, in what format the bval and bvec files have to be to work?

Thank you very much,  
Best regards,

Lorenz

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [November 15, 2017, 3:07am UTC](https://discourse.slicer.org/t/dti-nifti-data-import-via-dwi-convert-module/1460/2 "2017-11-15T03:07:10Z")

</div>

What tool did you use to create your NIfTI file(s)? There are several flavors of NIfTI-dwi.

The format supported by DWIConvert is FSL-style, which is also the default output style of dcm2nii. Space-delimited columns, newline-delimited rows; bvec rows correspond to x/y/z column components respectively.

e.g.:

file.bval

```auto
0 1000 1000 1000 ...

```

file.bvec

```auto
x1 x2 x3 x4 ...
y1 y2 y3 y4 ...
z1 z2 z3 z4 ...

```

(there is also a transpose vectors option available for compatibility with some similar software, which will have one b-value per row in file.bval, and one vector per row in file.bvec)

---

<div class="post-metadata">

**Author:** ![DTI](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@DTI](https://discourse.slicer.org/u/DTI)\
**Post date:** [November 15, 2017, 3:48pm UTC](https://discourse.slicer.org/t/dti-nifti-data-import-via-dwi-convert-module/1460/3 "2017-11-15T15:48:03Z")

</div>

Thank you! That worked. I was able to load the images.  
Unfortunately, I have one further question: The now imported images appear side by side when I scroll through them instead of one after the other (see video [https://www.dropbox.com/s/jn6s11njj9c3w5s/nifti.mov?dl=0](https://www.dropbox.com/s/jn6s11njj9c3w5s/nifti.mov?dl=0)). How can I fix this?  
Thank you again, Lorenz

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [November 15, 2017, 4:39pm UTC](https://discourse.slicer.org/t/dti-nifti-data-import-via-dwi-convert-module/1460/4 "2017-11-15T16:39:24Z")

</div>

I’ve seen something similar when DWIConvert loaded a NIfTI with the wrong ITK reader. It could also happen if the strides are wrong because the expected image/slice count doesn’t match the predicted image count based on the header, for some reason.

However, I’m surprised to see a coronal view in the “red” slice viewer, because that is axial by default. Did you change it to coronal? If not, perhaps that is an indication that the orientations are not being interpreted correctly. Was your data acquired as coronal slices?

I can take a look if you are able to share some (anonymized) data. If you prefer to share directly rather than publicly, please share to `inorton at partners dot org` from dropbox/onedrive/etc.

**EDIT: also, if you share data, _please indicate what software was used to convert it_**
