Dwipreproc command error

Dear experts

I have been facing this error for couple of my subjects after running dwipreproc and I was wondering if anyone can help to solve the problem.

Command: applytopup --imain=dwi_pe_1.nii --datain=applytopup_config.txt --inindex=1 --topup=field --out=dwi_pe_1_topup.nii.gz --method=jac
Command: mrconvert dwi_pe_1_topup.nii.gz dwi_pe_1_topup.mif -json_import dwi_pe_1.json
Traceback (most recent call last):
File “/home/luna.kuleuven.be/u0061701/mrtrix3/bin/dwipreproc”, line 488, in
run.command('mrconvert ’ + temp_path + ’ ’ + output_path + ’ -json_import ’ + json_path)
File “/home/luna.kuleuven.be/u0061701/mrtrix3/lib/mrtrix3/run.py”, line 183, in command
stderr_text = tempfiles[index][1].read().decode(‘utf-8’)
File “/usr/lib/python2.7/encodings/utf_8.py”, line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xc9 in position 228: invalid continuation byte

Running the applytopup inside the folder also did not solve the problem.

Thanks and cheers,

Please ignore. The issue was solved by replacing “Ë” with “E” in the subject’s name of json file. :slight_smile:

Cheers, H

Hi Hamed,

This issue is identical to the one already raised on GitHub here. We’ll need to re-raise that issue, and try to decide the best compromise beween development time & robustness of solution. So thanks for posting, and glad you’ve got a quick and easy work-around :+1:


Thanks Rob.
Cheers, -H