Transform catalog¶
Every augmentation MedAugmentX ships, grouped by what it models. Use this page to answer “which transform do I want, and will it move my annotations?”; follow a name through to the API reference for its full docstring, parameter meanings, and defaults.
All transforms are importable from one flat namespace:
from medaugmentx.transforms import BiasField, MRIMotion, RandomAffine
Reading the tables
Parameters lists the arguments that shape the effect. Two more are on every transform and are left out of the tables:
pProbability of applying the transform at all, in
[0, 1]. Default1.0.seedInteger seed or
numpy.random.Generator. Inside a container, children are seeded from the parent instead, each with its own stream.
Targets says what happens to keypoints and bboxes on the volume:
warpedCoordinates are mapped through the same geometry as the pixels. Boxes are mapped by their corners and re-bounded to an axis-aligned box, so they stay valid under rotation. Targets are never silently dropped — after a crop, call
remove_out_of_bounds_targets()to prune the ones that left the frame.unchangedThe pixel grid does not move, so coordinates are passed through untouched.
Masks follow the image for every spatial transform and are resampled with nearest-neighbour interpolation, so label values are never blended into new ones.
Note
This page is generated from the installed package at build time — the transform list, summaries, parameters, and target behaviour are all read out of the code rather than transcribed, so they cannot fall out of date.
Spatial¶
Geometry: resampling, cropping, flipping, and deformation. Masks are resampled with nearest-neighbour interpolation so label values are never blended.
Transform |
What it simulates |
Parameters |
Targets |
|---|---|---|---|
Random affine transform around the volume centre. |
|
warped |
|
Flip the volume along selected axes, each with probability |
|
warped |
|
Random crop biased toward foreground (non-zero) anatomy. |
|
warped |
|
Extract a fixed-size training patch, optionally anchored on a mask class. |
|
warped |
|
Elastic deformation via Gaussian-smoothed random displacements. |
|
warped |
|
Zero out a random number of rectangular (2D) or box (3D) regions. |
|
unchanged |
|
Resample the volume to a fixed |
|
warped |
|
Resample to a requested voxel spacing in millimetres along the grid axes. |
|
warped |
|
Resample already registered data onto an explicit patient-space grid. |
|
warped |
|
Pad the volume (centred) up to |
|
warped |
|
Crop the centred region of |
|
warped |
Intensity¶
Signal-domain changes that leave geometry alone — noise, contrast, blur, and bias. Masks and geometric targets always pass through untouched.
Transform |
What it simulates |
Parameters |
Targets |
|---|---|---|---|
Rician magnitude noise under a single-complex-signal model. |
|
unchanged |
|
Additive zero-mean Gaussian noise. |
|
unchanged |
|
Power-law (gamma) intensity transformation. |
|
unchanged |
|
Smooth multiplicative bias field simulating MRI intensity non-uniformity. |
|
unchanged |
|
Random window-level augmentation — simulates CT viewer protocol variation. |
|
unchanged |
|
Additive brightness shift + multiplicative contrast factor. |
|
unchanged |
|
Isotropic Gaussian blur applied to the image. |
|
unchanged |
|
Median filter — edge-preserving smoothing, strong against salt-and-pepper. |
|
unchanged |
|
Simulate a lower-resolution acquisition by down- then upsampling. |
|
unchanged |
|
Sharpen the image with an unsharp mask. |
|
unchanged |
|
Contrast Limited Adaptive Histogram Equalization. |
|
unchanged |
|
Match the image intensity histogram to a reference distribution. |
|
unchanged |
|
Clip to chosen percentiles and map the image into [0, 1]. |
|
unchanged |
MRI¶
Acquisition artifacts specific to magnetic resonance: k-space corruption, ghosting along the phase-encode axis, and rigid motion.
Transform |
What it simulates |
Parameters |
Targets |
|---|---|---|---|
Simulate MRI phase-encoding ghosting. |
|
unchanged |
|
Zero a fraction of k-space lines to simulate acquisition errors. |
|
unchanged |
|
Simulate MRI in-plane rigid-body motion (blur + ghosting). |
|
unchanged |
CT¶
Polychromatic-beam and high-density-implant effects seen on computed tomography reconstructions.
Transform |
What it simulates |
Parameters |
Targets |
|---|---|---|---|
Simulate CT beam hardening (cupping) artifact. |
|
unchanged |
|
Simulate CT metal streak artifacts. |
|
unchanged |
X-ray (DXR)¶
Projection-radiography effects: Compton scatter and anti-scatter grid line artifacts.
Transform |
What it simulates |
Parameters |
Targets |
|---|---|---|---|
Simulate X-ray scatter (veiling glare) that lowers contrast. |
|
unchanged |
|
Simulate stationary anti-scatter grid lines. |
|
unchanged |
Tomosynthesis (DBT)¶
Limited-angle reconstruction effects. These act on the reconstructed volume with explicit slice-axis operations and per-axis voxel parameters.
Transform |
What it simulates |
Parameters |
Targets |
|---|---|---|---|
Shift the entire volume along the slice (Z) axis. |
|
warped |
|
Z-axis Gaussian blur scaled by the acquisition arc. |
|
unchanged |
|
Zero one or more slices along the Z axis. |
|
unchanged |
|
Elastic deformation with sensible DBT defaults. |
|
warped |
|
Simulate variation in breast-paddle compression for DBT. |
|
warped |
|
Simulate DBT out-of-plane reconstruction streaks. |
|
unchanged |
Ready-made pipelines¶
Each modality has a preset that composes a sensible starting point. They return
an ordinary Compose, so you can inspect, edit, serialise,
or use one as a template for your own.
from medaugmentx.presets import ct_pipeline
pipeline = ct_pipeline(seed=0)
print(pipeline)
See Presets, serialisation & inspection for what each preset contains.