Metadata-Version: 2.4
Name: itkit
Version: 4.0.0
Summary: ITKIT: Feasible Medical Image Operation based on SimpleITK API
License: MIT License
        
        Copyright (c) 2025 张贻钦
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy; python_version < "3.14"
Requires-Dist: numpy>=2.3.5; python_version >= "3.14"
Requires-Dist: SimpleITK
Requires-Dist: opencv-python-headless
Requires-Dist: openpyxl
Requires-Dist: pandas
Requires-Dist: scikit-image
Requires-Dist: scikit-learn
Requires-Dist: scipy
Requires-Dist: future
Requires-Dist: tensorboard
Requires-Dist: orjson
Requires-Dist: tqdm
Requires-Dist: colorama
Requires-Dist: ml_collections
Requires-Dist: seaborn
Requires-Dist: matplotlib
Requires-Dist: matplotlib-inline
Requires-Dist: jupyter
Requires-Dist: colored
Requires-Dist: albumentations
Requires-Dist: ftfy
Requires-Dist: deprecated
Requires-Dist: pydantic
Requires-Dist: pydicom
Requires-Dist: pynrrd
Requires-Dist: nibabel
Requires-Dist: tcia_utils
Requires-Dist: regex
Requires-Dist: lightning
Requires-Dist: timm
Provides-Extra: dev
Requires-Dist: torch; extra == "dev"
Requires-Dist: setuptools; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Requires-Dist: h5py; extra == "dev"
Requires-Dist: pylint-django; extra == "dev"
Requires-Dist: HolisticTraceAnalysis; extra == "dev"
Requires-Dist: nvidia-ml-py; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: psutil; extra == "dev"
Requires-Dist: memory-profiler; extra == "dev"
Requires-Dist: types-colorama; extra == "dev"
Requires-Dist: types-tqdm; extra == "dev"
Requires-Dist: types-openpyxl; extra == "dev"
Requires-Dist: pandas-stubs; extra == "dev"
Requires-Dist: scipy-stubs; extra == "dev"
Requires-Dist: pyright; extra == "dev"
Requires-Dist: autopep8; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pyupgrade; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pymarkdownlnt; extra == "dev"
Provides-Extra: web
Requires-Dist: flask; extra == "web"
Requires-Dist: flask_cors; extra == "web"
Provides-Extra: advanced
Requires-Dist: torchio; extra == "advanced"
Requires-Dist: onedl-mmcv[torch]; extra == "advanced"
Requires-Dist: onedl-mmengine; extra == "advanced"
Requires-Dist: onedl-mmsegmentation; extra == "advanced"
Requires-Dist: flask; extra == "advanced"
Requires-Dist: flask_cors; extra == "advanced"
Requires-Dist: requests; extra == "advanced"
Provides-Extra: onnx
Requires-Dist: onnx; extra == "onnx"
Requires-Dist: onnxruntime; extra == "onnx"
Requires-Dist: onnxruntime-gpu; extra == "onnx"
Requires-Dist: onnx_graphsurgeon; extra == "onnx"
Requires-Dist: polygraphy; extra == "onnx"
Requires-Dist: tensorrt; extra == "onnx"
Provides-Extra: pathology
Requires-Dist: opensdpc; extra == "pathology"
Requires-Dist: openslide-python; extra == "pathology"
Requires-Dist: openslide-bin; extra == "pathology"
Provides-Extra: gui
Requires-Dist: PyQt6; extra == "gui"
Dynamic: license-file

![LOGO](./docs/ITKIT-LOGO.png)

# ITKIT: Feasible Medical Image Operation based on SimpleITK API

