pycortex icon indicating copy to clipboard operation
pycortex copied to clipboard

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

Open mvdoc opened this issue 3 months ago • 0 comments

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.)

mvdoc avatar Sep 20 '25 00:09 mvdoc