I tried to run recon_gui on MATLAB, Windows 32 bit. After setting up the path and loading recon1.prm, I run recon_gui, but get the following msg. It reminders me of a problem at toastReadMesh function. I open the functional file and found there is nothing except for comments. So I post it here to look for help.
Thanks.
Xin
Warning: parameter file not in current working directory.
Changing directory to D:\05 - do\NIRS_recon\TOAST\toast_pp\test\2D\matlab\
Hi Xin,
This could indicate that Matlab doesn't find the path to the mex files.
Did you compile toast yourself, or did you install the precompiled package? Note that Currently only a win64 compiled package is available, so for win32 you have to do the compilation yourself.
Once you have compiled the code, make sure that the mex directory exists. It should be in win/Win32/Release/mex under your toast installation directory.
Then run the mtoast_install.m script found in your toast root directory. This will add the required search paths. Make sure that the mex directory is listed, before any of the script paths.
When you type "which toastReadMesh" it should pick up the mex file, not the m file.
Let me know if you still have difficulties.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I have the same problem in the TOAST
How to change the path of the mex to be the first path
also it cannot read the meshes from the folder it gives me error and matlab closes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can change the paths manually with the Matlab path tool (pathtool). This allows to add, delete and move paths.
However, the mtoast_install.m and mtoast2_install.m scripts should automatically move the mex path to the beginning of the list. If this is not the case, then it indicates that something went wrong during compilation. This would also be the reason why you can't read meshes.
Are you compiling for Linux or Windows? Did you get any error messages during the compilation?
If you are compiling for Linux, you should have a "mex" and/or a "mex2" directory under your $TOASTVER installation directory. If you are compiling for Windows, you should have "mex" and/or "mex2" under win/x64/Release. Do you have those directories, and do they contain mex files?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried to run the same program (recon_gui) and even I had copy the lines from Demo 1 into a .m file to run line-by-line, but I just get this message
\toast\win\x64\Release\mex2\toast.mexw64':
The specified procedure could not be found.
Error in toastMesh (line 75)
obj.handle =
toast(uint32(1),arg1,arg2,arg3);
Error in ToastTest (line 8)
mesh = toastMesh (vtx,idx,eltp);
The file is there and the path is set to that address, the features of Matlab are:
MATLAB Version: 8.1.0.604 (R2013a) 64bit
Microsoft Windows 7 Version 6.1
Java 1.6.0_17-b04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If the mex file is present, and the path is set correctly, then this error could mean that one of the dynamic link dependencies for toast.mexw64 is missing, for example one of the Windows runtime libraries. From the error message it isn't possible to determine if that is the case though, so I will need more information.
What you could do: download the dependency walker tool from http://www.dependencywalker.com/ and run it on toast.mexw64. This utility displays the dynamic libraries that toast.mexw64 depends on and warns if any of the dependencies are not found. If you can post the results here (in particular any missing dependencies it flags up), I may be able to pinpoint the problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I checked the dependency of toast.mexw64 as you recommended and these were not found:
+LIBTOAST.DLL
?LIBMX.DLL
?LIBMEX.DLL
+MSVCR90.DLL
?MSVCR90.DLL
before of doing this, I tried to run TOAST in other computer and it worked fine, so i checked the dependency and again LIBMX.DLL and LIBMEX.DLL were still missing, but MSVCR90.DLL was addressed to c:\program files(x86)\intel\icls client\ so I copied this .dll from this computer into c:\windows\system32 in the other computer and now TOAST is working fine.
I don't know if the other two could give a problem in the future, but searching on internet I found that are related to Matlab.
Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The missing dependencies for libmx.dll and libmex.dll are not a problem. They are Matlab's own runtime libraries and are always reported as missing, but Matlab knows how to find them and always loads them correctly.
So the only problem here was the missing msvcr90.dll, which you addressed. msvcr90.dll is a visual studio runtime library, which is present on most systems already. If it is missing on your system, you can download it from the Microsoft website (google for VS2008 runtime libraries).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I've download toast++ 1.0.3 1.0.2 1.0.1 and tried to run TOAST Demo 6: 3-D image reconstruction,I found only Nonlinear CG with no regularization could run, other method and regularization combinations result in errors like this:
Error using toastRegul (line 95)
toastRegul: Required field not found: basis
Error in toastSolver/SetRegul (line 42)
this.lprm.hReg = toastRegul (prm,
x0);
Error in toastSolver/Solve (line 53)
obj.SetRegul(obj.prm.regul,x0);
Error in toastSolverCG/Solve (line 32)
Solve@toastSolver(this,x0);
Error in toastRecon (line 179)
solver.Solve (x);
Error in toast_demo6>pushbutton1_Callback (line
163)
toastRecon(prm);
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in toast_demo6 (line 42)
gui_mainfcn(gui_State, varargin{:});
Error while evaluating uicontrol Callback
Would you show me how to fix this?
Another question is how to add other regularization methods in toast. Or is it possible?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are right, the control parameter setup in toastSolver is currently broken for defining regularisation objects. Thanks for bringing this to my attention. This was caused by a recent transistion of the control parameter structure to a Matlab class. I'll look into this and will post an update as soon as available.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have now updated the Matlab scripts to support regularisation in the 3D reconstruction demo [r.558]. Simply update your sources from the SVN repository. If you are not using the source distribution, you can also update the affected scipts manually, from the sourceforge SVN source browser. You need to replace the following files:
Thanks for reply.I downloaded and replaced the 4 files.It seems the Gauss-Newton method with any regularization now works,but the NCG method with no regularization failed.The matlab window just shut down after a few minutes.No warning or errors displayed.
And I don't know if it is my illusion,the time for calculating Jacobian becomes longer??
Thanks again for developing such a useful code pack,and I wish the functions of toast become more and more perfect.
By the way,is there any plan for incorporating other regularization methods and algorithms?
Last edit: vimmiv 2014-11-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'll look into the problem when no regularisation is selected.
You can implement new regularisation methods, but this has to be done from the C++ sources, rather than in Matlab. Look at src/libstoast/regul.h and regul.cc. This contains all the currently implemented regularisation schemes. To implement a new scheme, you need to derive a new class from the "Regularisation" base class, and implement at least all of the pure virtual methods.
To expose the new regularisation class to Matlab, you'll then have to modify the src/matlab2/mtRegul.cc file. This contains the mex interface to the regularisation classes. The regularisation instance is created here, so you need to make sure you get all required parameters from the user (adding new ones if required) and return a handle to the created regularisation instance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I tried to run the same program (recon_gui) on MATLAB, Windows 64 bit. but I just get this message
Undefined function or variable'toastParam'。
Error recon_gui>recon_gui_OpeningFcn (line 62)
prm = toastParam;
Error gui_mainfcn (line 220)
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
Error recon_gui (line 42)
gui_mainfcn(gui_State, varargin{:});
Last edit: chenzhilei 2015-01-05
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I also tried to run mtoast2_install.m scripts ,This add the required directories \toast\win\x64\Release\mex2 to my Matlab path.After I run recon_gui,and loading recon1.prm.but when run to caculating gradient,I get this message
MATLAB has encountered an internal problem and needs to close
There appears to be a problem with the SuperLU solver in the current multithreaded Toast version: SuperLU turns out not to be threadsafe. Currently, when selecting the "DIRECT" solver, e.g. for computing gradients, Toast invokes SuperLU. Until I find a more permanent solution, your options are
recompile toast without multithreading support (configure without --enable-threads), or
don't use the direct solver. For the recon_gui example you can do this by opening the parameter file (recon1.prm) and replacing the line
LINSOLVER = DIRECT
with
LINSOLVER = BICGSTAB
LINSOLVER_TOL = 1e-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have the same problem while running recon_gui. I am using the binary package and find that the line: LINSOLVER=DIRECT in recon1.prm has already replaced by
LINSOLVER = BICGSTAB
LINSOLVER_TOL = 1e-12
However, the problem is still the same.
I have more problems compiling from the source. Is it possible to solve this problem using the binary package?
Thank you so much!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I faced this issue too initially. Make sure that in your MATLAB window, you've navigated to the folder containing mtoast_install.m before you run it. That fixed the issue for me. Hope it helps!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
Currently I am trying to run the recon_gui and the examples demo of toast ++ but I am unable to do.
I used the precompiled toast++ folder for common and window mex folders for MATLAB 64 bit system. I get the following error after loading and running the demo6.prm.
??? Error using ==> reshape
Size vector must be a row vector with integer elements.
Error in ==> recon_gui>disp_iter at 241
bmua = reshape(res.bmua,bdim');
Error in ==> toastSolver>toastSolver.solve_iter at 395
feval(prm.transient.callback.iter, prm, RES);
Error in ==> toastSolver>@(varargin)this.solve_iter(varargin{:}) at 338
localprm.callback.iter = @this.solve_iter;
Error in ==> toastSolver>toastSolver.echo_iteration_state at 174
feval(obj.lprm.callback.iter, obj.lprm.callback.context, itr, x,
err);
Error in ==> toastSolverCG>toastSolverCG.Solve at 52
this.echo_iteration_state (0, x, err);
Error in ==> toastRecon at 179
solver.Solve (x);
Error in ==> recon_gui>runrecon_Callback at 219
toastRecon(prm);
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> recon_gui at 42
gui_mainfcn(gui_State, varargin{:});
??? Error while evaluating uicontrol Callback
The following are the folder which are added to my matlab search path, mex, mex2, demos,matlab,gui, html,toast2, utilities.........
Regards,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'll check this out. It could be a compatibility problem since you have both the old and new matlab interfaces active (mex and mex2). Can you run any of the demos if you remove the 'mex' entry from your matlab search path, but keep the 'mex2'?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for your reply.. I checked it by removing the mex search path but again getting the same error.. However, the 2-D demos with GUI are working except the 3-D demo6.. Thank you again for your time and response..
Regards,
Last edit: sohail 2015-11-02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
I've downloaded the common package and the Windows binary package 1.0.4, unzipped them and added the toolbox to my Matlab 2014a environment. When I run toast_demo2.m, I got this message, and I have to restart Matlab.
If I check the details, I found the following message:
This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.
I tried to run recon_gui on MATLAB, Windows 32 bit. After setting up the path and loading recon1.prm, I run recon_gui, but get the following msg. It reminders me of a problem at toastReadMesh function. I open the functional file and found there is nothing except for comments. So I post it here to look for help.
Thanks.
Xin
Warning: parameter file not in current working directory.
Changing directory to D:\05 - do\NIRS_recon\TOAST\toast_pp\test\2D\matlab\
Starting reconstruction
??? Error using ==> toastReadMesh
Too many input arguments.
Error in ==> toastRecon at 41
LPRM.hMesh = toastReadMesh (prm.fwdsolver.meshfile);
Error in ==> recon_gui>runrecon_Callback at 218
toastRecon(prm);
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> recon_gui at 42
gui_mainfcn(gui_State, varargin{:});
??? Error while evaluating uicontrol Callback
Hi Xin,
This could indicate that Matlab doesn't find the path to the mex files.
Did you compile toast yourself, or did you install the precompiled package? Note that Currently only a win64 compiled package is available, so for win32 you have to do the compilation yourself.
Once you have compiled the code, make sure that the mex directory exists. It should be in win/Win32/Release/mex under your toast installation directory.
Then run the mtoast_install.m script found in your toast root directory. This will add the required search paths. Make sure that the mex directory is listed, before any of the script paths.
When you type "which toastReadMesh" it should pick up the mex file, not the m file.
Let me know if you still have difficulties.
Hi
I tried to run the same program (recon_gui) on MATLAB, Windows 32 bit. but I just get this message
Undefined function or variable'toastParam'。
Error recon_gui>recon_gui_OpeningFcn (line 62)
prm = toastParam;
Error gui_mainfcn (line 220)
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
Error recon_gui (line 42)
gui_mainfcn(gui_State, varargin{:});
Hi
I have the same problem in the TOAST
How to change the path of the mex to be the first path
also it cannot read the meshes from the folder it gives me error and matlab closes.
You can change the paths manually with the Matlab path tool (pathtool). This allows to add, delete and move paths.
However, the mtoast_install.m and mtoast2_install.m scripts should automatically move the mex path to the beginning of the list. If this is not the case, then it indicates that something went wrong during compilation. This would also be the reason why you can't read meshes.
Are you compiling for Linux or Windows? Did you get any error messages during the compilation?
If you are compiling for Linux, you should have a "mex" and/or a "mex2" directory under your $TOASTVER installation directory. If you are compiling for Windows, you should have "mex" and/or "mex2" under win/x64/Release. Do you have those directories, and do they contain mex files?
I tried to run the same program (recon_gui) and even I had copy the lines from Demo 1 into a .m file to run line-by-line, but I just get this message
\toast\win\x64\Release\mex2\toast.mexw64':
The specified procedure could not be found.
Error in toastMesh (line 75)
obj.handle =
toast(uint32(1),arg1,arg2,arg3);
Error in ToastTest (line 8)
mesh = toastMesh (vtx,idx,eltp);
The file is there and the path is set to that address, the features of Matlab are:
MATLAB Version: 8.1.0.604 (R2013a) 64bit
Microsoft Windows 7 Version 6.1
Java 1.6.0_17-b04
If the mex file is present, and the path is set correctly, then this error could mean that one of the dynamic link dependencies for toast.mexw64 is missing, for example one of the Windows runtime libraries. From the error message it isn't possible to determine if that is the case though, so I will need more information.
What you could do: download the dependency walker tool from http://www.dependencywalker.com/ and run it on toast.mexw64. This utility displays the dynamic libraries that toast.mexw64 depends on and warns if any of the dependencies are not found. If you can post the results here (in particular any missing dependencies it flags up), I may be able to pinpoint the problem.
Hi,
I checked the dependency of toast.mexw64 as you recommended and these were not found:
+LIBTOAST.DLL
?LIBMX.DLL
?LIBMEX.DLL
+MSVCR90.DLL
?MSVCR90.DLL
before of doing this, I tried to run TOAST in other computer and it worked fine, so i checked the dependency and again LIBMX.DLL and LIBMEX.DLL were still missing, but MSVCR90.DLL was addressed to c:\program files(x86)\intel\icls client\ so I copied this .dll from this computer into c:\windows\system32 in the other computer and now TOAST is working fine.
I don't know if the other two could give a problem in the future, but searching on internet I found that are related to Matlab.
Regards
The missing dependencies for libmx.dll and libmex.dll are not a problem. They are Matlab's own runtime libraries and are always reported as missing, but Matlab knows how to find them and always loads them correctly.
So the only problem here was the missing msvcr90.dll, which you addressed. msvcr90.dll is a visual studio runtime library, which is present on most systems already. If it is missing on your system, you can download it from the Microsoft website (google for VS2008 runtime libraries).
Hello,
I've download toast++ 1.0.3 1.0.2 1.0.1 and tried to run TOAST Demo 6: 3-D image reconstruction,I found only Nonlinear CG with no regularization could run, other method and regularization combinations result in errors like this:
Error using toastRegul (line 95)
toastRegul: Required field not found: basis
Error in toastSolver/SetRegul (line 42)
this.lprm.hReg = toastRegul (prm,
x0);
Error in toastSolver/Solve (line 53)
obj.SetRegul(obj.prm.regul,x0);
Error in toastSolverCG/Solve (line 32)
Solve@toastSolver(this,x0);
Error in toastRecon (line 179)
solver.Solve (x);
Error in toast_demo6>pushbutton1_Callback (line
163)
toastRecon(prm);
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in toast_demo6 (line 42)
gui_mainfcn(gui_State, varargin{:});
Error while evaluating uicontrol Callback
Would you show me how to fix this?
Another question is how to add other regularization methods in toast. Or is it possible?
You are right, the control parameter setup in toastSolver is currently broken for defining regularisation objects. Thanks for bringing this to my attention. This was caused by a recent transistion of the control parameter structure to a Matlab class. I'll look into this and will post an update as soon as available.
I have now updated the Matlab scripts to support regularisation in the 3D reconstruction demo [r.558]. Simply update your sources from the SVN repository. If you are not using the source distribution, you can also update the affected scipts manually, from the sourceforge SVN source browser. You need to replace the following files:
script/matlab/demos/toast_demo6.fig
script/matlab/demos/toast_demo6.m
script/matlab/toast2/toastRecon.m
script/matlab/toast2/toastSolver.m
The changes will also be propagated into the next release update, but this may take a while.
Let me know if you have any further problems with the demo.
Thanks for reply.I downloaded and replaced the 4 files.It seems the Gauss-Newton method with any regularization now works,but the NCG method with no regularization failed.The matlab window just shut down after a few minutes.No warning or errors displayed.
And I don't know if it is my illusion,the time for calculating Jacobian becomes longer??
Thanks again for developing such a useful code pack,and I wish the functions of toast become more and more perfect.
By the way,is there any plan for incorporating other regularization methods and algorithms?
Last edit: vimmiv 2014-11-03
I'll look into the problem when no regularisation is selected.
You can implement new regularisation methods, but this has to be done from the C++ sources, rather than in Matlab. Look at src/libstoast/regul.h and regul.cc. This contains all the currently implemented regularisation schemes. To implement a new scheme, you need to derive a new class from the "Regularisation" base class, and implement at least all of the pure virtual methods.
To expose the new regularisation class to Matlab, you'll then have to modify the src/matlab2/mtRegul.cc file. This contains the mex interface to the regularisation classes. The regularisation instance is created here, so you need to make sure you get all required parameters from the user (adding new ones if required) and return a handle to the created regularisation instance.
Hi
I tried to run the same program (recon_gui) on MATLAB, Windows 64 bit. but I just get this message
Undefined function or variable'toastParam'。
Error recon_gui>recon_gui_OpeningFcn (line 62)
prm = toastParam;
Error gui_mainfcn (line 220)
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
Error recon_gui (line 42)
gui_mainfcn(gui_State, varargin{:});
Last edit: chenzhilei 2015-01-05
I also tried to run mtoast2_install.m scripts ,This add the required directories \toast\win\x64\Release\mex2 to my Matlab path.After I run recon_gui,and loading recon1.prm.but when run to caculating gradient,I get this message
MATLAB has encountered an internal problem and needs to close
There appears to be a problem with the SuperLU solver in the current multithreaded Toast version: SuperLU turns out not to be threadsafe. Currently, when selecting the "DIRECT" solver, e.g. for computing gradients, Toast invokes SuperLU. Until I find a more permanent solution, your options are
LINSOLVER = DIRECT
with
LINSOLVER = BICGSTAB
LINSOLVER_TOL = 1e-12
Hi,
I have the same problem while running recon_gui. I am using the binary package and find that the line: LINSOLVER=DIRECT in recon1.prm has already replaced by
LINSOLVER = BICGSTAB
LINSOLVER_TOL = 1e-12
However, the problem is still the same.
I have more problems compiling from the source. Is it possible to solve this problem using the binary package?
Thank you so much!
Hi
I tried to install Toast++, but there is an error happens when executing the matlab script (mtoast_install)
??? Error using ==> textscan
First input can not be empty.
Error in ==> mtoast_install at 88
p = textscan(p,'%s'); % split path into separate elements
How can I fix this a problem?
This could be a version incompatibility. Which version of Matlab are you using?
I faced this issue too initially. Make sure that in your MATLAB window, you've navigated to the folder containing mtoast_install.m before you run it. That fixed the issue for me. Hope it helps!
Hi!
Currently I am trying to run the recon_gui and the examples demo of toast ++ but I am unable to do.
I used the precompiled toast++ folder for common and window mex folders for MATLAB 64 bit system. I get the following error after loading and running the demo6.prm.
??? Error using ==> reshape
Size vector must be a row vector with integer elements.
Error in ==> recon_gui>disp_iter at 241
bmua = reshape(res.bmua,bdim');
Error in ==> toastSolver>toastSolver.solve_iter at 395
feval(prm.transient.callback.iter, prm, RES);
Error in ==> toastSolver>@(varargin)this.solve_iter(varargin{:}) at 338
localprm.callback.iter = @this.solve_iter;
Error in ==> toastSolver>toastSolver.echo_iteration_state at 174
feval(obj.lprm.callback.iter, obj.lprm.callback.context, itr, x,
err);
Error in ==> toastSolverCG>toastSolverCG.Solve at 52
this.echo_iteration_state (0, x, err);
Error in ==> toastRecon at 179
solver.Solve (x);
Error in ==> recon_gui>runrecon_Callback at 219
toastRecon(prm);
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> recon_gui at 42
gui_mainfcn(gui_State, varargin{:});
??? Error while evaluating uicontrol Callback
The following are the folder which are added to my matlab search path, mex, mex2, demos,matlab,gui, html,toast2, utilities.........
Regards,
I'll check this out. It could be a compatibility problem since you have both the old and new matlab interfaces active (mex and mex2). Can you run any of the demos if you remove the 'mex' entry from your matlab search path, but keep the 'mex2'?
Thank you for your reply.. I checked it by removing the mex search path but again getting the same error.. However, the 2-D demos with GUI are working except the 3-D demo6.. Thank you again for your time and response..
Regards,
Last edit: sohail 2015-11-02
Hi!
I've downloaded the common package and the Windows binary package 1.0.4, unzipped them and added the toolbox to my Matlab 2014a environment. When I run toast_demo2.m, I got this message, and I have to restart Matlab.
If I check the details, I found the following message:
This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.
How can I fix this?
Thank you!
Last edit: DiHe 2016-01-07