Setting a PATH in MRtrix

Hi!

I’m new to this software and using command-line tools and I’m trying to conduct fibre density and cross section analysis. When I was trying to set the path using the command ./set_path, it’s giving me an error that says no such file or directory. Any advice on fixing this?

Thanks!

Hi there!

It’s difficult to know without more information, but it may be that you’re running ./set_path from outside the mrtrix directory? You’ll need to run it from within the MRtrix toplevel directory, so the same one you ran ./configure and ./build from (if you built from source).

cd /path/to/mrtrix3
./set_path

If that’s not the problem then I’m sure someone more knowledgable about installation etc. will be able to help out! It might be useful to provide more info e.g. what operating system you’re using and how you installed MRtrix3.

Fiona

Hey!

I think that’s the error that’s happening but I just wasn’t sure how to fix it. I tried to use this set path but that didn’t work either. I’m attaching the error message that’s showing up below, if you’d like to take a look!

image

I’m also using a Windows PC with FSL running on virtual machine.

Thanks so much for your help,
Haki

Alternatively, you can download MRtrix from Anaconda (conda install -c mrtrix3 mrtrix3) or as a Docker container (mrtrix3/mrtrix3:latest). You won’t have to worry about any compilation issues with these methods.

@karrah this looks like an issue with your input to for_each. I’d suggest making sure the command works for one subject without for_each and then work out the for_each syntax (for_each — MRtrix 3.0 documentation). Adding -info and -debug flags after for_each might be helpful.

For instance I am using echo to print the file names:

for_each -info *.mif : echo IN
for_each: [  0%] 0/2 jobs completed sequentially...
Command:  echo T2.mif
Command:  echo wm.mif
for_each: [100%] 2/2 jobs completed sequentially
for_each:
for_each: Output of command for input "T2.mif":
          T2.mif
for_each:
for_each: Output of command for input "wm.mif":
          wm.mif
for_each:
for_each: Script reported successful completion for all inputs

In the example below, I am using the wrong path: bogus/IN instead of IN as the input to mrinfo. You can see it’s trying to call mrinfo bogus/T2.mif instead of mrinfo T2.mif which results in error messages similar to yours:

for_each -debug *.mif : mrinfo bogus/IN
for_each: [DEBUG] execute() (from app.py:197): All inputs: ['T2.mif', 'wm.mif']
for_each: [DEBUG] execute() (from app.py:197): Command: mrinfo bogus/IN
for_each: [DEBUG] execute() (from app.py:197): CMDSPLIT: ['mrinfo', 'bogus/IN']
for_each: [DEBUG] execute() (from app.py:197): No common prefix
for_each: [DEBUG] execute() (from app.py:197): Common suffix: .mif
for_each: [DEBUG] __init__() (from for_each:189): Input text: T2.mif
for_each: [DEBUG] __init__() (from for_each:189): Substitutions: {'IN': 'T2.mif', 'NAME': 'T2.mif', 'PRE': 'T2', 'UNI': 'T2'}
for_each: [DEBUG] __init__() (from for_each:189): Resulting command: ['mrinfo', 'bogus/T2.mif']
for_each: [DEBUG] __init__() (from for_each:189): Input text: wm.mif
for_each: [DEBUG] __init__() (from for_each:189): Substitutions: {'IN': 'wm.mif', 'NAME': 'wm.mif', 'PRE': 'wm', 'UNI': 'wm'}
for_each: [DEBUG] __init__() (from for_each:189): Resulting command: ['mrinfo', 'bogus/wm.mif']
for_each: [  0%] 0/2 jobs completed sequentially...
Command:  mrinfo bogus/T2.mif
          mrinfo: [ERROR] failed to open key/value file "bogus/T2.mif": No such file or directory
          mrinfo: [ERROR] error opening image "bogus/T2.mif"
Command:  mrinfo bogus/wm.mif
          mrinfo: [ERROR] failed to open key/value file "bogus/wm.mif": No such file or directory
          mrinfo: [ERROR] error opening image "bogus/wm.mif"
for_each: [100%] 2/2 jobs completed sequentially (2 errors)
for_each: [WARNING] 2 of 2 jobs did not complete successfully
for_each: [WARNING] Outputs from failed commands:
for_each:
for_each: [WARNING] For input "T2.mif" (returncode = 1):
          mrinfo: [ERROR] failed to open key/value file "bogus/T2.mif": No such file or directory
          mrinfo: [ERROR] error opening image "bogus/T2.mif"
for_each:
for_each: [WARNING] For input "wm.mif" (returncode = 1):
          mrinfo: [ERROR] failed to open key/value file "bogus/wm.mif": No such file or directory
          mrinfo: [ERROR] error opening image "bogus/wm.mif"
for_each:

for_each: [ERROR] 2 of 2 jobs did not complete successfully

Hi,

I apologize for my late response but this was really helpful and I was able to get it to work! Thank you so much!