Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working on all vertebrae in parallel #1

Open
idhamari opened this issue Feb 21, 2019 · 3 comments
Open

Working on all vertebrae in parallel #1

idhamari opened this issue Feb 21, 2019 · 3 comments

Comments

@idhamari
Copy link
Contributor

idhamari commented Feb 21, 2019

This should reduce the time to complete spine segmentation but it seems Slicer python doesn't support run in parallel.

I tried this:

   jobs=[0,1,2,3,4,5,6,7]       
   if isParallel ==1:
      results1 = []
      print '--pooling starts now--'
      pool = Pool( processes=8 )
      r1 = pool.map_async(self.runCroppingAll,jobs, callback=results1.append)
      r1.wait() # Wait for the results
      print '--pooling completed--'
      raw_input("Press Enter to continue...")

but either Slice rcrashes or hang.

@idhamari
Copy link
Contributor Author

idhamari commented Feb 21, 2019

next to try:

  1. prepare all parameters into txt file.
  2. run only one command that run external python script
    • the script read the text file and apply the process in parallel.

tried system python and slicer python in additon to

        Slicer --no-main-window --python-script  file.py

but nothing work. It is mentioned here that PyQT does not support parallel process.

@idhamari
Copy link
Contributor Author

next to try: try to call a compiled cpp or shell script that call in parallel.

@idhamari
Copy link
Contributor Author

idhamari commented Feb 21, 2019

tried calling shell script but does not work. What work is:

cmds = c1 + " & " + c2 + " & " + c3 + " & " + c4 + " & " + c5 + " & " + c6 + " & " + c7
os.system( cmds)

problem: how to get the same command in windows?

tested in windows and works:

  cc = " & start /b "
  ce = " )| pause"
  cmds ="( start " +  cmd1 + cc + cmd2 + cc + cmd3 + cc + cmd4 + cc + cmd5 + cc + cmd6 + cc + cmd7 + ce

next step, implement this solution and test it then close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant