Estimating response function dwi2response error

Dear MRtrix3 team,

I am receiving an error while running the dwi2response function which is below:

Would it be due to an uncompleted installation of the software?! I tried to re-install the software but I ran into more error:

I looked for the proper folder where I previously installed MRtrix to run an update but couldn’t find it, however I see MRtrix folder under nipype installation folder.

Any thought would be much appreciated.

Sincerely,
Saman

Hi Saman,

Problem #1:

OSError: [Errno 2] No such file or directory: '/usr/local/bin/src/dwi2response'

suggests that you have manually moved the dwi2response script into /usr/local/bin/. This won’t work: The bulk of the dwi2response code resides in <mrtrix3_dir>/scripts/src/dwi2response/, and is dynamically queried & run whenever dwi2response is run. This keeps the code for different algorithms separate from one another, and you can even write your own response function estimation algorithm and it will automatically become available as an option in dwi2response (your algorithm’s options will even appear in the help page!). But because this directory can’t be found based on a relative path from dwi2response itself, the script crashes out (I’ll add a more elegant error message). You’re better off adding <mrtrix3_dir>/scripts/ to your PATH environment variable.

The second screenshot doesn’t give us enough information to know what is wrong; the better solution is to capture the entire text output and copy&paste here, wrapped in between triple back-ticks like this for better readability:

```
sh-3.2# ./build
(  1/427) release/cmd/dwi2mask.o
(  2/427) ...
```

On the off chance that you updated MRtrix3 from a pre-March installation, there may be additional steps needed; e.g. you can try re-running the configure script prior to the build script.

Cheers
Rob

Thanks a lot Bob.

Apparently I don’t have a mrtrix3 directory to correct for the address. I’ve followed the instruction on upgrade link and re-running the configuration, and here is the output:

surg1713925:mrtrix3 staff$ sudo ./build clean
Password:
('delete file:', 'release/src/dwi/tractography/GT/externalenergy.o')
('delete file:', 'release/src/dwi/tractography/mapping/gaussian/mapper.o')
('delete file:', 'release/src/dwi/tractography/seeding/dynamic.o')
('delete file:', 'release/src/dwi/tractography/seeding/gmwmi.o')
('delete file:', 'release/src/gui/mrview/tool/connectome/file_data_vector.o')
('delete file:', 'release/src/gui/mrview/tool/tractography/tractogram_moc.cpp')
('delete file:', 'release/src/gui/opengl/gl_core_3_3.o')
('delete file:', 'release/src/gui/opengl/shader.o')
surg1713925:mrtrix3 staff$ ls
Doxyfile		build.log		docs			lib			package_mrtrix		set_path
LICENCE.txt		cmd			doxygen			matlab			release			src
README.md		configure		icons			mrtrix-mime.xml		run_tests		testing
build			configure.log		install_mime_types.sh	mrtrix-mrview.desktop	scripts			update_dev_doc
surg1713925:mrtrix3 staff$ git pull
Already up-to-date.
surg1713925:mrtrix3 staff$ sudo ./configure

MRtrix build type requested: release

Detecting OS: darwin
OS X deployment target: 10.11
Checking for C++11 compliant compiler [clang++]: 4.2.1 - tested ok
Detecting pointer size: 64 bit
Detecting byte order: little-endian
Checking for variable-length array support: yes
Checking for non-POD variable-length array support: no
Checking for zlib compression library: 1.2.5
Checking for Eigen 3 library: 3.2.9
Checking shared library generation: yes
Checking for Qt moc: moc (version 4.8.7)
Checking for Qt qmake: qmake (version 4.8.7)
Checking for Qt rcc: rcc (version 4.8.7)
Checking for Qt: 4.8.7
writing configuration to file './release/config': ok

surg1713925:mrtrix3 staff$ sudo ./build
(  1/443) [CC] release/cmd/labelconvert.o
(  2/443) [CC] release/cmd/tckgen.o
(  3/443) [CC] release/cmd/dirmerge.o
(  4/443) [CC] release/lib/formats/pipe.o
(  5/443) [CC] release/src/dwi/tractography/mapping/gaussian/mapper.o
(  6/443) [CC] release/src/dwi/tractography/seeding/gmwmi.o
(  8/443) [CC] release/cmd/tsfdivide.o
(  7/443) [CC] release/src/gui/opengl/shader.o
(  9/443) [CC] release/cmd/mesh2pve.o
( 10/443) [CC] release/cmd/meshfilter.o
( 11/443) [CC] release/src/gui/opengl/gl_core_3_3.o
( 12/443) [CC] release/src/gui/mrview/tool/connectome/file_data_vector.o
( 13/443) [MOC] release/src/gui/mrview/tool/tractography/tractogram_moc.cpp
( 14/443) [CC] release/src/dwi/directions/mask.o
( 15/443) [CC] release/cmd/tcknormalise.o
( 16/443) [CC] release/lib/adapter/reslice.o
( 17/443) [CC] release/src/gui/mrview/tool/connectome/selection.o
( 18/443) [CC] release/src/dwi/tractography/GT/externalenergy.o
ERROR: ( 17/443) [CC] release/src/gui/mrview/tool/connectome/selection.o

