Automatic Resection identification

@Raymundo.Cassani @tmedani @edelaire

I have created a Docker image here for this repo below:

Can you test it at your end and see if everything works fine? I have tested this image on Windows (with and without NVIDIA GPU) and Apple Silicon, and it works fine.

Steps to test:

  1. Pull the image
    docker pull chinmaychinara/auto-resection-mask:latest

  2. Run the image

  • For Windows, Linux (with NVIDIA GPU):
    docker run --rm --gpus all -v /path/to/your/data:/data chinmaychinara/auto-resection-mask:latest /data/preop.nii.gz /data/postop.nii.gz
  • For Windows, Linux, Apple Intel/Silicon (without NVIDIA GPU):
    docker run --rm -v /path/to/your/data:/data chinmaychinara/auto-resection-mask:latest /data/preop.nii.gz /data/postop.nii.gz
  • The outputs will be saved in the same folder as the input data if everything runs successfully.

Notes:

  • For GPU usage i.e. for the flag --gpus all to work will need to configure nvidia-container-toolkit in the host machine.
    EDIT: This is required to access NVIDIA GPUs for any kind of container engine (a little different for Apptainer) - check this
  • For Apple Silicon, in Docker Desktop under Settings > General > Virtual Machine Options > Choose Virtual Machine Manager (VMM) set it to Docker VMM (available for Docker Desktop >= 4.35). If Docker VMM is not available then set the VMM as Apple Virtualization framework and check the Use Rosetta for x86_64/amd64 emulation for Apple Silicon and VirtioFS options.
    • Docker VMM is much faster than Apple Virtualization framework (40 mins vs 1 hour for this module).
  • The image expects that the host machine has CUDA 13.0 i.e. the NVIDIA driver >= 580.
  • Image build details:
    • Base OS: Ubuntu 22.04 (On Windows WSL)
    • CUDA: 13.0.0
    • torch: 2.11.0+cu130
    • torchvision: 0.26.0+cu130
    • Python: 3.10

Once all looks good, we can then move the current implementation of this feature in Brainstorm to a container.

1 Like