Mercure module to deploy TotalSegmentator tool for segmentation of 104 classes in CT images and 56 classes in MR images. This module runs as a docker container in mercure, it can be added to an existing mercure installation using docker tag :
mercureimaging/mercure-totalsegmentator:v2
.
The current version of the module is configured to run the TotalSegmentator at a lower resolution (3mm) if only CPU is available and at high resolution when GPU (cuda device) is available.
Also, the pipeline will automatically run the correct subcommand for TotalSegmentator depending on whether the input data is 'CT' or 'MR'.
Follow instructions on Mercure website on how to add a new module. Use the docker tag mercureimaging/mercure-totalsegmentator.
Install virtual box and vagrant and follow jupyter notebook tutorial tutorial_mercure-totalsegmentator.ipynb (less than 1hr to complete).
- Clone repo.
- Build Docker container locally by running make (modify makefile with new docker tag as needed).
- Test container :
docker run -it -v /input_data:/input -v /output_data:/output --env MERCURE_IN_DIR=/input --env MERCURE_OUT_DIR=/output --shm-size 1G *docker-tag*
The default shared memory (shm) size for Docker container might not be sufficient to run the container. Thus, --shm-size 1G
is included in the above command. Similarly, when configuring this module in Mercure, add the following as one of the docker arguments:
"shm_size": "1G"
Segmentations are written to specified output directory in three different formats :
- DICOM RTSTRUCT ( with segmentated VOI volume ( mm3 ) in description field )
- DICOM SEG
- DICOM RGB ( with masks of each VOI overlaid )
MAP operators and code adapted from GSTT-CSC TotalSegmentator-AIDE repository: https://github.com/GSTT-CSC/TotalSegmentator-AIDE