Brainstorm does not "see" Brainsuite

Dear all,

I am experiencing an issue while trying to conduct DTI within Brainstorm using Brainsuite (on OSX). I have installed Brainsuite, and when I try to perform "Convert DWI to DTI", and that I provide my .nii, .bvec and .bval, I have an error message from Brainstorm that Brainsuite is not installed, and to fill the access path within the preferences, which I did.

I have tried to install Brainsuite elsewhere, and to change it accordingly in the Preferences panel in Brainstorm, nothing helps... One of my colleagues just tried on Windows and it worked, so I suspect this is OS-related...

Thanks in advance for your feedback, and thanks from this fantastic tool that is Brainstorm !

All the best,

Julien

Hello @Julio

Did you try to start Brainsuite software on your computer?
is it working?

@Anand_Joshi

I have tested this on Linux and Windows, but not MacOS, maybe this reacts in a different way than Linux... This might require some debugging.

The process starts by adding the BrainSuite directories to the system path, and then Brainstorm relies on having the executables bdp, bfc and bse available on the system path.

Can you try adding the BrainSuite folders (subfolders bin and bdp) manually to the system path?

getenv('PATH')
setenv('PATH', [getenv('PATH'), ':', BsBinDir, ':', BsBdpDir])
getenv('PATH')

Another solution to test would be to open a terminal, add the BrainSuite folders (subfolders bin and bdp) to the system path - Google for help with this, and then start Matlab/Brainstorm.

1 Like

@Julio What is the path that you entered?

@tmedani : yes, it works :wink:
@Francois : many thanks for your suggestions, will try asap what you suggested and let you know !
@ajoshi : the path is basically: /Users/julien/Applications/Brainsuite

1 Like

@Julio
If you type
/Users/julien/Applications/Brainsuite/bin/BrainSuite

at the command line, does BrainSuite open? The path looks odd to me. It should be BrainSuite instead of Brainsuite, I think capitalization matters in Mac.

Sorry to bother you. I have a question about the eig-dti.In brainstorm,The normal operation is importing dwi.nii.gz, *.bvec (orientation of the gradient) and *.bval (value of the gradient) to got eig-DTI.
We obtained DTI (diffusion tensor imaging) directly during the MRI scan, which also contains three files (dti.nii.gz, *.bvec and *.bval). We want to use the same steps to import directly in brainstorm the file gets eig-DTI. We did use the same operation, and we did get such data(eig-DTI). Our current problem is that we found that brainsuite also uses (dwi.nii.gz, *.bvec and *.bval)to calculate dti tensor(which may be the eig-DTI in brainstorm). We don’t know whether our approach that import (dti.nii.gz, *.bvec and *.bval) to use (convert dwi to dti) to got eig-dti in brainstorm is correct.Do I have to use dwi data to calculate eig-dti in brainstorm? Is the eig-dti obtained by directly importing dti data correct? We don't know whether brainsuite can directly import (dti.nii.gz, *.bvec and *.bval) to get eig-dti.

@ajoshi @tmedani ?

1 Like

Hi @caofuzhi

I believe that you mean DWI instead of DTI, there is maybe confusion in the terminology between DWI and DTI.

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2967146/

The DTI is computed from the raw data DWI and can't be obtained directly from the MRI,
therefore I believe that you have the DWI, and it's what you need to use in Brainstorm.

I think you have already tested it and you got the expected results (from your emails).

Hi, I am having a similar issue running on Windows 10. I have set the path to brainsuite (21a), check the brainsuite installation with the matlab runtime 2019b and it all works. However when I try to run "Convert DWI to DTI" it gives this error

'bdp' is not recognized as an internal or external command, 
operable program or batch file. 
BST> Adding to system path: C:\BrainSuite21a\bin
BST> Adding to system path: C:\BrainSuite21a\bdp
Unrecognized function or variable 'matlabrc'. 
 
Unrecognized function or variable 'ctfroot'. 
 
Error in runtimeInitializationChecks (line 23) 
 
MATLAB:UndefinedFunction 

