Menu

Problem of running TOAST++ on MATLAB, Windows.

Xin
2014-04-08
2016-05-13
1 2 > >> (Page 1 of 2)
  • Xin

    Xin - 2014-04-08

    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

                   meas.qmfile : ../meshes/circle25_32x32.qm
                 meas.src.type : NEUMANN
                 meas.src.prof : GAUSSIAN
                meas.src.width : 2.000000
                 meas.det.prof : GAUSSIAN
                meas.det.width : 2.000000
                     data.freq : 100.000000
                data.lnampfile : ../fwdfem/fmod_ellips_32x32_100MHz.fem
                data.phasefile : ../fwdfem/farg_ellips_32x32_100MHz.fem
                   data.useref : false
            fwdsolver.meshfile : ../meshes/circle25_32.msh
              fwdsolver.method : DIRECT
                 fwdsolver.tol : 0.000000
             solver.basis.bdim : 128.000000 128.000000
             solver.basis.gdim : 128.000000 128.000000
                 solver.method : PCG
                    solver.tol : 0.000000
                 solver.dscale : AVG_DIFFDATA
                  solver.itmax : 100.000000
                solver.lsearch : true
                  solver.step0 : 1.000000
               solver.cg.reset : 10.000000
             initprm.mua.reset : HOMOG
               initprm.mua.val : 0.025000
             initprm.mus.reset : HOMOG
               initprm.mus.val : 2.000000
             initprm.ref.reset : HOMOG
               initprm.ref.val : 1.400000
                  regul.method : None
                          user : 
                     transient :
    

    ??? 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

     
    • Martin Schweiger

      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.

       
      • chenzhilei

        chenzhilei - 2015-01-04

        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{:});

         
  • Mohammed

    Mohammed - 2014-04-15

    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.

     
  • Martin Schweiger

    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?

     
  • Alejandro Vidal-Rosas

    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

     
  • Martin Schweiger

    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.

     
  • Alejandro Vidal-Rosas

    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

     
    • Martin Schweiger

      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).

       
  • vimmiv

    vimmiv - 2014-10-21

    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?

     
    • Martin Schweiger

      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.

       
    • Martin Schweiger

      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.

       
      • vimmiv

        vimmiv - 2014-11-03

        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
        • Martin Schweiger

          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.

           
  • chenzhilei

    chenzhilei - 2015-01-04

    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
  • chenzhilei

    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

     
    • Martin Schweiger

      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

      1. recompile toast without multithreading support (configure without --enable-threads), or
      2. 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

       
      • DiHe

        DiHe - 2016-02-29

        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!

         
  • Mrwan Alayed

    Mrwan Alayed - 2015-07-25

    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?

     
    • Martin Schweiger

      This could be a version incompatibility. Which version of Matlab are you using?

       
    • Shreyas Padhy

      Shreyas Padhy - 2016-04-14

      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!

       
  • sohail

    sohail - 2015-10-21

    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,

     
  • Martin Schweiger

    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'?

     
    • sohail

      sohail - 2015-11-02

      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
  • DiHe

    DiHe - 2016-01-07

    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
1 2 > >> (Page 1 of 2)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.