SlicerNNInteractive Server.

See SlicerNNInteractive github page for more information.

A Step by step guide to setup/start/stop the SlicerNNInteractive Server on the HPC/Slurm cluster.

This examples uses two folders

  1. a folder for the python virtual environment : SlicerNNInteractive
  2. a folder for submitting the SlicerNNInteractive Server task : NNInteractive

Server side installation.

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

Client side installation.

See further instructions here : SlicerNNInteractive

Starting the SlicerNNInteractive Server

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

Connecting from the Client to the SlicerNNInteractive Server

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

Stopping the SlicerNNInteractive Server

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>