VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkVolumeTextureMapper3D Class Reference

volume render with 3D texture mapping More...

#include <vtkVolumeTextureMapper3D.h>

Inheritance diagram for vtkVolumeTextureMapper3D:
Inheritance graph
[legend]
Collaboration diagram for vtkVolumeTextureMapper3D:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkVolumeMapper Superclass
enum  { FRAGMENT_PROGRAM_METHOD = 0, NVIDIA_METHOD = 1, ATI_METHOD = 2, NO_METHOD = 3 }

Public Member Functions

virtual int IsA (const char *type)
vtkVolumeTextureMapper3DNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
virtual void Render (vtkRenderer *, vtkVolume *)
virtual void SetSampleDistance (float)
virtual float GetSampleDistance ()
virtual intGetVolumeDimensions ()
virtual void GetVolumeDimensions (int data[3])
virtual floatGetVolumeSpacing ()
virtual void GetVolumeSpacing (float data[3])
virtual int IsRenderSupported (vtkVolumeProperty *, vtkRenderer *vtkNotUsed(r))
virtual int GetNumberOfPolygons ()
virtual float GetActualSampleDistance ()
int GetNumberOfScalarComponents (vtkImageData *input)
virtual void SetPreferredRenderMethod (int)
void SetPreferredMethodToFragmentProgram ()
void SetPreferredMethodToNVidia ()
virtual int GetPreferredRenderMethod ()
virtual void SetUseCompressedTexture (bool)
virtual bool GetUseCompressedTexture ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkVolumeTextureMapper3DSafeDownCast (vtkObjectBase *o)
static vtkVolumeTextureMapper3DNew ()

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkVolumeTextureMapper3D ()
 ~vtkVolumeTextureMapper3D ()
void ComputePolygons (vtkRenderer *ren, vtkVolume *vol, double bounds[6])
int UpdateVolumes (vtkVolume *)
int UpdateColorLookup (vtkVolume *)
virtual int IsTextureSizeSupported (int vtkNotUsed(size)[3], int vtkNotUsed(components))

Protected Attributes

floatPolygonBuffer
floatIntersectionBuffer
int NumberOfPolygons
int BufferSize
unsigned char * Volume1
unsigned char * Volume2
unsigned char * Volume3
int VolumeSize
int VolumeComponents
int VolumeDimensions [3]
float VolumeSpacing [3]
float SampleDistance
float ActualSampleDistance
vtkImageDataSavedTextureInput
vtkImageDataSavedParametersInput
vtkColorTransferFunctionSavedRGBFunction
vtkPiecewiseFunctionSavedGrayFunction
vtkPiecewiseFunctionSavedScalarOpacityFunction
vtkPiecewiseFunctionSavedGradientOpacityFunction
int SavedColorChannels
float SavedSampleDistance
float SavedScalarOpacityDistance
unsigned char ColorLookup [65536 *4]
unsigned char AlphaLookup [65536]
float TempArray1 [3 *4096]
float TempArray2 [4096]
int ColorTableSize
float ColorTableScale
float ColorTableOffset
unsigned char DiffuseLookup [65536 *4]
unsigned char SpecularLookup [65536 *4]
vtkTimeStamp SavedTextureMTime
vtkTimeStamp SavedParametersMTime
int RenderMethod
int PreferredRenderMethod
bool UseCompressedTexture
bool SupportsNonPowerOfTwoTextures

Detailed Description

volume render with 3D texture mapping

vtkVolumeTextureMapper3D renders a volume using 3D texture mapping. This class is actually an abstract superclass - with all the actual work done by vtkOpenGLVolumeTextureMapper3D.

This mappers currently supports:

This mapper does not support:

Internally, this mapper will potentially change the resolution of the input data. The data will be resampled to be a power of two in each direction, and also no greater than 128*256*256 voxels (any aspect) for one or two component data, or 128*128*256 voxels (any aspect) for four component data. The limits are currently hardcoded after a check using the GL_PROXY_TEXTURE3D because some graphics drivers were always responding "yes" to the proxy call despite not being able to allocate that much texture memory.

Currently, calculations are computed using 8 bits per RGBA channel. In the future this should be expanded to handle newer boards that can support 15 bit float compositing.

