API Documentation

All modules above listed are under the “medicaltorch” namespace.

Contents:

medicaltorch.datasets – Datasets

medicaltorch.transforms – Transformations

medicaltorch.metrics – Metrics

medicaltorch.metrics.numeric_score(prediction, groundtruth)[source]

Computation of statistical numerical scores:

  • FP = False Positives
  • FN = False Negatives
  • TP = True Positives
  • TN = True Negatives

return: tuple (FP, FN, TP, TN)

medicaltorch.models – Models

class medicaltorch.models.NoPoolASPP(drop_rate=0.4, bn_momentum=0.1, base_num_filters=64)[source]
_images/nopool_aspp_arch.png

An ASPP-based model without initial pooling layers.

Parameters:
  • drop_rate – dropout rate.
  • bn_momentum – batch normalization momentum.

See also

Perone, C. S., et al (2017). Spinal cord gray matter segmentation using deep dilated convolutions. Nature Scientific Reports link: https://www.nature.com/articles/s41598-018-24304-3

forward(x)[source]

Model forward pass.

Parameters:x – input data.
class medicaltorch.models.Unet(drop_rate=0.4, bn_momentum=0.1)[source]

A reference U-Net model.

See also

Ronneberger, O., et al (2015). U-Net: Convolutional Networks for Biomedical Image Segmentation ArXiv link: https://arxiv.org/abs/1505.04597

medicaltorch.losses – Losses

class medicaltorch.losses.MaskedDiceLoss(ignore_value=-100.0)[source]

A masked version of the Dice loss.

Parameters:ignore_value – the value to ignore.
medicaltorch.losses.dice_loss(input, target)[source]

Dice loss.

Parameters:
  • input – The input (predicted)
  • target – The target (ground truth)
Returns:

the Dice score between 0 and 1.