composer.datasets.brats#

BraTS (Brain Tumor Segmentation) dataset.

Please refer to the Brain Tumor Segmentation (BraTS) challenge for more details about this dataset.

Hparams

These classes are used with yahp for YAML-based configuration.

BratsDatasetHparams

Defines an instance of the BraTS dataset for image segmentation.

class composer.datasets.brats.BratsDatasetHparams(is_train=True, drop_last=True, shuffle=True, datadir=None, oversampling=0.33)[source]#

Bases: composer.datasets.hparams.DatasetHparams

Defines an instance of the BraTS dataset for image segmentation.

Parameters
  • datadir (str) โ€“ The path to the data directory.

  • is_train (bool) โ€“ Whether to load the training data or validation data. Default: True.

  • drop_last (bool) โ€“ If the number of samples is not divisible by the batch size, whether to drop the last batch or pad the last batch with zeros. Default: True.

  • shuffle (bool) โ€“ Whether to shuffle the dataset. Default: True.

  • oversampling (float) โ€“ The oversampling ratio to use. Default: 0.33.

initialize_object(batch_size, dataloader_hparams)[source]#

Creates a DataLoader or DataSpec for this dataset.

Parameters
  • batch_size (int) โ€“ The size of the batch the dataloader should yield. This batch size is device-specific and already incorporates the world size.

  • dataloader_hparams (DataLoaderHparams) โ€“ The dataset-independent hparams for the dataloader.

Returns

DataLoader or DataSpec โ€“ The DataLoader, or if the dataloader yields batches of custom types, a DataSpec.