bio_volumentations.core package

bio_volumentations.core.composition module

class bio_volumentations.core.composition.Compose(transforms, p=1.0, targets=(['image'], ['mask'], ['float_mask']), conversion=None)[source]

Bases: object

Compose a list of transforms into a callable transformation pipeline.

In addition, basic input image checks and conversions are performed. Optionally, datatype conversion (e.g. from numpy.ndarray to torch.Tensor) is performed.

Parameters:
  • transforms (List[Transform]) – a list of transforms.

  • p (float, optional) – chance of applying the whole pipeline. Defaults to 1.

  • targets (Tuple[List[str]] | List[List[str]], optional) – a list of targets. Defaults to ([‘image’], [‘mask’], [‘float_mask’]).

  • conversion (Transform | None, optional) – image datatype conversion transform, applied after the transformations. Defaults to None.

get_always_apply_transforms()[source]

bio_volumentations.core.transforms_interface module

class bio_volumentations.core.transforms_interface.DualTransform(always_apply=False, p=0.5)[source]

Bases: Transform

The base class of transforms applied to all target types.

apply_to_float_mask(float_mask, **params)[source]
apply_to_mask(mask, **params)[source]
class bio_volumentations.core.transforms_interface.ImageOnlyTransform(always_apply=False, p=0.5)[source]

Bases: Transform

The base class of transforms applied to the image target only.

property targets
class bio_volumentations.core.transforms_interface.Transform(always_apply=False, p=0.5)[source]

Bases: object

The base class.

apply(volume, **params)[source]
get_params(**data)[source]