Contributing Guide
Thank you for your interest in contributing to ITKIT! This guide will help you get started with development and contributions.
Getting Started
Development Setup
- Fork and clone the repository:
bash
git clone https://github.com/MGAMZ/ITKIT.git
cd ITKIT
- Install development dependencies:
bash
pip install -e ".[dev]"
This installs ITKIT in editable mode with all development tools including:
- pytest (testing)
- black, isort, autopep8 (code formatting)
- mypy, pyright (type checking)
- pylint (linting)
-
pre-commit (git hooks)
-
Set up pre-commit hooks:
bash
pre-commit install
This ensures code is automatically formatted and checked before commits.
What to Contribute
Areas for Contribution
-
Bug Fixes: Fix reported bugs or issues you encounter
-
New Features:
- New preprocessing operations
- Additional neural network models
- Dataset conversion scripts
-
Framework integrations
-
Documentation:
- Improve existing docs
- Add examples
- Fix typos
-
Translate documentation
-
Tests:
- Increase test coverage
- Add edge case tests
-
Add integration tests
-
Performance:
- Optimize slow operations
- Improve memory usage
- Add parallelization
Adding New Models
To add a new neural network model:
- Create model file in
itkit/models/ - Implement model class with PyTorch
- Add documentation in
docs/models.md - Include reference paper and citation
- Add usage examples
- Create unit tests
Example structure:
# itkit/models/my_new_model.py
import torch
import torch.nn as nn
class MyNewModel(nn.Module):
"""
Brief description of the model.
Reference: Author et al., "Paper Title", Conference/Journal Year.
"""
def __init__(self, in_channels, num_classes, **kwargs):
super().__init__()
# Model architecture
def forward(self, x):
# Forward pass
return output
Adding Dataset Conversion Scripts
To add a new dataset conversion script:
- Create folder:
itkit/dataset/<dataset_name>/ - Add conversion script:
convert_<format>.py - Document in
docs/datasets.md - Include dataset reference and citation
- Add example usage
Script should:
- Convert to ITKIT format (image/ and label/ folders)
- Preserve metadata
- Handle edge cases
- Provide progress feedback
Adding Preprocessing Tools
To add a new preprocessing command:
- Create script in
itkit/process/ - Add entry point in
pyproject.toml - Create documentation in
docs/itk_*.mdand updatemkdocs.yml - Add tests in
tests/ - Support common flags (
--mp,--help)
Getting Help
- Issues: Use GitHub Issues for bug reports and feature requests
- Email: Contact maintainer at 312065559@qq.com
- Discussions: Use GitHub Discussions for questions