# IIPS (IVH-ICH-PHE Segmentation) The IVH-ICH-PHE Segmentation (IIPS) is a tool designed to segment intracerebral hemorrhage (ICH), intraventricular hemorrhage (IVH) and perihematomal edema (PHE) from CT images using a Docker container. The model was trained using nnU-Net default configuration and the `3D-fullres` setting. We repurposed the 2019 Intracranial Hemorrhage Detection Challenge dataset for segmentation. External testing was conducted on 183 independent baseline NCCTs with spontaneous ICH at our institution. Further details are available in our upcoming publication. ## Prerequisites Before using IIPS, ensure the following: - Head CT images need to be in the `nii.gz` format. - Docker is installed on your system. Refer to the [Docker Installation Guide](../docker.md) or the [official Docker documentation](https://docs.docker.com/get-docker/) for setup instructions. - Your system meets the hardware requirements for running Docker containers, especially if you plan to use GPU acceleration. > **Important**: If you want to run the inference using CUDA, please use NVIDIA driver 560 or higher and CUDA 12.6 or higher. ## Installation To install IIPS, pull the Docker image from the repository: ```bash docker pull avnirlab/iips: ``` For available IIPS versions, see the [IIPS Docker Hub tags](https://hub.docker.com/r/avnirlab/iips/tags). It is recommended to use a specific version tag rather than `latest` for reproducibility. ## Usage To run the inference, run the following command: ```bash docker run -ti -v /path/to/your/data:/input -v /path/to/your/output:/output \ -u 0:$(id -g) --gpus all --rm --shm-size 2g avnirlab/iips: -device cuda ``` - Replace `/path/to/your/data` with the directory containing your input CT images in the nifti (.nii.gz) format. - Replace `/path/to/your/output` with the directory where you want the output files to be saved. - Use the `-device cuda` flag for GPU-based inference. For CPU-based inference, replace `cuda` with `cpu` and remove `--gpus all` flag. - Replace `` with the version of IIPS you want to use. ## Label Information The output label masks generated by IIPS use the following label conventions: - **1**: Intracerebral Hemorrhage (ICH) - **2**: Intraventricular Hemorrhage (IVH) - **3**: Perihematomal Edema (PHE) ## Example Workflow Here’s a step-by-step example to demonstrate IIPS usage: 1. **Prepare directories**: ```bash mkdir output_directory ls input_data/ > image1.nii.gz image2.nii.gz ``` 2. **Run IIPS**: ```bash docker run -ti -v $(pwd)/input_data:/input -v $(pwd)/output_directory:/output \ -u 0:$(id -g) --gpus all --rm --shm-size 2g avnirlab/iips:latest -device cuda ``` 3. **Check the output**: ```bash ls output_directory/results > image1.nii.gz image2.nii.gz dataset.json plans.json predict_from_raw_data_args.json ``` In the output_directory, the Nifti images are the predicted label masks. ## Additional Resources - **Dockerhub**: [Dockerhub](https://hub.docker.com/r/avnirlab/iips) - **GitHub Repository**: [IIPS-Docker](https://github.com/llgneuroresearch/IIPS-Docker) - **Docker Documentation**: [Get Started with Docker](https://docs.docker.com/get-started/)