svreg command line "cores"

Viewing 10 reply threads
  • Author
    Posts
    • #1836
      LDO
      Participant

      We have been having troubles with SVreg aborting when used from the command line.
      BUT, only on some machines. Seems to run fine on the same machines from the GUI.
      Have tried the commands from both v18a and 19a with same result. The svreg.exe is called from within a Matlab script.

      I think I have found the source of the command line error:
      “The whole surface volume registration and labeling sequence takes about 90-100 min.
      Starting parallel pool (parpool) using the ‘local’ profile … Error using parpool (line 103)
      You requested a minimum of 3 workers, but the cluster “local” has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
      Error in svreg (line 169)”

      So 2 core machines fail but 4 core machines do OK. Is this something you can address in the command line tool? Or do I have to try to modify the minimum number of cores in Matlab on every machine?

    • #1837
      Anand Joshi
      Moderator

      Thank you for using BrainSuite and reporting this issue.
      You can run the svreg on the command line in a single threaded mode using -U flag.

      http://brainsuite.org/processing/svreg/usage/

    • #1838
      LDO
      Participant

      Yes! That did start the process.
      But it stops after a few minutes:

      …curvature resolution 10/10
      Multiresolution curvature maps are calculated
      Computing additive curvature
      Performing curvature registration
      Curvature registration at resolution 1/4
      Error using imhist (line 76)
      Invalid MEX-file ‘C:\Users\LARRYO~1\AppData\Local\Temp\Larry Olson\mcrCache9.0\svreg_0\toolbox\images\images\private\imhistc.mexw64’: The specified procedure could not be found.

      Error in histeq>computeCumulativeHistogram (line 181)
      Error in histeq (line 138)
      Error in register_images_elastic_anand_landmarks_cg (line 26)
      Error in curvature_registration512g_wt_multi_bs_elastic_xyz_cg (line 129)
      Error in curvature_registration_newbs_elastic_xyz (line 73)
      Error in svreg_label_surf_hemi (line 165)
      Error in svreg (line 180)
      MATLAB:invalidMEXFile

      But, oddly, if I look in ‘C:\Users\LARRYO~1\AppData\Local\Temp\Larry Olson\mcrCache9.0\svreg_0\toolbox\images\images\private\imhistc.mexw64’, imhistc.mexw64 is there

    • #1839
      LDO
      Participant

      See above. The svreg.exe with -U failed when I called it from Matlab 2019a. I just ran exactly the same call from the command prompt in Windows and it worked perfectly. I am puzzled…

    • #1840
      Anand Joshi
      Moderator

      Did you install 32 bit windows MCR by any chance? A 64 bit version is required.

    • #1841
      LDO
      Participant

      No, it is 64 bit MCR
      It works from the GUI
      It works (with the same DOS command) from the Windows command prompt
      *It just aborts part way through (with the same DOS command) when started within Matlab

      (MCR_R2015b_win64_installer.exe)
      (but I also have other versions installed for creating Matlab standalone programs)

      That is so puzzling

    • #1842
      Anand Joshi
      Moderator

      It might be that it is trying to use a different runtime version when called from matlab.
      Note that the environment variables and the path is different in dos and in matlab.
      check environment variables in matlab by typing env. Make sure that the correct MCR is first on the path.

    • #1843
      LDO
      Participant

      “check environment variables in matlab by typing env”
      >’env’ is not recognized as an internal or external command, operable program or batch file.
      (On Windows here)

      Actually I have only one Matlab Compiler Runtime: 7.13
      But 3 Matlab Runtimes: 9.0, 9.5, 9.6

      Not sure how to check environment variables…

    • #1844
      Anand Joshi
      Moderator

      Can you just type path in the matlab command window?

      How are you running the svreg execuable from witin matlab? Are you using !svreg.exe …. ?

      Can you send me steps to reproduce the issue?

    • #1845
      LDO
      Participant

      Of course this is done after having run the Cortical Extraction Sequence first.
      Then, here is a bit of the Matlab code used to call svreg:

      Name = ’xnrT1.nii.gz’ %(skull stripped T1)
      basename = string(name(1:(length(name)-7))) %(.nii.gz extension)
      st=’svreg.exe ‘+ basename + ‘ -U’
      dos(st)

      This results in:
      basename= ‘xnrT1’
      st=svreg.exe “C:\Users\Larry Olson\Desktop\jtTestCase\BS”\xnrT1 -U
      these are the errors (from running the script OR from pasting into matlab command window):
      …curvature resolution 8/10
      curvature resolution 9/10
      curvature resolution 10/10
      Multiresolution curvature maps are calculated
      Computing additive curvature
      Performing curvature registration
      Curvature registration at resolution 1/4
      Error using imhist (line 76)
      Invalid MEX-file ‘C:\Users\LARRYO~1\AppData\Local\Temp\Larry Olson\mcrCache9.0\svreg_1\toolbox\images\images\private\imhistc.mexw64’: The specified procedure could not be found.
      Error in histeq>computeCumulativeHistogram (line 181)
      Error in histeq (line 138)
      Error in register_images_elastic_anand_landmarks_cg (line 26)
      Error in curvature_registration512g_wt_multi_bs_elastic_xyz_cg (line 129)
      Error in curvature_registration_newbs_elastic_xyz (line 73)
      Error in svreg_label_surf_hemi (line 191)
      Error in svreg (line 180)
      MATLAB:invalidMEXFile
      ans =
      -1

      Note I pasted the exact same call into a DOS Command Prompt, and it ran all the way through:
      svreg.exe “C:\Users\Larry Olson\Desktop\jtTestCase\BS”\xnrT1 –U

      Had to use the –U flag because this machine is only a dual core i5

    • #3529
      Anonymous
      Inactive

      How did you made it start working?

      I am on Windows 10 2-core i7

      I have executed the CSE before SVReg with this command (it worked):
      (in the 1 dataset folder I added the cse script to the path)
      C:\Users\italo\Documents\BrainSuite_CMD>”C:\Users\italo\Documents\BrainSuite_Tools\BrainSuite21a_src\scripts\cortical_extraction” italot1.nii

      Note that I did not call cortical_extraction.exe (Did not recognize it)

      Now with the SVReg Process.

      I did the same with the SVReg script and typed:
      C:\Users\italo\Documents\BrainSuite_CMD>”C:\Users\italo\Documents\BrainSuite_Tools\svreg_21a_build2317_source\scripts\svreg” italot1

      Returned me:
      using SVReg in C:\Users\italo\Documents\BrainSuite_Tools\svreg_21a_build2317_source
      ‘”C:\Users\italo\Documents\BrainSuite_Tools\svreg_21a_build2317_source\scripts\svreg.exe”‘ is not recognized as an internal or external command,
      operable program or batch file.

      So I decided to run the svreg on the BrainSuite Bin folder:
      C:\Users\italo\Documents\BrainSuite_CMD>”C:\Program Files\BrainSuite21a\svreg\bin\svreg” italot1

      Returned me:
      Not enough input arguments.
      Error in svreg (line 24)
      MATLAB:minrhs

      Any Suggestions to run SVReg on Command Line properly?

      Regards, Italo

Viewing 10 reply threads
  • You must be logged in to reply to this topic.