Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Wishlist: Multidimensional colormaps #4369

Copy link
Copy link
Closed
@ischwabacher

Description

@ischwabacher
Issue body actions

xref #3343

TL;DR: It would be nice if it were possible to have color maps for multidimensional data, instead of expecting the color to depend only on a single quantity as is currently the case.

I'm currently working on an application that would like to be able to modulate the color and opacity of an image independently (as in Figure 3.B.b of Allen et al. 2012) so that color indicates a parameter estimate and opacity indicates a statistic assessing the reliability of that estimate:

Allen et al. 2012, Fig. 3

Currently, this must be accomplished by applying a color map to the parameter estimate, then overwriting the alpha channel with the statistical map, and finally calling imshow with the computed RGBA data. (This is what @mwaskom is doing in the referenced issue.) This is a nuisance, and more importantly, it forces all interpolation to be done in RGBA space instead of in data space (xref #5490).

Rather than simply making it possible to control alpha independently of RGB, it would make sense to allow color maps that map multidimensional data to RGBA space. Then imshow's color map for 3-dimensional input can default to id ⊕ 1, and for 4-dimensional input to id, which gets rid of those special cases and makes it possible to have other color maps of those dimensionalities.

One could imagine other use cases for this in neuroimaging; for instance, diffusion tensor images are commonly displayed with hue depending on the principal eigenvector of a symmetric tensor field, while luminosity depends on the dispersion of the eigenvalues.

Diffusion Tensor image

In a completely different direction, one could display a complex-valued function by splitting the complex data into real and imaginary parts, and then applying a two-dimensional color map that sets hue based on the argument and luminosity based on the modulus of the input:

The Jacobi theta function

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.