fsl.data.vest

This module contains a handful of functions for working with VEST files.

looksLikeVestLutFile

Returns True if the given path looks like a VEST LUT file, False otherwise.

loadVestLutFile

Assumes that the given file is a VEST LUT file, and attempts to load it.

loadVestFile

Loads numeric data from a VEST file, returning it as a numpy array.

generateVest

Generates VEST-formatted text for the given numpy array.

fsl.data.vest.looksLikeVestLutFile(path)[source]

Returns True if the given path looks like a VEST LUT file, False otherwise.

fsl.data.vest.loadVestLutFile(path, normalise=True)[source]

Assumes that the given file is a VEST LUT file, and attempts to load it.

Returns a numpy.float32 array of shape (n, 3), where n is the number of colours in the file.

If normalise=True (the default), the colour values are normalised to the range 0-1.

fsl.data.vest.loadVestFile(path, ignoreHeader=True)[source]

Loads numeric data from a VEST file, returning it as a numpy array.

Parameters:

ignoreHeader – if True (the default), the matrix shape specified in the VEST header information is ignored, and the shape inferred from the data. Otherwise, if the number of rows/columns specified in the VEST header information does not match the matrix shape, a ValueError is raised.

Returns:

a numpy array containing the matrix data in the VEST file.

fsl.data.vest.generateVest(data)[source]

Generates VEST-formatted text for the given numpy array.

Parameters:

data – A 1D or 2D numpy array.

Returns:

A string containing a VEST header, and the data.