See SlicerNNInteractive github page for more information.
This examples uses two folders
# create python environment python3 -m venv SlicerNNInteractive # activate python environment source SlicerNNInteractive/bin/activate # install SlicerNNInteractive server pip install nninteractive-slicer-server # deactivate environment deactivate
# make a base folder for the NNInteractive Server mkdir NNInteractive # go into the base folder cd NNInteractive # copy theslurm sbatch template for starting the server cp /software/example/run-nninteractive-slicer-server.sbatch . # defaults are set to 1 node, 16 cpu, 32GB memory, 1 Gpu. # modify the top of the file where needed.
See further instructions here : SlicerNNInteractive
# go to the base folder where the submit script is located. cd NNInteractive # start the slurm job sbatch run-nninteractive-slicer-server.sbatch # keep track of the final job id (eg: Submitted batch job <jobnumber>)
Once the server is started, monitor the content of the nninteractive-slicer-server-<jobnumber>.log file.
tail nninteractive-slicer-server-<jobnumber>.log
Wait until it contains a similar content like the following listed below :
.... INFO: Started server process [1200063] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://ctit088.ewi.utwente.nl:8882 (Press CTRL+C to quit)
The url being listed is the one you will need to use in the client that runs on your own laptop/workstation.
Go to the nnInteractive module in Slicer and in the Configuration tab type in the URL listed in the nninteractive-slicer-server-<jobnumber>.log file when starting the server. Keep in mind that every time you start the server this URL will be different. See further instructions here : SlicerNNInteractive
The example script will terminate the SlicerNNInteractive Server after 2 hrs. You can modify this to a different time, however if you don't use it anymore you should terminate the SlicerNNInteractive Server. Use the jobnumber to terminate the SlicerNNInteractive Server.
scancel <jobnumber>