ft42 commited on
Commit
f6b0f0b
·
verified ·
1 Parent(s): 180bbb5

Upload 4 files

Browse files
Files changed (4) hide show
  1. DOCKER_EXPORT.md +72 -0
  2. DOCKER_SETUP.md +53 -0
  3. Dockerfile +33 -0
  4. Dockerfile.example +28 -0
DOCKER_EXPORT.md ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Docker Image Export/Import Instructions
2
+
3
+ ## 1. Save Docker Image to File
4
+
5
+ After the build completes, save the image as a .tar file:
6
+
7
+ ```bash
8
+ cd /data/usr/ft42/CVIT_XAI/LungRADS_Modeling/CLARITY/PiNS
9
+ docker save medical-imaging/nodule-segmentation:latest -o medical-imaging-nodule-segmentation.tar
10
+ ```
11
+
12
+ ## 2. Compress the Image (Optional - Recommended)
13
+
14
+ Compress the .tar file to save space:
15
+
16
+ ```bash
17
+ gzip medical-imaging-nodule-segmentation.tar
18
+ # This creates: medical-imaging-nodule-segmentation.tar.gz
19
+ ```
20
+
21
+ ## 3. Check File Size
22
+
23
+ ```bash
24
+ ls -lh medical-imaging-nodule-segmentation.tar*
25
+ ```
26
+
27
+ ## 4. Load Image on Another Machine
28
+
29
+ To use the saved image on another machine:
30
+
31
+ ```bash
32
+ # If compressed:
33
+ gunzip medical-imaging-nodule-segmentation.tar.gz
34
+
35
+ # Load the image:
36
+ docker load -i medical-imaging-nodule-segmentation.tar
37
+
38
+ # Verify it loaded:
39
+ docker images | grep medical-imaging
40
+ ```
41
+
42
+ ## 5. Share the Image
43
+
44
+ You can now share the .tar.gz file:
45
+ - Copy to USB drive
46
+ - Upload to cloud storage
47
+ - Transfer via network
48
+ - Include in project distribution
49
+
50
+ ## File Size Expectations
51
+
52
+ - Uncompressed .tar: ~1.5-2.0 GB
53
+ - Compressed .tar.gz: ~800MB-1.2GB
54
+
55
+ ## Alternative: Docker Hub (Optional)
56
+
57
+ You can also push to Docker Hub for easy sharing:
58
+
59
+ ```bash
60
+ # Tag the image
61
+ docker tag medical-imaging/nodule-segmentation:latest ft42/nodule-segmentation:latest
62
+
63
+ # Push to Docker Hub
64
+ docker push ft42/nodule-segmentation:latest
65
+ ```
66
+
67
+ ## Usage After Import
68
+
69
+ Once loaded, use exactly as before:
70
+ ```bash
71
+ ./scripts/DLCS24_KNN_2mm_Extend_Seg.sh
72
+ ```
DOCKER_SETUP.md ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Docker Setup Instructions
2
+
3
+ ## If you need to build the Docker image from scratch:
4
+
5
+ 1. **Create the Dockerfile** (copy from `Dockerfile.example`):
6
+ ```bash
7
+ cp Dockerfile.example Dockerfile
8
+ ```
9
+
10
+ 2. **Build the Docker image**:
11
+ ```bash
12
+ docker build -t medical-imaging/nodule-segmentation:latest .
13
+ ```
14
+
15
+ 3. **Verify the image was created**:
16
+ ```bash
17
+ docker images | grep medical-imaging
18
+ ```
19
+
20
+ ## If the image already exists:
21
+
22
+ You can check if it exists with:
23
+ ```bash
24
+ docker images | grep medical-imaging/nodule-segmentation
25
+ ```
26
+
27
+ If it shows the image, you can directly run the main script:
28
+ ```bash
29
+ ./scripts/DLCS24_KNN_2mm_Extend_Seg.sh
30
+ ```
31
+
32
+ ## Container Management
33
+
34
+ The script automatically:
35
+ - Removes any existing container with the same name
36
+ - Creates a new container
37
+ - Runs the segmentation pipeline
38
+ - Keeps the container running for potential debugging
39
+
40
+ To manually clean up containers:
41
+ ```bash
42
+ docker rm -f nodule_seg_pipeline
43
+ ```
44
+
45
+ To see running containers:
46
+ ```bash
47
+ docker ps
48
+ ```
49
+
50
+ To see all containers (including stopped):
51
+ ```bash
52
+ docker ps -a
53
+ ```
Dockerfile ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:20.04
2
+
3
+ # Set environment variables to avoid interactive prompts
4
+ ENV DEBIAN_FRONTEND=noninteractive
5
+ ENV TZ=America/New_York
6
+
7
+ # Install system dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ python3 \
10
+ python3-pip \
11
+ python3-dev \
12
+ build-essential \
13
+ libssl-dev \
14
+ libffi-dev \
15
+ python3-setuptools \
16
+ git \
17
+ cmake \
18
+ tzdata \
19
+ && rm -rf /var/lib/apt/lists/*
20
+
21
+ # Install Python packages
22
+ RUN pip3 install --no-cache-dir \
23
+ SimpleITK \
24
+ pyradiomics \
25
+ scikit-learn \
26
+ numpy \
27
+ pandas \
28
+ matplotlib \
29
+ scipy \
30
+ nibabel
31
+
32
+ WORKDIR /app
33
+ CMD ["tail", "-f", "/dev/null"]
Dockerfile.example ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:20.04
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ python3 \
6
+ python3-pip \
7
+ python3-dev \
8
+ build-essential \
9
+ libssl-dev \
10
+ libffi-dev \
11
+ python3-setuptools \
12
+ git \
13
+ cmake \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Install Python packages
17
+ RUN pip3 install --no-cache-dir \
18
+ SimpleITK \
19
+ pyradiomics \
20
+ scikit-learn \
21
+ numpy \
22
+ pandas \
23
+ matplotlib \
24
+ scipy \
25
+ nibabel
26
+
27
+ WORKDIR /app
28
+ CMD ["tail", "-f", "/dev/null"]