cellmap_data.transforms.targets.distance#

Functions

Classes

DistanceTransform([use_cuda, clip])

Initialize the distance transform.

SignedDistanceTransform([use_cuda, clip])

Initialize the signed distance transform.

cellmap_data.transforms.targets.distance.transform(x: Tensor) Tensor[source]#
Parameters:

x (Tensor)

Return type:

Tensor

class cellmap_data.transforms.targets.distance.DistanceTransform(use_cuda: bool = False, clip=[-inf, inf])[source]#

Initialize the distance transform.

Parameters:
  • use_cuda (bool, optional) – Use CUDA. Defaults to False.

  • clip (list, optional) – Clip the output to the specified range. Defaults to [-torch.inf, torch.inf].

Raises:

NotImplementedError – CUDA is not supported yet.

forward(x: Tensor) Tensor[source]#

Forward pass.

Parameters:

x (Tensor)

Return type:

Tensor

class cellmap_data.transforms.targets.distance.SignedDistanceTransform(use_cuda: bool = False, clip=[-inf, inf])[source]#

Initialize the signed distance transform.

Parameters:
  • use_cuda (bool, optional) – Use CUDA. Defaults to False.

  • clip (list, optional) – Clip the output to the specified range. Defaults to [-torch.inf, torch.inf].

Raises:

NotImplementedError – CUDA is not supported yet.

forward(x: Tensor) Tensor[source]#

Forward pass.

Parameters:

x (Tensor)

Return type:

Tensor