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:

p

Probability of applying the transform at all, in [0, 1]. Default 1.0.

seed

Integer 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:

warped

Coordinates 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.

unchanged

The 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

RandomAffine

Random affine transform around the volume centre.

rotation, scale, translation, axes_enabled, order, mode, cval, space, translation_units, scale_axes

warped

RandomFlip

Flip the volume along selected axes, each with probability p_per_axis.

axes, p_per_axis, label_map, keypoint_label_map, bbox_label_map, label_axis

warped

AnatomicCrop

Random crop biased toward foreground (non-zero) anatomy.

size, foreground_prob, foreground_threshold

warped

ClassBalancedCrop

Extract a fixed-size training patch, optionally anchored on a mask class.

size, foreground_prob, labels, cval

warped

ElasticDeform

Elastic deformation via Gaussian-smoothed random displacements.

alpha, sigma, order, mode, cval, units, max_gradient, min_jacobian, max_displacement, bbox_mode

warped

CoarseDropout

Zero out a random number of rectangular (2D) or box (3D) regions.

num_holes, hole_size, fill_value, fill_mask

unchanged

Resize

Resample the volume to a fixed size (one entry per spatial axis).

size, order, antialias, clip_output

warped

ResampleToSpacing

Resample to a requested voxel spacing in millimetres along the grid axes.

spacing, order, antialias, clip_output, max_voxels

warped

ResampleToGrid

Resample already registered data onto an explicit patient-space grid.

shape, affine, order, cval, max_voxels

warped

Pad

Pad the volume (centred) up to size along each axis.

size, mode, cval

warped

CenterCrop

Crop the centred region of size along each axis.

size

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

RicianNoise

Rician magnitude noise under a single-complex-signal model.

std, clip

unchanged

GaussianNoise

Additive zero-mean Gaussian noise.

std, relative, clip

unchanged

GammaCorrection

Power-law (gamma) intensity transformation.

gamma, invert

unchanged

BiasField

Smooth multiplicative bias field simulating MRI intensity non-uniformity.

alpha, coarse_shape, order

unchanged

WindowLevel

Random window-level augmentation — simulates CT viewer protocol variation.

center_shift_frac, width_scale, rescale_output

unchanged

BrightnessContrast

Additive brightness shift + multiplicative contrast factor.

brightness, contrast, clip

unchanged

GaussianBlur

Isotropic Gaussian blur applied to the image.

sigma, order, mode, units

unchanged

MedianBlur

Median filter — edge-preserving smoothing, strong against salt-and-pepper.

ksize, mode

unchanged

SimulateLowResolution

Simulate a lower-resolution acquisition by down- then upsampling.

zoom_range, order_down, order_up, per_axis, antialias, clip_output

unchanged

Sharpen

Sharpen the image with an unsharp mask.

alpha, sigma, clip

unchanged

CLAHEContrast

Contrast Limited Adaptive Histogram Equalization.

clip_limit, grid, n_bins

unchanged

HistogramMatch

Match the image intensity histogram to a reference distribution.

reference, blend, n_quantiles, reference_quantiles

unchanged

NormalizeIntensity

Clip to chosen percentiles and map the image into [0, 1].

percentiles

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

GhostingArtifact

Simulate MRI phase-encoding ghosting.

ghost_intensity, ghost_shift, phase_encode_axis, num_ghosts

unchanged

KSpaceDropout

Zero a fraction of k-space lines to simulate acquisition errors.

dropout_fraction, phase_encode_axis

unchanged

MRIMotion

Simulate MRI in-plane rigid-body motion (blur + ghosting).

degrees, translation, num_movements

unchanged

CT

Polychromatic-beam and high-density-implant effects seen on computed tomography reconstructions.

Transform

What it simulates

Parameters

Targets

BeamHardening

Simulate CT beam hardening (cupping) artifact.

alpha, power

unchanged

MetalStreak

Simulate CT metal streak artifacts.

intensity, num_streaks, num_sources, falloff

unchanged

X-ray (DXR)

Projection-radiography effects: Compton scatter and anti-scatter grid line artifacts.

Transform

What it simulates

Parameters

Targets

ScatterSimulation

Simulate X-ray scatter (veiling glare) that lowers contrast.

fraction, sigma

unchanged

GridArtifact

Simulate stationary anti-scatter grid lines.

amplitude, frequency, axis

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

SlabShift

Shift the entire volume along the slice (Z) axis.

max_shift, cval

warped

LimitedAngleBlur

Z-axis Gaussian blur scaled by the acquisition arc.

arc_degrees, base_sigma, reference_arc_deg

unchanged

SliceDropout

Zero one or more slices along the Z axis.

num_slices, cval, affect_mask

unchanged

AnisotropicElastic

Elastic deformation with sensible DBT defaults.

alpha, sigma, order, units, max_gradient, min_jacobian, max_displacement, bbox_mode

warped

CompressionVariation

Simulate variation in breast-paddle compression for DBT.

scale, axis, order

warped

ReconStreak

Simulate DBT out-of-plane reconstruction streaks.

amplitude, num_planes, displacement, decay, axis

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.