***************************************************************************
** Error: Cannot convert files: 
** F:\Giacomo\GR2016_20230119\3_MRI\004_GB_HT0\dw.nii
** F:\Giacomo\GR2016_20230119\3_MRI\004_GB_HT0\004_GB_HT0_ep2d_diff_MDDW_64DIR_1.8mm_20190704100223_10.bval
** F:\Giacomo\GR2016_20230119\3_MRI\004_GB_HT0\004_GB_HT0_ep2d_diff_MDDW_64DIR_1.8mm_20190704100223_10.bvec
** BrainSuite is not installed on your computer.
** Download it from http://brainsuite.org and install it.
** Then set its installation folder in the Brainstorm options (File > Edit preferences)
***************************************************************************

I have also tried to define the path to brainsuite bin and bdp as system path (and if I open a command prompt and write "BrainSuite21a.exe" it runs) but it still does not work through brainstorm.
Sorry in advance if I am missing something obvious

Thanks in advance!

Giacomo

@Anand_Joshi ?

BrainSuite requires installation of Matlab Runtime 2019b
Please install Matlab Runtime 2019b (exact version)
https://www.mathworks.com/products/compiler/matlab-runtime.html
You mention you have it. Do you see BDP (bdp.exe) in the BrainSuite installation folder? If yes,
try running BDP from the command line. It seems that BDP does not recognize the MCR. If you simply try to run BDP from the command line do you get the same error?Do you have the same version of BDP.

Thanks for the prompt replies.

I do see bdp.exe in the BrainSuite folder and I can run it from the command line, giving the same error:

C:\Users\ALIEN_ANALYSIS_ONE>bdp.exe
Unrecognized function or variable 'matlabrc'.

Unrecognized function or variable 'ctfroot'.

Error in runtimeInitializationChecks (line 23)

MATLAB:UndefinedFunction

I have downloaded and reinstalled Matlab Runtime 2019b from your link (before I had the one downloaded during the installation of BrainSuite) but the error remains the same.

BDP version:

<?xml version="1.0" encoding="UTF-8"?>
<bdpmanifest>
	<version>21a</version>
	<build>0081</build>
	<date>2021-05-05</date>
	<mcrversion>9.7</mcrversion>
	<platform>win64</platform>
</bdpmanifest>

MATLAB Runtime 2019b version

<?xml version="1.0" encoding="UTF-8"?>
<!-- Version information for MathWorks R2019b Release -->
<MathWorks_version_info>
  <version>9.7.0.1737446</version>
  <release>R2019b</release>
  <description>Update 9</description>
  <date>Aug 05 2021</date>
  <checksum>755363187</checksum>
</MathWorks_version_info>

** Just adding that if I try to move MATLAB 2019b runtime in another path (default path is: C:\Program Files\MATLAB\MATLAB Runtime\v97 ) the error becomes:

C:\Users\ALIEN_ANALYSIS_ONE>bdp.exe
Error: Could not find version 9.7 of the MATLAB Runtime.
Attempting to load mclmcrrt9_7.dll.
Please install the correct version of the MATLAB Runtime.
Contact your vendor if you do not have an installer for the MATLAB Runtime.

So I guess it bdp.exe does see MATLAB Runtime 2019b. Hope this piece of information could be useful. Thanks again for the support

hey @GiacomoBertazzoli

Here is the answer given by @cliogz

haven't seen that error. However, look at this web page
https://www.mathworks.com/matlabcentral/answers/98050-why-do-i-get-an-error-saying-un[…]ed-function-or-variable-matlabrc-when-executing-a-program-th

specifically the answer by "Image analyst" about Windows erasing some files....maybe that might be worth to have a look

something similar is mentioned on this other page:

Undefined function or variable 'matlabrc' - #2 by gatoniel - Usage & Issues - Image.sc Forum

can you refer this person to look into these suggestions? I don't have a Windows machine to test installation or troubleshoot

Could you check these items?

thanks

Thanks @tmedani , indeed this worked https://forum.image.sc/t/undefined-function-or-variable-matlabrc/76260/2
I deleted the folder C:\Users\[username]\AppData\Local\Temp\[username]\mcrCache[version] and it was correctly recreated by MATLAB.
Thanks for the support!

1 Like

Super!
Thanks for sharing your feedback. It will help future users as well.