# DWI2response issue

**URL:** <https://community.mrtrix.org/t/dwi2response-issue/989>\
**Category:** Uncategorized\
**Tags:** dwi2response\
**Created:** [June 21, 2017, 7:29pm UTC](https://community.mrtrix.org/t/dwi2response-issue/989 "2017-06-21T19:29:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajdneuro12](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/a/43a26b/32.png) [@ajdneuro12](https://community.mrtrix.org/u/ajdneuro12)\
**Post date:** [June 21, 2017, 7:29pm UTC](https://community.mrtrix.org/t/dwi2response-issue/989/1 "2017-06-21T19:29:14Z")

</div>

Dear MRtrix community,

I am running into an error when I am using the dwi2response function following the HCP instructions.  
My command is:

```auto
/usr/local/mrtrix/mrtrix3/scripts/dwi2response msmt_5tt DWI.mif 5TT.mif RF_WM.txt RF_GM.txt RF_CSF.txt -voxels RF_voxels.mif

```

And I get the following error:

```auto
wi2response tournier dwi.mif wm_ss_response.txt -mask wm_mask.mif -voxels wm_sf_mask.mif -quiet -tempdir /tmp/dwi2response-tmp-PVHEFE/
Traceback (most recent call last):
  File "/usr/local/mrtrix/mrtrix3/scripts/dwi2response", line 120, in <module>
    algorithm.execute()
  File "/usr/local/mrtrix/mrtrix3/scripts/src/dwi2response/msmt_5tt.py", line 92, in execute
    runCommand('dwi2response ' + lib.app.args.wm_algo + ' dwi.mif wm_ss_response.txt -mask wm_mask.mif -voxels wm_sf_mask.mif -quiet -tempdir ' + lib.app.tempDir + recursive_cleanup_option)
  File "/usr/local/mrtrix/mrtrix3/scripts/lib/runCommand.py", line 103, in runCommand
    process = subprocess.Popen(cmdstack[0], stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

```

Thanks so much for any insight as to the problem!

Best,  
Alex

---

<div class="post-metadata">

**Author:** ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)\
**Post date:** [June 22, 2017, 12:57am UTC](https://community.mrtrix.org/t/dwi2response-issue/989/2 "2017-06-22T00:57:04Z")

</div>

Hi Alex,

That’s a slightly unusual one to identify, because the error comes from deep within Python’s `subprocess` module rather than from the _MRtrix3_ code itself. However I’m pretty sure it will be related to [this issue](https://github.com/MRtrix3/mrtrix3/pull/920).

At this line:

```auto
runCommand('dwi2response ' + lib.app.args.wm_algo + ' dwi.mif wm_ss_response.txt -mask wm_mask.mif -voxels wm_sf_mask.mif -quiet -tempdir ' + lib.app.tempDir + recursive_cleanup_option)

```

, the “`runCommand()`” function is trying to execute `dwi2response`, which is a _script_ as opposed to a binary. This use case isn’t supported on certain versions of Python on certain OS’s.

On the current _MRtrix3_ version (`3.0_RC1`), this case is [handled explicitly](https://github.com/MRtrix3/mrtrix3/blob/master/lib/mrtrix3/run.py#L317-L319) by _MRtrix3_ in order to overcome the inconsistency in `subprocess` module implementations. So an _MRtrix3_ update should fix the issue. If this is not an option for you however, you could try instead explicitly invoking Python3 when you run the `dwi2response` script.

Rob
