data

Read test or example data.

dirname(p)

Returns the directory component of a pathname

fetch_viz_icons()

Download icons for fury

pjoin(path, \*paths)

read_viz_icons([style, fname])

Read specific icon from specific style.

Module: data.fetcher

Fetcher based on dipy.

check_md5(filename[, stored_md5])

Compute the md5 of filename.

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])

Downloads files to folder and checks their md5 checksums.

fetch_viz_icons()

Download icons for fury

md5()

Returns a md5 hash object; optionally initialized with a string

pjoin(path, \*paths)

read_viz_icons([style, fname])

Read specific icon from specific style.

update_progressbar(progress, total_length)

Show progressbar.

dirname

fury.data.dirname(p)[source]

Returns the directory component of a pathname

fetch_viz_icons

fury.data.fetch_viz_icons()

Download icons for fury

pjoin

fury.data.pjoin(path, *paths)

read_viz_icons

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

Read specific icon from specific style.

Parameters
stylestr

Current icon style. Default is icomoon.

fnamestr

Filename of icon. This should be found in folder HOME/.fury/style/. Default is infinity.png.

Returns
pathstr

Complete path of icon.

check_md5

fury.data.fetcher.check_md5(filename, stored_md5=None)[source]

Compute the md5 of filename.

check if it matches with the supplied string md5

Parameters
filenamestring

Path to a file.

md5string

Known md5 of filename to check against. If None (default), 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]

Downloads files to folder and checks their md5 checksums.

Parameters
filesdictionary

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

folderstr

The directory where to save the file, the directory will be created if it does not already exist.

data_sizestr, 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 md5 checksum of the file does not match the expected value. The downloaded file is not deleted when this error is raised.

fetch_viz_icons

fury.data.fetcher.fetch_viz_icons()

Download icons for fury

md5

fury.data.fetcher.md5()

Returns a md5 hash object; optionally initialized with a string

pjoin

fury.data.fetcher.pjoin(path, *paths)

read_viz_icons

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

Read specific icon from specific style.

Parameters
stylestr

Current icon style. Default is icomoon.

fnamestr

Filename of icon. This should be found in folder HOME/.fury/style/. Default is infinity.png.

Returns
pathstr

Complete path of icon.

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%.