# Error while running GradQC

**URL:** <https://discourse.slicer.org/t/error-while-running-gradqc/8644>\
**Category:** Support\
**Tags:** diffusion\
**Created:** [October 1, 2019, 9:11pm UTC](https://discourse.slicer.org/t/error-while-running-gradqc/8644 "2019-10-01T21:11:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nabin](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@nabin](https://discourse.slicer.org/u/nabin)\
**Post date:** [October 1, 2019, 9:11pm UTC](https://discourse.slicer.org/t/error-while-running-gradqc/8644/1 "2019-10-01T21:11:17Z")

</div>

Dear Slicer team,

I am trying to run the module GradQC to check the quality of my diffusion data and it’s supposed to be a simple process which should work by giving input as my dwi.nii.gz file and run it but it throws an error as follow. Your support will be highly appreciated.  
Thank you.  
Nabin

**Error:**

diffusionQC standard error:

Traceback (most recent call last):  
File “/Applications/Slicer.app/Contents/Extensions-28257/DiffusionQC/lib/Slicer-4.10/cli-modules/diffusionQC.py”, line 57, in  
QC.run()  
File “/Applications/Slicer.app/Contents/Extensions-28257/DiffusionQC/lib/python2.7/site-packages/plumbum/cli/application.py”, line 572, in run  
retcode = inst.main(\*tailargs)  
File “/Applications/Slicer.app/Contents/Extensions-28257/DiffusionQC/lib/Slicer-4.10/cli-modules/diffusionQC.py”, line 53, in main  
process(self.dwi, self.mask, self.out, self.autoMode)  
File “/Applications/Slicer.app/Contents/Extensions-28257/DiffusionQC/lib/python2.7/site-packages/diffusionqclib/gradient\_process.py”, line 197, in process  
hdr, mri, grad\_axis, slice\_axis, b\_value, gradients = dwi\_attributes(dwiPath)  
File “/Applications/Slicer.app/Contents/Extensions-28257/DiffusionQC/lib/python2.7/site-packages/diffusionqclib/dwi\_attributes.py”, line 8, in dwi\_attributes  
dwi= nrrd.read(file\_name)  
File “/Applications/Slicer.app/Contents/Extensions-28257/DiffusionQC/lib/python2.7/site-packages/nrrd/reader.py”, line 503, in read  
header = read\_header(fh, custom\_field\_map)  
File “/Applications/Slicer.app/Contents/Extensions-28257/DiffusionQC/lib/python2.7/site-packages/nrrd/reader.py”, line 247, in read\_header  
header\_size += \_validate\_magic\_line(magic\_line)  
File “/Applications/Slicer.app/Contents/Extensions-28257/DiffusionQC/lib/python2.7/site-packages/nrrd/reader.py”, line 183, in \_validate\_magic\_line  
raise NRRDError(‘Invalid NRRD magic line. Is this an NRRD file?’)  
nrrd.errors.NRRDError: Invalid NRRD magic line. Is this an NRRD file?

---

<div class="post-metadata">

**Author:** ![tbillah](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tbillah/32/4139_2.png) [@tbillah](https://discourse.slicer.org/u/tbillah)\
**Post date:** [October 2, 2019, 2:43am UTC](https://discourse.slicer.org/t/error-while-running-gradqc/8644/2 "2019-10-02T02:43:44Z")

</div>

Hi @nabin,

Our tool is NRRD only. As you might already know, Slicer can load only NRRD 4D image, not NIFTI 4D image.

For future reference, here is the Tutorial for GradQC:

> **[pnlbwh/SlicerDiffusionQC](https://github.com/pnlbwh/SlicerDiffusionQC)**
>
> Quality checking of DWMRI. Contribute to pnlbwh/SlicerDiffusionQC development by creating an account on GitHub.

However, you can use my NIFTI–\>NRRD conversion tool, obtain an NHDR for the NIFTI image you are trying to GradQC and then load the NHDR header seamlessly to perform GradQC on it.

> <https://github.com/pnlbwh/conversion/blob/master/conversion/nhdr_write.py>

Let me know if you need more help.

-Tashrif

---

<div class="post-metadata">

**Author:** ![nabin](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@nabin](https://discourse.slicer.org/u/nabin)\
**Post date:** [October 2, 2019, 12:45pm UTC](https://discourse.slicer.org/t/error-while-running-gradqc/8644/3 "2019-10-02T12:45:42Z")

</div>

Thanks a lot Tashrif. I will try with this converting it to nrrd format.

Best,

Nabin
