Training
========

.. currentmodule:: torchio.data

Patch samplers
--------------

Samplers are used to randomly extract patches from volumes.
They are called with a sample generated by a
:class:`.SubjectsDataset` and return a Python generator that yields
cropped versions of the sample.

For more information about patch-based training, see
`this NiftyNet tutorial <https://niftynet.readthedocs.io/en/dev/window_sizes.html>`_.


.. autoclass:: UniformSampler

.. autoclass:: WeightedSampler

.. autoclass:: LabelSampler

.. autoclass:: PatchSampler

.. autoclass:: GridSampler
    :noindex:

Queue
-----

.. autoclass:: Queue
    :members:
