cortex.dataset.VertexRGB.color_voxels

static VertexRGB.color_voxels(channel1, channel2, channel3, channel1color, channel2color, channel3Color, value_max, saturation_max, vmin, vmax, autorange, alpha=None)

Colors voxels in 3 color dimensions but not necessarily canonical red, green, and blue Parameters ———- channel1 : ndarray or Volume or Vertex

voxel values for first channel

channel2ndarray or Volume or Vertex

voxel values for second channel

channel3ndarray or Volume or Vertex

voxel values for third channel

channel1colortuple<uint8, uint8, uint8>

color in RGB for first channel

channel2colortuple<uint8, uint8, uint8>

color in RGB for second channel

channel3Colortuple<uint8, uint8, uint8>

color in RGB for third channel

value_maxfloat, optional

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

saturation_maxfloat [0, 1]

Maximum HSV saturation for voxel colors.

vminfloat or tuple of float, optional

Lower bound(s) that map to 0 in each color channel. If a single float, the same lower bound is used for all three channels. If a tuple of three floats, each channel uses its respective value. If None, the lower bound is auto-determined based on autorange.

vmaxfloat or tuple of float, optional

Upper bound(s) that map to 255 in each color channel. If a single float, the same upper bound is used for all three channels. If a tuple of three floats, each channel uses its respective value. If None, the upper bound is auto-determined based on autorange.

autorange‘shared’ or ‘individual’

How to auto-determine bounds when vmin or vmax is None. ‘shared’ computes the 1st and 99th percentile across all three channels combined. ‘individual’ computes per-channel 1st and 99th percentiles. Overridden when vmin and vmax are both provided.

alphandarray or Volume or Vertex, optional

Alpha values for each voxel. If None, alpha is set to 1 for all voxels.

Returns:
redndarray of channel1.shape

uint8 array of red values

greenndarray of channel1.shape

uint8 array of green values

bluendarray of channel1.shape

uint8 array of blue values

alphandarray

If alpha=None, uint8 array of alpha values with alpha=1 for every voxel. Otherwise, the same alpha values that were passed in. Additionally, voxels with NaNs will have an alpha value of 0.