---
license: apache-2.0
---

# DiffTumor

The Singularity container is designed for the prediction of abdominal tumors, specifically targeting the liver, pancreas, and kidneys. It utilizes a segmentation model sourced from [DiffTumor](https://github.com/MrGiovanni/DiffTumor).

# Instructions

### 1-Download
Download the singularity container.
```
wget https://huggingface.co/qicq1c/DiffTumor/resolve/main/difftumor_final.sif
```
### 2-Data preparation
This is how `inputs_data` organizes
```
    $inputs_data/
    ├── case00001.nii.gz
    ├── case00002.nii.gz
    ├── case00003.nii.gz
    ├── case000xx.nii.gz
    ├── ...
    ├── case10000.nii.gz
```

### 3-Inference
You can directly perform inference on your own data. Simply modify inputs_data to reflect your data path and adjust outputs_data to specify the desired output location for the segmentation results.
```
SINGULARITYENV_CUDA_VISIBLE_DEVICES=0 singularity run --nv -B $inputs_data:/workspace/inputs -B $outputs_data:/workspace/outputs difftumor.sif
```

This is how `outputs_data` organizes
```
    $outputs_data/
    ├── case00001
    ├── case00002
    ├── case00003
        │── ct.nii.gz
        └── predictions
            ├── liver.nii.gz
            ├── pancreas.nii.gz
            ├── kidney.nii.gz
            ├── liver_tumor.nii.gz
            ├── pancreas_tumor.nii.gz
            ├── kidney_tumor.nii.gz
```