vreg.fetch#

vreg.fetch(dataset=None, clear_cache=False, download_all=False) Volume3D[source]#

Fetch a dataset included in vreg.

The source data are on Zenodo

Parameters:
  • dataset (str, optional) – name of the dataset. See below for options.

  • clear_cache (bool, optional) – When a dataset is fetched, it is downloaded and then stored in a local cache memory for faster access next time it is fetched. Set clear_cache=True to delete all data in the cache memory. Default is False.

  • download_all (bool, optional) – By default only the dataset that is fetched is downloaded. Set download_all=True to download all datasets at once. This will cost some time but then offers fast and offline access to all datasets afterwards. This will take up around 300 MB of space on your hard drive. Default is False.

Returns:

Data as a vreg.Volume3D (for 3D scans) or a list of Volume3D objects (for 2D multislice scans).

Return type:

Volume3D or list

Example

Fetch the kidneys mask and the T1-map, and display as overlay:

>>> import vreg
>>> import vreg.plot as plt

Get the data:

>>> kidneys = vreg.fetch('kidneys')
>>> T1 = vreg.fetch('T1')

Plot as overlays:

>>> plt.overlay_2d(T1, kidneys)