Skip to main content

torchio_batch_operations

TorchIO Operations done at batch time defined here.

Classes

TorchIOImageTransformation

class TorchIOImageTransformation(    *,    name: str = None,    output: bool = False,    arg: Any,    step: DataSplit,    transformations: list[Union[str, dict[str, _JSONDict]]],):

Represents torchio image transformations done on a single column at batch time.

Arguments

  • arg: The argument to the transformation.
  • name: The name of the transformation. If not provided a unique name will be generated from the class name.
  • output: Whether or not this transformation should be included in the final output. Defaults to False.
  • step: Denotes whether transformations should be performed at training, validation or test time.
  • transformations: list of torchio transformations to be performed in order as one transformation.

Raises

  • TransformationRegistryError: If the transformation name is already in use.
  • TransformationRegistryError: If the transformation name hasn't been provided and the transformation is not registered.
  • ValueError: If the output is set to False.

Method generated by attrs for class TorchIOImageTransformation.

Variables

  • static transformations : list

Static methods


schema

def schema()> marshmallow.schema.Schema:

Inherited from:

BatchTimeOperation.schema :

Gets an instance of the Schema associated with this Transformation.

Raises

  • TypeError: If the transformation doesn't have a TransformationSchema as the schema.

Methods


get_callable

def get_callable(    self,)> bitfount.transformations.torchio_batch_operations._TorchIOAugmentation:

Returns callable which performs the transformations.

Returns The callable to perform transformations.