Skip to content

How to run quip_cnn_segmentation pipeline using docker (as example in BMI cluster)

bridge wang edited this page Jan 6, 2021 · 8 revisions

Step 1: clone code from github master branch to your host

git clone https://github.com/SBU-BMI/quip_cnn_segmentation.git

Step 2: login in one of BMI cluster computing node

ssh node002

Step 3: check gpu usage in your machine (computing node)

nvidia-smi to find which gpu id is available.

Step 4: build docker image, if docker image "quip_cnn_segmentation" exists, delete it first

cd to quip_cnn_segmentation;
for example
**cd to /home/bwang/quip_cnn_segmentation **
docker build -t quip_cnn_segmentation .

Step 5: Confirm docker image is generated successfully

docker images
For example docker image list is
quip_cnn_segmentation latest e2169e73c093 About a minute ago 6.53GB

Step 6: create host-folder and subfolder svs and copy svs image files to this subfolder svs

for example:
host folder: /home/bwang/quip_cnn_segment_test
image folder:/home/bwang/quip_cnn_segment_test/svs \

Step 7: run docker container

nvidia-docker run --name quip-segmentation -itd
-v /:/data/wsi_seg_local_data
-e CUDA_VISIBLE_DEVICES=${GPU_ID}
-e NPROCS=${num_cpu_cores_for_watershed_processing}
quip_cnn_segmentation run_wsi_seg.sh

You host-folder should have an svs subfolder. Input images should be in the svs subfolder. Argument -v /:/data/wsi_seg_local_data maps the host-folder on the host to the local folder in the container. The segmentation run will create two output folders: //logs (/data/wsi_seg_local_data/logs): log files are stored in this folder. //seg_tiles (/data/wsi_seg_local_data/seg_tiles): segmentation output is stored in this folder. The docker container does everything: tiling, detection and segmentation, csv and json file generation.

//run docker container example 1
nvidia-docker run --name quip-segmentation -itd
-v /home/bwang/quip_cnn_segment_test/:/data/wsi_seg_local_data
-e CUDA_VISIBLE_DEVICES=0
-e NPROCS=12
quip_cnn_segmentation run_wsi_seg.sh

//example 2:
//default value
// CUDA_VISIBLE_DEVICES=0
// NPROCS=12
nvidia-docker run --name quip-segmentation -itd
-v /home/bwang/quip_cnn_segment_test/:/data/wsi_seg_local_data
quip_cnn_segmentation run_wsi_seg.sh

Step 8: check segmentation results

segmentation output folder: /seg_tiles/
for example:
segmentation output folder: /home/bwang/quip_cnn_segment_test/seg_tiles/
this folder includes ***.png files, ***features.csv files and ***algmeta.json files.

log file folder: /logs/
for example:/home/bwang/quip_cnn_segment_test/logs/