class_docstr: Displays a 3D Volume
  
  Parameters
  ----------
  vol : ndarray
      The volume to display. Must be ndim==3. Array is assumed to be stored
      as ``(z, y, x)``.
  clim : str | tuple
      Limits to use for the colormap. I.e. the values that map to black and white
      in a gray colormap. Can be 'auto' to auto-set bounds to
      the min and max of the data. If not given or None, 'auto' is used.
  method : {'mip', 'attenuated_mip', 'minip', 'translucent', 'additive',
      'iso', 'average'}
      The render method to use. See corresponding docs for details.
      Default 'mip'.
  threshold : float
      The threshold to use for the isosurface render method. By default
      the mean of the given volume is used.
  attenuation: float
      The attenuation rate to apply for the attenuated mip render method.
      Default: 1.0.
  relative_step_size : float
      The relative step size to step through the volume. Default 0.8.
      Increase to e.g. 1.5 to increase performance, at the cost of
      quality.
  cmap : str
      Colormap to use.
  gamma : float
      Gamma to use during colormap lookup.  Final color will be cmap(val**gamma).
      by default: 1.
  interpolation : str
      Selects method of texture interpolation. Makes use of the two hardware
      interpolation methods and the available interpolation methods defined
      in vispy/gloo/glsl/misc/spatial_filters.frag
  
          * 'nearest': Default, uses 'nearest' with Texture interpolation.
          * 'linear': uses 'linear' with Texture interpolation.
          * 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'cubic',
              'catrom', 'mitchell', 'spline16', 'spline36', 'gaussian',
              'bessel', 'sinc', 'lanczos', 'blackman'
  texture_format : numpy.dtype | str | None
      How to store data on the GPU. OpenGL allows for many different storage
      formats and schemes for the low-level texture data stored in the GPU.
      Most common is unsigned integers or floating point numbers.
      Unsigned integers are the most widely supported while other formats
      may not be supported on older versions of OpenGL or with older GPUs.
      Default value is ``None`` which means data will be scaled on the
      CPU and the result stored in the GPU as an unsigned integer. If a
      numpy dtype object, an internal texture format will be chosen to
      support that dtype and data will *not* be scaled on the CPU. Not all
      dtypes are supported. If a string, then
      it must be one of the OpenGL internalformat strings described in the
      table on this page: https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml
      The name should have `GL_` removed and be lowercase (ex.
      `GL_R32F` becomes ``'r32f'``). Lastly, this can also be the string
      ``'auto'`` which will use the data type of the provided volume data
      to determine the internalformat of the texture.
      When this is specified (not ``None``) data is scaled on the
      GPU which allows for faster color limit changes. Additionally, when
      32-bit float data is provided it won't be copied before being
      transferred to the GPU. Note this visual is limited to "luminance"
      formatted data (single band). This is equivalent to `GL_RED` format
      in OpenGL 4.0.
  raycasting_mode : {'volume', 'plane'}
      Whether to cast a ray through the whole volume or perpendicular to a
      plane through the volume defined.
  plane_position : ArrayLike
      A (3,) array containing a position on a plane of interest in the volume.
      The position is defined in data coordinates. Only relevant in
      raycasting_mode = 'plane'.
  plane_normal : ArrayLike
      A (3,) array containing a vector normal to the plane of interest in the
      volume. The normal vector is defined in data coordinates. Only relevant
      in raycasting_mode = 'plane'.
  plane_thickness : float
      A value defining the total length of the ray perpendicular to the
      plane interrogated during rendering. Defined in data coordinates.
      Only relevant in raycasting_mode = 'plane'.
  
  
  .. versionchanged: 0.7
  
      Deprecate 'emulate_texture' keyword argument.
