# cortex.dataset.VolumeRGB¶

class cortex.dataset.VolumeRGB(channel1, channel2, channel3, subject=None, xfmname=None, alpha=None, description='', state=None, channel1color=255, 0, 0, channel2color=0, 255, 0, channel3color=0, 0, 255, max_color_value=None, max_color_saturation=1.0, shared_range=False, shared_vmin=None, shared_vmax=None, **kwargs)[source]

Contains RGB (or RGBA) colors for each voxel in a volumetric dataset. Includes information about the subject and transform for the data.

Three data channels are mapped into a 3D color set. By default the data channels are mapped on to red, green, and blue. They can also be mapped to be different colors as specified, and then linearly combined.

Each data channel is represented as a separate Volume object (these can either be supplied explicitly as Volume objects or implicitly as numpy arrays). The vmin for each Volume will be mapped to the minimum value for that data channel, and the vmax will be mapped to the maximum value. If shared_range is True, the vim and vmax will instead computed by combining all three data channels.

Parameters
channel1ndarray or Volume

Array or Volume for the first data channel for each voxel. Can be a 1D or 3D array (see Volume for details), or a Volume.

channel2ndarray or Volume

Array or Volume for the second data channel for each voxel. Can be a 1D or 3D array (see Volume for details), or a Volume.

channel3ndarray or Volume

Array or Volume for the third data channel for or each voxel. Can be a 1D or 3D array (see Volume for details), or a Volume.

subjectstr, optional

Subject identifier. Must exist in the pycortex database. If not given, red must be a Volume from which the subject can be extracted.

xfmnamestr, optional

Transform name. Must exist in the pycortex database. If not given, red must be a Volume from which the subject can be extracted.

alphandarray or Volume, optional

Array or Volume that represents the alpha component of the color for each voxel. Can be a 1D or 3D array (see Volume for details), or a Volume. If None, all voxels will be assumed to have alpha=1.0.

descriptionstr, optional

String describing this dataset. Displayed in webgl viewer.

stateoptional

TODO: describe what this is

channel1colortuple<uint8, uint8, uint8>

RGB color to use for the first data channel

channel2colortuple<uint8, uint8, uint8>

RGB color to use for the second data channel

channel3colortuple<uint8, uint8, uint8>

RGB color to use for the third data channel

max_color_valuefloat [0, 1], optional

Maximum HSV value for voxel colors. If not given, will be the value of the average of the three channel colors.

max_color_saturation: float [0, 1]

Maximum HSV saturation for voxel colors.

shared_rangebool

Use the same vmin and vmax for all three color channels?

shared_vminfloat, optional

Predetermined shared vmin. Does nothing if shared_range == False. If not given, will be the 1st percentil of all values across all three channels.

shared_vmaxfloat, optional

Predetermined shared vmax. Does nothing if shared_range == False. If not given, will be the 99th percentile of all values across all three channels

**kwargs

All additional arguments in kwargs are passed to the VolumeData and Dataview.

Methods

 __init__(channel1, channel2, channel3[, …]) Initialize self. color_voxels(channel1, channel2, channel3, …) Colors voxels in 3 color dimensions but not necessarily canonical red, green, and blue Parameters ———- channel1 : ndarray or Volume voxel values for first channel channel2 : ndarray or Volume voxel values for second channel channel3 : ndarray or Volume voxel values for third channel channel1color : tuple color in RGB for first channel channel2color : tuple color in RGB for second channel channel3Color : tuple color in RGB for third channel value_max : float, optional Maximum HSV value for voxel colors. copy(*args, **kwargs) from_hdf(node) to_json([simple]) uniques([collapse])

Attributes

 name priority raw volume 5-dimensional volume (t, z, y, x, rgba) with data that has been mapped into 8-bit unsigned integers that correspond to colors.