clang++ -c -std=c++11 -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.11 -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA -isystem /usr/local/Cellar/eigen/3.2.9/include/eigen3 -Wall -O2 -DNDEBUG -Isrc -Icmd -I./lib -Icmd -isystem /usr/local/Cellar/eigen/3.2.9/include/eigen3 cmd/tckgen.cpp -o release/cmd/tckgen.o:

In file included from cmd/tckgen.cpp:24:
In file included from src/dwi/tractography/tracking/exec.h:33:
src/dwi/tractography/seeding/dynamic.h:82:23: warning: braces around scalar initializer [-Wbraced-scalar-init]
            updating (ATOMIC_FLAG_INIT),
                      ^~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic:1779:26: note: expanded from macro 'ATOMIC_FLAG_INIT'
#define ATOMIC_FLAG_INIT {false}
                         ^~~~~~~
In file included from cmd/tckgen.cpp:24:
In file included from src/dwi/tractography/tracking/exec.h:33:
src/dwi/tractography/seeding/dynamic.h:93:23: warning: braces around scalar initializer [-Wbraced-scalar-init]
            updating (ATOMIC_FLAG_INIT),
                      ^~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic:1779:26: note: expanded from macro 'ATOMIC_FLAG_INIT'
#define ATOMIC_FLAG_INIT {false}
                         ^~~~~~~
In file included from cmd/tckgen.cpp:24:
In file included from src/dwi/tractography/tracking/exec.h:33:
src/dwi/tractography/seeding/dynamic.h:104:23: warning: braces around scalar initializer [-Wbraced-scalar-init]
            updating (ATOMIC_FLAG_INIT),
                      ^~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic:1779:26: note: expanded from macro 'ATOMIC_FLAG_INIT'
#define ATOMIC_FLAG_INIT {false}
                         ^~~~~~~
3 warnings generated.



ERROR: ( 17/443) [CC] release/src/gui/mrview/tool/connectome/selection.o

clang++ -c -std=c++11 -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.11 -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA -isystem /usr/local/Cellar/eigen/3.2.9/include/eigen3 -Wall -O2 -DNDEBUG -Isrc -Icmd -I./lib -Icmd -isystem /usr/local/Cellar/eigen/3.2.9/include/eigen3 -pipe -stdlib=libc++ -mmacosx-version-min=10.7 -O2 -arch x86_64 -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -isystem /usr/local/Cellar/qt/4.8.7_2/mkspecs/unsupported/macx-clang-libc++ -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtCore.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtCore.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtGui.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtGui.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtOpenGL.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtOpenGL.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtSvg.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtSvg.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/include -isystem /System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -isystem /System/Library/Frameworks/AGL.framework/Headers -F/usr/local/Cellar/qt/4.8.7_2/lib src/gui/mrview/tool/connectome/selection.cpp -o release/src/gui/mrview/tool/connectome/selection.o

failed with output

In file included from src/gui/mrview/tool/connectome/selection.cpp:18:
In file included from src/gui/mrview/tool/base.h:21:
In file included from src/gui/mrview/window.h:18:
In file included from ./lib/image.h:29:
In file included from ./lib/algo/threaded_copy.h:19:
In file included from ./lib/algo/threaded_loop.h:22:
./lib/thread.h:135:16: error: 'future<void>' is unavailable: introduced in macOS 10.8
          std::future<void> thread;
               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/future:1279:52: note: 'future<void>' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE future<void>
                                                   ^
In file included from src/gui/mrview/tool/connectome/selection.cpp:18:
In file included from src/gui/mrview/tool/base.h:21:
In file included from src/gui/mrview/window.h:18:
In file included from ./lib/image.h:29:
In file included from ./lib/algo/threaded_copy.h:19:
In file included from ./lib/algo/threaded_loop.h:22:
./lib/thread.h:186:30: error: 'future<void>' is unavailable: introduced in macOS 10.8
            std::vector<std::future<void>> threads;
                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/future:1279:52: note: 'future<void>' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE future<void>
                                                   ^
2 errors generated.
/tmp/tmpbzx8SV (END) 

I think the problem here is that you’re using too old a version of Qt. As mentioned on the MacOSX installation page, you need at least version 5.1 - preferably the latest available. I think this is what’s throwing off the build script, since for some reason your version of Qt instructs the compiler to target a much older version of MacOSX (-mmacosx-version-min=10.7), when the C++ feature we rely on (std::future) is only available from MacOSX 10.8. There’s a good chance a recent version of Qt would not target such an old version of MacOSX.

If you thought you had indstalled Qt5, then refer to this post for instructions on making sure MRtrix3 builds against it rather than Qt4.

Thanks a lot J-Donald. The problem was the QT version. I re-installed the whole package plus QT, as well as setting the paths accordingly and the problem is resolved, Thanks to you all wonderful team. Please keep it up, folks.

Sincerely,
Saman