[![Python >= 3.10](https://img.shields.io/badge/python-%3E%3D3.10-blue)](https://www.python.org/) [![SimpleITK >= 2.5.0](https://img.shields.io/badge/SimpleITK-%3E%3D2.5-blue)](https://github.com/SimpleITK/SimpleITK) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE) ![CI Status](https://github.com/MGAMZ/ITKIT/actions/workflows/test.yml/badge.svg)

PyPI: [![PyPI version](https://img.shields.io/pypi/v/itkit?color=blue)](https://pypi.org/project/itkit/) [![Downloads](https://img.shields.io/pypi/dm/itkit)](https://pypi.org/project/itkit/)

Docker Image: [![Docker Pulls](https://img.shields.io/docker/pulls/mgam1009/itkit)](https://hub.docker.com/repository/docker/mgam1009/itkit/general)

Readthedocs: [![Readthedocs](https://readthedocs.org/projects/itkit/badge/)](https://itkit.readthedocs.io/)

ITKIT is a comprehensive toolkit for medical image preprocessing and analysis, providing command-line tools, a GUI application, and deep learning framework integrations for CT and MRI image processing.

## ✨ Core Features

- **🔧 Preprocessing Tools**: Check, resample, orient, patch, augment, and convert medical images
- **🖥️ GUI Application**: User-friendly PyQt6 interface for all operations
- **🧠 Neural Networks**: 16+ state-of-the-art segmentation models (SegFormer, MedNeXt, VMamba, etc.)
- **🔌 Framework Support**: Integration with OpenMMLab, MONAI, TorchIO, and PyTorch Lightning
- **🏥 3D Slicer Extension**: Native extension for running inference directly in 3D Slicer
- **📊 Dataset Conversion**: Scripts for 12+ popular medical imaging datasets
- **⚡ High Performance**: Multiprocessing support for faster batch processing

## 🚀 Quick Start

### Installation

```bash
pip install itkit
# Optional: Install GUI support
pip install "itkit[gui]"
```

We also provide a docker image:

```bash
docker pull mgam1009/itkit:latest
```

> [!NOTE]
> ITKIT experiences BC in v4. The previous version is `v3.6.0rc0`.

### Basic Usage

```bash
# Check dataset integrity
itk_check check /path/to/dataset --min-spacing 0.5 0.5 0.5

# Resample images to uniform spacing
itk_resample dataset /path/to/source /path/to/output --spacing 1.0 1.0 1.0 --mp

# Launch GUI application
itkit-app
```

## 📚 Documentation

**Full documentation is available at [docs](docs/index.md)**

You can also find the docs on [readthedocs](https://itkit.readthedocs.io/).

### Quick Links

- **[Installation Guide](docs/installation.md)** - Detailed installation instructions
- **[Quick Start Tutorial](docs/quickstart.md)** - Get started in 5 minutes
- **[Dataset Structure](docs/dataset_structure.md)** - Required dataset format
- **[Preprocessing Tools](docs/preprocessing.md)** - Complete command reference
- **[Framework Integration](docs/framework_integration.md)** - OpenMMLab, MONAI, TorchIO
- **[3D Slicer Integration](docs/slicer_integration.md)** - Run inference in 3D Slicer
- **[Neural Network Models](docs/models.md)** - Available segmentation models
- **[Supported Datasets](docs/datasets.md)** - Dataset conversion scripts
- **[FAQ & Troubleshooting](docs/faq.md)** - Common issues and solutions
- **[Contributing Guide](docs/contributing.md)** - How to contribute

## 🛠️ Command-Line Tools

ITKIT provides several preprocessing commands:

| Command | Description |
|---------|-------------|
| `itk_check` | Validate dataset integrity (spacing, size, pairing) |
| `itk_resample` | Resample images to target spacing or size |
| `itk_orient` | Orient images to standard directions (LPI, RAS, etc.) |
| `itk_patch` | Extract patches for training |
| `itk_aug` | Data augmentation with random rotations |
| `itk_extract` | Extract specific classes from segmentation maps |
| `itk_convert` | Convert between formats (MHA, NIfTI, NRRD) and frameworks (MONAI, TorchIO) |
| `itkit-app` | Launch graphical user interface |
| `itk_slicer` | Start ITKIT inference server for 3D Slicer integration |
| `mmrun` | Run OpenMMLab experiments |

Use `--help` with any command for detailed usage information.

## 🖼️ GUI Application

![ITKIT GUI](./docs/itkit-gui.png)

Install GUI support and launch:

```bash
pip install "itkit[gui]"
itkit-app

# Adjust DPI if needed
QT_SCALE_FACTOR=2 itkit-app
```

## 📦 Optional Features

ITKIT provides optional dependency groups:

```bash
pip install "itkit[gui]"        # GUI application (PyQt6)
pip install "itkit[advanced]"   # Deep learning frameworks (OpenMMLab)
pip install "itkit[dev]"        # Development tools (pytest, black, mypy)
pip install "itkit[pathology]"  # Pathology image processing
pip install "itkit[onnx]"       # Model deployment (ONNX, TensorRT)
```

## 📖 Citation

If you use ITKIT in your research, please cite:

```bibtex
@misc{ITKIT,
    author = {Yiqin Zhang},
    title = {ITKIT: Feasible Medical Image Operation based on SimpleITK API},
    year = {2025},
    url = {https://github.com/MGAMZ/ITKIT}
}
```

## 🤝 Contributing

We welcome contributions! Please see our [Contributing Guide](docs/contributing.md) for:

- Development setup
- Code style guidelines
- Testing requirements
- Pull request process

## 📄 License

ITKIT is released under the [MIT License](LICENSE).

## 📧 Contact

For questions or suggestions, reach out at: [312065559@qq.com](mailto:312065559@qq.com)

## 🌟 Acknowledgments

ITKIT builds upon:

- [SimpleITK](https://github.com/SimpleITK/SimpleITK) - Medical image processing
- [OpenMMLab](https://github.com/open-mmlab) - Deep learning framework
- [MONAI](https://monai.io/) - Medical imaging AI
- [TorchIO](https://torchio.readthedocs.io/) - Medical image preprocessing

---

**⭐ Star us on GitHub if you find ITKIT useful!**
