Skip to content

VolumeRGB and VertexRGB don't have the same signature and functionality (e.g., shared_range, custom colors, etc.) #579

@mvdoc

Description

@mvdoc

The main issue is:

  • VolumeRGB accepts shared_vmin, shared_vmax, shared_range to ensure that the same vmin, vmax are used across the three channels
  • VertexRGB does not accept any of those keyword arguments. But calling VertexRGB(..., shared_vmin=0, shared_vmax=1, shared_range=True) succeeds.

I spent way too much time debugging RGB maps on fsaverage only to realize that VertexRGB does not have a shared_range kwarg. But because we pass **kwargs to most pycortex objects, VertexRGB did not blow up (as it should do when an unsupported keyword argument is passed).

The safest option is still to pass uint8 values to either VolumeRGB or VertexRGB rather than using float and relying on vmin/vmax.

BUT we should uniform the signature of both {Volume,Vertex}RGB to avoid this issue.

(And perhaps avoid passing **kwargs in general unless we explicitly raise ValueErrors if a keyword is not supported.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions