Running mrtrix from matlab on windows

Dear All,

I installed mrtrix3 on windows 10 enterprise via mingw64 as per instructions. I can run mrtrix3 from the mingw64 shell/command line just fine (not from the system/win command prompt). I wanted to run mrtrix3 commands from matlab via system command, but I do not seem to be able to.
In matlab, I tried smth like

cmd = 'C:\msys64\mingw64.exe; cd C:/msys64/home/user/mrtrix3/bin; command1 ; command2 etc ';
[a b]=system (cmd); 

but it does not work.
I would like to open an interactive shell with output/progress visible in the command window, or otherwise showing in matlab.
Please advise; my $path in mingw64 is

$ echo $PATH
/home/user/mrtrix3/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

Unrelated, the main reason to run mrtrix on my windows box is slow tcksift run on my linux box. From previous threads, there is no config file generated on Win installations due to compilation from source. If one wants to view the default -nthreads setting with the tcksift command in order to keep it or up it, how to go about it? More generally, how to view/change config options in windows mrtrix?

Thank you,

Octavian

Octavian

I only had a quick go at this; the MRtrix3 commands immediately crash out with an error code of 255 (is this what you mean by “it does not work”? We always benefit from more details about these sorts of things). Given the compatibility layers involved in MSYS2, highlighted by the fact that you can’t run these commands in a “standard” Windows command prompt, I’d suggest trying to execute these commands in Matlab is probably asking too much. Anyone is welcome to try if they want to though…

From previous threads, there is no config file generated on Win installations due to compilation from source.

Currently all installations are compilation from source, and the config file is not automatically generated on any platform; you have to create one yourself. There’s two config file locations (one system-wide and one user-specific); from memory one of the two doesn’t work on Windows… but if you run a command with the -debug option, it should tell you exactly where it’s looking, and you can try creating a file there.

If one wants to view the default -nthreads setting with the tcksift command in order to keep it or up it, how to go about it?

There isn’t a “default setting” for the number of threads: in the absence of any manual setting, it queries your hardware to set the number of threads, and should therefore use no less than what your system is capable of. If you don’t want to set up a config file, you can instead set the “MRTRIX_NTHREADS” environment variable.

Rob

Thank you, this is very helpful
Octavian