Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 2.16 KB

README.md

File metadata and controls

20 lines (14 loc) · 2.16 KB

Transforms

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 from torchio.transforms, e.g. preprocessing (resampling, cropping, normalization) and augmentation (flip, affine, noise, etc.). Examples: atlas_transforms.json, brats3d_transforms.json
  • "backend": "monai": dictionary transforms from monai.transforms. If a transform accepts keys and none is given in params, the entry-level keys or 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 for image, nearest for gt) → 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.