This mapper supports two main families of graphics hardware: nvidia and ATI. There are two different implementations of 3D texture mapping used - one based on nvidia's GL_NV_texture_shader2 and GL_NV_register_combiners2 extension, and one based on ATI's GL_ATI_fragment_shader (supported also by some nvidia boards) To use this class in an application that will run on various hardware configurations, you should have a back-up volume rendering method. You should create a vtkVolumeTextureMapper3D, assign its input, make sure you have a current OpenGL context (you've rendered at least once), then call IsRenderSupported with a vtkVolumeProperty as an argument. This method will return 0 if the input has more than one independent component, or if the graphics hardware does not support the set of required extensions for using at least one of the two implemented methods (nvidia or ati)

Thanks:
Thanks to Alexandre Gouaillard at the Megason Lab, Department of Systems Biology, Harvard Medical School https://wiki.med.harvard.edu/SysBio/Megason/ for the idea and initial patch to speed-up rendering with compressed textures.
See also:
vtkVolumeMapper
Examples:
vtkVolumeTextureMapper3D (Examples)
Tests:
vtkVolumeTextureMapper3D (Tests)

Definition at line 92 of file vtkVolumeTextureMapper3D.h.


Member Typedef Documentation

Reimplemented from vtkVolumeMapper.

Reimplemented in vtkOpenGLVolumeTextureMapper3D.

Definition at line 95 of file vtkVolumeTextureMapper3D.h.


Member Enumeration Documentation

anonymous enum

What rendering method is supported?

Enumerator:
FRAGMENT_PROGRAM_METHOD 
NVIDIA_METHOD 
ATI_METHOD 
NO_METHOD 

Definition at line 146 of file vtkVolumeTextureMapper3D.h.


Constructor & Destructor Documentation


Member Function Documentation

static int vtkVolumeTextureMapper3D::IsTypeOf ( const char *  name) [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkVolumeMapper.

Reimplemented in vtkOpenGLVolumeTextureMapper3D.

virtual int vtkVolumeTextureMapper3D::IsA ( const char *  name) [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkVolumeMapper.

Reimplemented in vtkOpenGLVolumeTextureMapper3D.

Reimplemented from vtkVolumeMapper.

Reimplemented in vtkOpenGLVolumeTextureMapper3D.

virtual vtkObjectBase* vtkVolumeTextureMapper3D::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkVolumeMapper.

Reimplemented in vtkOpenGLVolumeTextureMapper3D.

Reimplemented from vtkVolumeMapper.

Reimplemented in vtkOpenGLVolumeTextureMapper3D.

void vtkVolumeTextureMapper3D::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkVolumeMapper.

Reimplemented in vtkOpenGLVolumeTextureMapper3D.

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkAlgorithm.

Reimplemented in vtkOpenGLVolumeTextureMapper3D.

virtual void vtkVolumeTextureMapper3D::SetSampleDistance ( float  ) [virtual]

The distance at which to space sampling planes. This may not be honored for interactive renders. An interactive render is defined as one that has less than 1 second of allocated render time.

The distance at which to space sampling planes. This may not be honored for interactive renders. An interactive render is defined as one that has less than 1 second of allocated render time.

These are the dimensions of the 3D texture

virtual void vtkVolumeTextureMapper3D::GetVolumeDimensions ( int  data[3]) [virtual]

These are the dimensions of the 3D texture

This is the spacing of the 3D texture

virtual void vtkVolumeTextureMapper3D::GetVolumeSpacing ( float  data[3]) [virtual]

This is the spacing of the 3D texture

virtual int vtkVolumeTextureMapper3D::IsRenderSupported ( vtkVolumeProperty ,
vtkRenderer vtkNotUsed
) [inline, virtual]

Based on hardware and properties, we may or may not be able to render using 3D texture mapping. This indicates if 3D texture mapping is supported by the hardware, and if the other extensions necessary to support the specific properties are available.

Definition at line 123 of file vtkVolumeTextureMapper3D.h.

Allow access to the number of polygons used for the rendering.

Allow access to the actual sample distance used to render the image.

virtual void vtkVolumeTextureMapper3D::Render ( vtkRenderer ,
vtkVolume  
) [inline, virtual]

WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS Render the volume

Implements vtkVolumeMapper.

Reimplemented in vtkOpenGLVolumeTextureMapper3D.

Definition at line 142 of file vtkVolumeTextureMapper3D.h.

Returns the number of components of the point scalar field

Set the preferred render method. If it is supported, this one will be used. Don't allow ATI_METHOD - it is not actually supported.

Set the preferred render method. If it is supported, this one will be used. Don't allow ATI_METHOD - it is not actually supported.

Definition at line 167 of file vtkVolumeTextureMapper3D.h.

Set the preferred render method. If it is supported, this one will be used. Don't allow ATI_METHOD - it is not actually supported.

Definition at line 169 of file vtkVolumeTextureMapper3D.h.

Set the preferred render method. If it is supported, this one will be used. Don't allow ATI_METHOD - it is not actually supported.

virtual void vtkVolumeTextureMapper3D::SetUseCompressedTexture ( bool  ) [virtual]

Set/Get if the mapper use compressed textures (if supported by the hardware). Initial value is false. There are two reasons to use compressed textures: 1. rendering can be 4 times faster. 2. It saves some VRAM. There is one reason to not use compressed textures: quality may be lower than with uncompressed textures.

Set/Get if the mapper use compressed textures (if supported by the hardware). Initial value is false. There are two reasons to use compressed textures: 1. rendering can be 4 times faster. 2. It saves some VRAM. There is one reason to not use compressed textures: quality may be lower than with uncompressed textures.

void vtkVolumeTextureMapper3D::ComputePolygons ( vtkRenderer ren,
vtkVolume vol,
double  bounds[6] 
) [protected]

For the given viewing direction, compute the set of polygons.

Update the internal RGBA representation of the volume. Return 1 if anything change, 0 if nothing changed.

Update the internal RGBA representation of the volume. Return 1 if anything change, 0 if nothing changed.

virtual int vtkVolumeTextureMapper3D::IsTextureSizeSupported ( int   vtkNotUsed(size)[3],
int   vtkNotUsedcomponents 
) [inline, protected, virtual]

Impemented in subclass - check is texture size is OK. BTX

Definition at line 248 of file vtkVolumeTextureMapper3D.h.


Member Data Documentation

Definition at line 189 of file vtkVolumeTextureMapper3D.h.

Definition at line 190 of file vtkVolumeTextureMapper3D.h.

Definition at line 191 of file vtkVolumeTextureMapper3D.h.

Definition at line 192 of file vtkVolumeTextureMapper3D.h.

unsigned char* vtkVolumeTextureMapper3D::Volume1 [protected]

Definition at line 194 of file vtkVolumeTextureMapper3D.h.

unsigned char* vtkVolumeTextureMapper3D::Volume2 [protected]

Definition at line 195 of file vtkVolumeTextureMapper3D.h.

unsigned char* vtkVolumeTextureMapper3D::Volume3 [protected]

Definition at line 196 of file vtkVolumeTextureMapper3D.h.

Definition at line 197 of file vtkVolumeTextureMapper3D.h.

Definition at line 198 of file vtkVolumeTextureMapper3D.h.

Definition at line 199 of file vtkVolumeTextureMapper3D.h.

Definition at line 200 of file vtkVolumeTextureMapper3D.h.

Definition at line 202 of file vtkVolumeTextureMapper3D.h.

Definition at line 203 of file vtkVolumeTextureMapper3D.h.

Definition at line 205 of file vtkVolumeTextureMapper3D.h.

Definition at line 206 of file vtkVolumeTextureMapper3D.h.

Definition at line 208 of file vtkVolumeTextureMapper3D.h.

Definition at line 209 of file vtkVolumeTextureMapper3D.h.

Definition at line 210 of file vtkVolumeTextureMapper3D.h.

Definition at line 211 of file vtkVolumeTextureMapper3D.h.

Definition at line 212 of file vtkVolumeTextureMapper3D.h.

Definition at line 213 of file vtkVolumeTextureMapper3D.h.

Definition at line 214 of file vtkVolumeTextureMapper3D.h.

unsigned char vtkVolumeTextureMapper3D::ColorLookup[65536 *4] [protected]

Definition at line 216 of file vtkVolumeTextureMapper3D.h.

unsigned char vtkVolumeTextureMapper3D::AlphaLookup[65536] [protected]

Definition at line 217 of file vtkVolumeTextureMapper3D.h.

Definition at line 218 of file vtkVolumeTextureMapper3D.h.

Definition at line 219 of file vtkVolumeTextureMapper3D.h.

Definition at line 220 of file vtkVolumeTextureMapper3D.h.

Definition at line 221 of file vtkVolumeTextureMapper3D.h.

Definition at line 222 of file vtkVolumeTextureMapper3D.h.

unsigned char vtkVolumeTextureMapper3D::DiffuseLookup[65536 *4] [protected]

Definition at line 224 of file vtkVolumeTextureMapper3D.h.

unsigned char vtkVolumeTextureMapper3D::SpecularLookup[65536 *4] [protected]

Definition at line 225 of file vtkVolumeTextureMapper3D.h.

Definition at line 227 of file vtkVolumeTextureMapper3D.h.

Definition at line 228 of file vtkVolumeTextureMapper3D.h.

Definition at line 230 of file vtkVolumeTextureMapper3D.h.

Definition at line 231 of file vtkVolumeTextureMapper3D.h.

Definition at line 232 of file vtkVolumeTextureMapper3D.h.

Reimplemented in vtkOpenGLVolumeTextureMapper3D.

Definition at line 234 of file vtkVolumeTextureMapper3D.h.


The documentation for this class was generated from the following file: