data

Read or fetch test or example data.

dirname(p)

Returns the directory component of a pathname

fetch_viz_cubemaps()

Download cube map textures for fury

fetch_viz_dmri()

fetch_viz_icons()

Download icons for fury

fetch_viz_models()

Download the models for shader tutorial

fetch_viz_textures()

Download textures for fury

fetch_viz_wiki_nw()

Download the following wiki informationInterdisciplinary map of the journals

pjoin(a, *p)

Join two or more pathname components, inserting '/' as needed.

read_viz_cubemap(name[, suffix_type, ext])

Read specific cube map with specific suffix type and extension.

read_viz_dmri(fname)

Read specific dMRI image.

read_viz_icons([style, fname])

Read specific icon from specific style.

read_viz_models(fname)

Read specific model.

read_viz_textures(fname)

Read specific texture.

Module: data.fetcher

Fetcher based on dipy.

check_sha(filename[, stored_sha256])

Check the generated sha checksum.

copyfileobj(fsrc, fdst[, length])

copy data from file-like object fsrc to file-like object fdst

copyfileobj_withprogress(fsrc, fdst, ...[, ...])

fetch_data(files, folder[, data_size])

Download files to folder and checks their sha checksums.

fetch_viz_cubemaps()

Download cube map textures for fury

fetch_viz_dmri()

fetch_viz_icons()

Download icons for fury

fetch_viz_models()

Download the models for shader tutorial

fetch_viz_textures()

Download textures for fury

fetch_viz_wiki_nw()

Download the following wiki informationInterdisciplinary map of the journals

pjoin(a, *p)

Join two or more pathname components, inserting '/' as needed.

read_viz_cubemap(name[, suffix_type, ext])

Read specific cube map with specific suffix type and extension.

read_viz_dmri(fname)

Read specific dMRI image.

read_viz_icons([style, fname])

Read specific icon from specific style.

read_viz_models(fname)

Read specific model.

read_viz_textures(fname)

Read specific texture.

sha256

Returns a sha256 hash object; optionally initialized with a string

update_progressbar(progress, total_length)

Show progressbar.

dirname

fury.data.dirname(p)[source]

Returns the directory component of a pathname

fetch_viz_cubemaps

fury.data.fetch_viz_cubemaps()

Download cube map textures for fury

fetch_viz_dmri

fury.data.fetch_viz_dmri()

fetch_viz_icons

fury.data.fetch_viz_icons()

Download icons for fury

fetch_viz_models

fury.data.fetch_viz_models()

Download the models for shader tutorial

fetch_viz_textures

fury.data.fetch_viz_textures()

Download textures for fury

fetch_viz_wiki_nw

fury.data.fetch_viz_wiki_nw()

Download the following wiki informationInterdisciplinary map of the journals

pjoin

fury.data.pjoin(a, *p)

Join two or more pathname components, inserting ‘/’ as needed. If any component is an absolute path, all previous path components will be discarded. An empty last part will result in a path that ends with a separator.

read_viz_cubemap

fury.data.read_viz_cubemap(name, suffix_type=1, ext='.jpg')[source]

Read specific cube map with specific suffix type and extension.

Parameters
  • name (str) –

  • suffix_type (int, optional) – 0 for numeric suffix (e.g., skybox_0.jpg, skybox_1.jpg, etc.), 1 for -p/nC encoding where C is either x, y or z (e.g., skybox-px.jpeg, skybox-ny.jpeg, etc.), 2 for pos/negC where C is either x, y, z (e.g., skybox_posx.png, skybox_negy.png, etc.), and 3 for position in the cube map (e.g., skybox_right.jpg, skybox_front.jpg, etc).

  • ext (str, optional) – Image type extension. (.jpg, .jpeg, .png, etc.).

Returns

list of paths – List with the complete paths of the skybox textures.

Return type

list

read_viz_dmri

fury.data.read_viz_dmri(fname)[source]

Read specific dMRI image.

Parameters

fname (str) – Filename of the texture. This should be found in folder HOME/.fury/dmri/.

Returns

path – Complete path of dMRI image.

Return type

str

read_viz_icons

fury.data.read_viz_icons(style='icomoon', fname='infinity.png')[source]

Read specific icon from specific style.

Parameters
  • style (str) – Current icon style. Default is icomoon.

  • fname (str) – Filename of icon. This should be found in folder HOME/.fury/style/. Default is infinity.png.

Returns

path – Complete path of icon.

Return type

str

read_viz_models

fury.data.read_viz_models(fname)[source]

Read specific model.

Parameters

fname (str) – Filename of the model. This should be found in folder HOME/.fury/models/.

Returns

path – Complete path of models.

Return type

str

read_viz_textures

fury.data.read_viz_textures(fname)[source]

Read specific texture.

Parameters

fname (str) – Filename of the texture. This should be found in folder HOME/.fury/textures/.

Returns

path – Complete path of textures.

Return type

str

check_sha

fury.data.fetcher.check_sha(filename, stored_sha256=None)[source]

Check the generated sha checksum.

Parameters
  • filename (str) – The path to the file whose checksum is to be compared

  • stored_sha256 (str, optional) – Used to verify the generated SHA checksum. Default: None, checking is skipped

copyfileobj

fury.data.fetcher.copyfileobj(fsrc, fdst, length=16384)[source]

copy data from file-like object fsrc to file-like object fdst

copyfileobj_withprogress

fury.data.fetcher.copyfileobj_withprogress(fsrc, fdst, total_length, length=16384)[source]

fetch_data

fury.data.fetcher.fetch_data(files, folder, data_size=None)[source]

Download files to folder and checks their sha checksums.

Parameters
  • files (dictionary) – For each file in files the value should be (url, sha). The file will be downloaded from url if the file does not already exist or if the file exists but the sha checksum does not match.

  • folder (str) – The directory where to save the file, the directory will be created if it does not already exist.

  • data_size (str, optional) – A string describing the size of the data (e.g. “91 MB”) to be logged to the screen. Default does not produce any information about data size.

Raises

FetcherError – Raises if the sha checksum of the file does not match the expected value. The downloaded file is not deleted when this error is raised.

fetch_viz_cubemaps

fury.data.fetcher.fetch_viz_cubemaps()

Download cube map textures for fury

fetch_viz_dmri

fury.data.fetcher.fetch_viz_dmri()

fetch_viz_icons

fury.data.fetcher.fetch_viz_icons()

Download icons for fury

fetch_viz_models

fury.data.fetcher.fetch_viz_models()

Download the models for shader tutorial

fetch_viz_textures

fury.data.fetcher.fetch_viz_textures()

Download textures for fury

fetch_viz_wiki_nw

fury.data.fetcher.fetch_viz_wiki_nw()

Download the following wiki informationInterdisciplinary map of the journals

pjoin

fury.data.fetcher.pjoin(a, *p)

Join two or more pathname components, inserting ‘/’ as needed. If any component is an absolute path, all previous path components will be discarded. An empty last part will result in a path that ends with a separator.

read_viz_cubemap

fury.data.fetcher.read_viz_cubemap(name, suffix_type=1, ext='.jpg')[source]

Read specific cube map with specific suffix type and extension.

Parameters
  • name (str) –

  • suffix_type (int, optional) – 0 for numeric suffix (e.g., skybox_0.jpg, skybox_1.jpg, etc.), 1 for -p/nC encoding where C is either x, y or z (e.g., skybox-px.jpeg, skybox-ny.jpeg, etc.), 2 for pos/negC where C is either x, y, z (e.g., skybox_posx.png, skybox_negy.png, etc.), and 3 for position in the cube map (e.g., skybox_right.jpg, skybox_front.jpg, etc).

  • ext (str, optional) – Image type extension. (.jpg, .jpeg, .png, etc.).

Returns

list of paths – List with the complete paths of the skybox textures.

Return type

list

read_viz_dmri

fury.data.fetcher.read_viz_dmri(fname)[source]

Read specific dMRI image.

Parameters

fname (str) – Filename of the texture. This should be found in folder HOME/.fury/dmri/.

Returns

path – Complete path of dMRI image.

Return type

str

read_viz_icons

fury.data.fetcher.read_viz_icons(style='icomoon', fname='infinity.png')[source]

Read specific icon from specific style.

Parameters
  • style (str) – Current icon style. Default is icomoon.

  • fname (str) – Filename of icon. This should be found in folder HOME/.fury/style/. Default is infinity.png.

Returns

path – Complete path of icon.

Return type

str

read_viz_models

fury.data.fetcher.read_viz_models(fname)[source]

Read specific model.

Parameters

fname (str) – Filename of the model. This should be found in folder HOME/.fury/models/.

Returns

path – Complete path of models.

Return type

str

read_viz_textures

fury.data.fetcher.read_viz_textures(fname)[source]

Read specific texture.

Parameters

fname (str) – Filename of the texture. This should be found in folder HOME/.fury/textures/.

Returns

path – Complete path of textures.

Return type

str

sha256

fury.data.fetcher.sha256()

Returns a sha256 hash object; optionally initialized with a string

update_progressbar

fury.data.fetcher.update_progressbar(progress, total_length)[source]

Show progressbar.

Takes a number between 0 and 1 to indicate progress from 0 to 100%.