Creates TorchIO or MONAI transform pipelines from the JSON Transforms Config referenced by dataset.transforms (see config/README.md).
TransformsFactory.create_instance(transforms_config, backend="torchio", default_keys=("image", "label")) builds a Compose from a list of {"name": ..., "params": {...}} entries (returns None for an empty list). BaseTrainer calls it once for preprocessing and once for augmentations: training uses preprocessing + augmentations, validation/test use preprocessing only.
Supported:
"backend": "torchio"(default): transforms fromtorchio.transforms, e.g. preprocessing (resampling, cropping, normalization) and augmentation (flip, affine, noise, etc.). Examples: atlas_transforms.json, brats3d_transforms.json"backend": "monai": dictionary transforms frommonai.transforms. If a transform acceptskeysand none is given inparams, the entry-levelkeysor the top-level"keys"(default["image", "label"]) is injected. Example: qatacov2d_transforms.json
QaTaCov(BaseTransforms2D): fixed MONAI pipeline for raw QaTa-COV19 X-rays (inherits from BaseTransforms2D), used by QaTaCovPreprocess and scripts/preprocess_qatacov.py.
- Usage:
QaTaCov(mode='train' | 'val' | 'test').transform(image_size=[224, 224]) - Pipeline on keys
image/gt:LoadImaged(PIL reader) → transpose →EnsureChannelFirstd→Resized(bicubic forimage, nearest forgt) →ToTensord - The pipeline is currently the same for all modes (no augmentation)
Custom Transforms: Alternatively, implement preprocessing/augmentation directly in your dataset class, or subclass BaseTransforms2D for a MONAI pipeline.