class_docstr_tok: ["Displays","a","3D","Volume","Parameters","--","--","--","--","--","vol",":","ndarray","The","volume","to","display",".","Must","be","ndim==3",".","Array","is","assumed","to","be","stored","as","``","(","z",",","y",",","x",")","``",".","clim",":","str","|","tuple","Limits","to","use","for","the","colormap",".","I.e",".","the","values","that","map","to","black","and","white","in","a","gray","colormap",".","Can","be","'auto","'","to","auto-set","bounds","to","the","min","and","max","of","the","data",".","If","not","given","or","None",",","'auto","'","is","used",".","method",":","{","'mip","'",",","'attenuated_mip","'",",","'minip","'",",","'translucent","'",",","'additive","'",",","'iso","'",",","'average","'","}","The","render","method","to","use",".","See","corresponding","docs","for","details",".","Default","'mip","'",".","threshold",":","float","The","threshold","to","use","for","the","isosurface","render","method",".","By","default","the","mean","of","the","given","volume","is","used",".","attenuation",":","float","The","attenuation","rate","to","apply","for","the","attenuated","mip","render","method",".","Default",":","1.0.","relative_step_size",":","float","The","relative","step","size","to","step","through","the","volume",".","Default","0.8",".","Increase","to","e.g",".","1.5","to","increase","performance",",","at","the","cost","of","quality",".","cmap",":","str","Colormap","to","use",".","gamma",":","float","Gamma","to","use","during","colormap","lookup",".","Final","color","will","be","cmap","(","val","*","*","gamma",")",".","by","default",":","1.","interpolation",":","str","Selects","method","of","texture","interpolation",".","Makes","use","of","the","two","hardware","interpolation","methods","and","the","available","interpolation","methods","defined","in","vispy\/gloo\/glsl\/misc\/spatial_filters.frag","*","'nearest","'",":","Default",",","uses","'nearest","'","with","Texture","interpolation",".","*","'linear","'",":","uses","'linear","'","with","Texture","interpolation",".","*","'hanning","'",",","'hamming","'",",","'hermite","'",",","'kaiser","'",",","'quadric","'",",","'cubic","'",",","'catrom","'",",","'mitchell","'",",","'spline16","'",",","'spline36","'",",","'gaussian","'",",","'bessel","'",",","'sinc","'",",","'lanczos","'",",","'blackman'","texture_format",":","numpy.dtype","|","str","|","None","How","to","store","data","on","the","GPU",".","OpenGL","allows","for","many","different","storage","formats","and","schemes","for","the","low-level","texture","data","stored","in","the","GPU",".","Most","common","is","unsigned","integers","or","floating","point","numbers",".","Unsigned","integers","are","the","most","widely","supported","while","other","formats","may","not","be","supported","on","older","versions","of","OpenGL","or","with","older","GPUs",".","Default","value","is","``","None","``","which","means","data","will","be","scaled","on","the","CPU","and","the","result","stored","in","the","GPU","as","an","unsigned","integer",".","If","a","numpy","dtype","object",",","an","internal","texture","format","will","be","chosen","to","support","that","dtype","and","data","will","*","not","*","be","scaled","on","the","CPU",".","Not","all","dtypes","are","supported",".","If","a","string",",","then","it","must","be","one","of","the","OpenGL","internalformat","strings","described","in","the","table","on","this","page",":","https",":","\/\/www.khronos.org\/registry\/OpenGL-Refpages\/gl4\/html\/glTexImage2D.xhtml","The","name","should","have","`","GL_","`","removed","and","be","lowercase","(","ex",".","`","GL_R32F","`","becomes","``","'r32f","'","``",")",".","Lastly",",","this","can","also","be","the","string","``","'auto","'","``","which","will","use","the","data","type","of","the","provided","volume","data","to","determine","the","internalformat","of","the","texture",".","When","this","is","specified","(","not","``","None","``",")","data","is","scaled","on","the","GPU","which","allows","for","faster","color","limit","changes",".","Additionally",",","when","32-bit","float","data","is","provided","it","wo","n't","be","copied","before","being","transferred","to","the","GPU",".","Note","this","visual","is","limited","to","``","luminance","''","formatted","data","(","single","band",")",".","This","is","equivalent","to","`","GL_RED","`","format","in","OpenGL","4.0.","raycasting_mode",":","{","'volume","'",",","'plane","'","}","Whether","to","cast","a","ray","through","the","whole","volume","or","perpendicular","to","a","plane","through","the","volume","defined",".","plane_position",":","ArrayLike","A","(","3",",",")","array","containing","a","position","on","a","plane","of","interest","in","the","volume",".","The","position","is","defined","in","data","coordinates",".","Only","relevant","in","raycasting_mode","=","'plane","'",".","plane_normal",":","ArrayLike","A","(","3",",",")","array","containing","a","vector","normal","to","the","plane","of","interest","in","the","volume",".","The","normal","vector","is","defined","in","data","coordinates",".","Only","relevant","in","raycasting_mode","=","'plane","'",".","plane_thickness",":","float","A","value","defining","the","total","length","of","the","ray","perpendicular","to","the","plane","interrogated","during","rendering",".","Defined","in","data","coordinates",".","Only","relevant","in","raycasting_mode","=","'plane","'",".","..","versionchanged",":","0.7","Deprecate","'emulate_texture","'","keyword","argument","."]
code: def cmap(self):
      return self._cmap
  
imports: from __future__ import annotations
  from typing import Optional
  from functools import lru_cache
  import warnings
  from ._scalable_textures import CPUScaledTexture3D, GPUScaledTextured3D, Texture2D
  from ..gloo import VertexBuffer, IndexBuffer
  from .None import Visual
  from .shaders import Function
  from ..color import get_colormap
  from ..io import load_spatial_filters
  import numpy
label_desc: Use image node_id 11 for calling the VolumeVisual obj's underlying member method code with example usage: obj.cmap() and returns: self