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

Ray casting performed on the GPU. More...

#include <vtkGPUVolumeRayCastMapper.h>

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

List of all members.

Public Types

enum  { BinaryMaskType = 0, LabelMapMaskType }
typedef vtkVolumeMapper Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkGPUVolumeRayCastMapperNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
void CreateCanonicalView (vtkRenderer *ren, vtkVolume *volume, vtkImageData *image, int blend_mode, double viewDirection[3], double viewUp[3])
void Render (vtkRenderer *, vtkVolume *)
virtual void GPURender (vtkRenderer *, vtkVolume *)
void ReleaseGraphicsResources (vtkWindow *)
virtual void GetReductionRatio (double ratio[3])=0
virtual void SetAutoAdjustSampleDistances (int)
virtual int GetAutoAdjustSampleDistances ()
virtual void AutoAdjustSampleDistancesOn ()
virtual void AutoAdjustSampleDistancesOff ()
virtual void SetSampleDistance (float)
virtual float GetSampleDistance ()
virtual void SetImageSampleDistance (float)
virtual float GetImageSampleDistance ()
virtual void SetMinimumImageSampleDistance (float)
virtual float GetMinimumImageSampleDistance ()
virtual void SetMaximumImageSampleDistance (float)
virtual float GetMaximumImageSampleDistance ()
virtual void SetFinalColorWindow (float)
virtual float GetFinalColorWindow ()
virtual void SetFinalColorLevel (float)
virtual float GetFinalColorLevel ()
virtual void SetMaxMemoryInBytes (vtkIdType)
virtual vtkIdType GetMaxMemoryInBytes ()
virtual void SetMaxMemoryFraction (float)
virtual float GetMaxMemoryFraction ()
virtual void SetReportProgress (bool)
virtual bool GetReportProgress ()
virtual int IsRenderSupported (vtkRenderWindow *vtkNotUsed(window), vtkVolumeProperty *vtkNotUsed(property))
void SetMaskInput (vtkImageData *mask)
virtual vtkImageDataGetMaskInput ()
virtual void SetMaskType (int)
virtual int GetMaskType ()
void SetMaskTypeToBinary ()
void SetMaskTypeToLabelMap ()
virtual void SetMaskBlendFactor (float)
virtual float GetMaskBlendFactor ()

Static Public Member Functions

static vtkGPUVolumeRayCastMapperNew ()
static int IsTypeOf (const char *type)
static vtkGPUVolumeRayCastMapperSafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkGPUVolumeRayCastMapper ()
 ~vtkGPUVolumeRayCastMapper ()
int ValidateRender (vtkRenderer *, vtkVolume *)
void CanonicalViewRender (vtkRenderer *, vtkVolume *)
virtual void PreRender (vtkRenderer *ren, vtkVolume *vol, double datasetBounds[6], double scalarRange[2], int numberOfScalarComponents, unsigned int numberOfLevels)=0
virtual void RenderBlock (vtkRenderer *ren, vtkVolume *vol, unsigned int level)=0
virtual void PostRender (vtkRenderer *ren, int numberOfScalarComponents)=0
void SetCellFlag (int cellFlag)
virtual void ClipCroppingRegionPlanes ()
virtual vtkImageDataGetTransformedInput ()
void SetTransformedInput (vtkImageData *)
virtual void SetAMRMode (int)
virtual int GetAMRMode ()
virtual void AMRModeOn ()
virtual void AMRModeOff ()

Protected Attributes

float SampleDistance
float ImageSampleDistance
float MinimumImageSampleDistance
float MaximumImageSampleDistance
int AutoAdjustSampleDistances
int SmallVolumeRender
double BigTimeToDraw
double SmallTimeToDraw
float FinalColorWindow
float FinalColorLevel
vtkIdType MaxMemoryInBytes
float MaxMemoryFraction
int GeneratingCanonicalView
vtkImageDataCanonicalViewImageData
int AMRMode
int CellFlag
double ClippedCroppingRegionPlanes [6]
bool ReportProgress
vtkImageDataMaskInput
float MaskBlendFactor
int MaskType
vtkImageDataTransformedInput
vtkImageDataLastInput

Detailed Description

Ray casting performed on the GPU.

vtkGPUVolumeRayCastMapper is a volume mapper that performs ray casting on the GPU using fragment programs.

Events:
vtkCommand::VolumeMapperRenderEndEvent vtkCommand::VolumeMapperRenderStartEvent
Tests:
vtkGPUVolumeRayCastMapper (Tests)

Definition at line 40 of file vtkGPUVolumeRayCastMapper.h.


Member Typedef Documentation

Reimplemented from vtkVolumeMapper.

Reimplemented in vtkOpenGLGPUVolumeRayCastMapper.

Definition at line 44 of file vtkGPUVolumeRayCastMapper.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
BinaryMaskType 
LabelMapMaskType 

Definition at line 166 of file vtkGPUVolumeRayCastMapper.h.


Constructor & Destructor Documentation


Member Function Documentation

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

Reimplemented from vtkAlgorithm.

Reimplemented in vtkOpenGLGPUVolumeRayCastMapper.

static int vtkGPUVolumeRayCastMapper::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 vtkOpenGLGPUVolumeRayCastMapper.

virtual int vtkGPUVolumeRayCastMapper::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 vtkOpenGLGPUVolumeRayCastMapper.

Reimplemented from vtkVolumeMapper.

Reimplemented in vtkOpenGLGPUVolumeRayCastMapper.

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

Reimplemented from vtkVolumeMapper.

Reimplemented in vtkOpenGLGPUVolumeRayCastMapper.

Reimplemented from vtkVolumeMapper.

Reimplemented in vtkOpenGLGPUVolumeRayCastMapper.

void vtkGPUVolumeRayCastMapper::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 vtkOpenGLGPUVolumeRayCastMapper.

If AutoAdjustSampleDistances is on, the the ImageSampleDistance will be varied to achieve the allocated render time of this prop (controlled by the desired update rate and any culling in use).

If AutoAdjustSampleDistances is on, the the ImageSampleDistance will be varied to achieve the allocated render time of this prop (controlled by the desired update rate and any culling in use).

If AutoAdjustSampleDistances is on, the the ImageSampleDistance will be varied to achieve the allocated render time of this prop (controlled by the desired update rate and any culling in use).

If AutoAdjustSampleDistances is on, the the ImageSampleDistance will be varied to achieve the allocated render time of this prop (controlled by the desired update rate and any culling in use).

Set/Get the distance between samples used for rendering when AutoAdjustSampleDistances is off, or when this mapper has more than 1 second allocated to it for rendering. Initial value is 1.0.

Set/Get the distance between samples used for rendering when AutoAdjustSampleDistances is off, or when this mapper has more than 1 second allocated to it for rendering. Initial value is 1.0.

Sampling distance in the XY image dimensions. Default value of 1 meaning 1 ray cast per pixel. If set to 0.5, 4 rays will be cast per pixel. If set to 2.0, 1 ray will be cast for every 4 (2 by 2) pixels. This value will be adjusted to meet a desired frame rate when AutoAdjustSampleDistances is on.

Sampling distance in the XY image dimensions. Default value of 1 meaning 1 ray cast per pixel. If set to 0.5, 4 rays will be cast per pixel. If set to 2.0, 1 ray will be cast for every 4 (2 by 2) pixels. This value will be adjusted to meet a desired frame rate when AutoAdjustSampleDistances is on.

This is the minimum image sample distance allow when the image sample distance is being automatically adjusted.

This is the minimum image sample distance allow when the image sample distance is being automatically adjusted.

This is the maximum image sample distance allow when the image sample distance is being automatically adjusted.

This is the maximum image sample distance allow when the image sample distance is being automatically adjusted.

Set/Get the window / level applied to the final color. This allows brightness / contrast adjustments on the final image. window is the width of the window. level is the center of the window. Initial window value is 1.0 Initial level value is 0.5 window cannot be null but can be negative, this way values will be reversed. |window| can be larger than 1.0 level can be any real value.

Set/Get the window / level applied to the final color. This allows brightness / contrast adjustments on the final image. window is the width of the window. level is the center of the window. Initial window value is 1.0 Initial level value is 0.5 window cannot be null but can be negative, this way values will be reversed. |window| can be larger than 1.0 level can be any real value.

Set/Get the window / level applied to the final color. This allows brightness / contrast adjustments on the final image. window is the width of the window. level is the center of the window. Initial window value is 1.0 Initial level value is 0.5 window cannot be null but can be negative, this way values will be reversed. |window| can be larger than 1.0 level can be any real value.

Set/Get the window / level applied to the final color. This allows brightness / contrast adjustments on the final image. window is the width of the window. level is the center of the window. Initial window value is 1.0 Initial level value is 0.5 window cannot be null but can be negative, this way values will be reversed. |window| can be larger than 1.0 level can be any real value.

Maximum size of the 3D texture in GPU memory. Will default to the size computed from the graphics card. Can be adjusted by the user.

Maximum size of the 3D texture in GPU memory. Will default to the size computed from the graphics card. Can be adjusted by the user.

Maximum fraction of the MaxMemoryInBytes that should be used to hold the texture. Valid values are 0.1 to 1.0.

Maximum fraction of the MaxMemoryInBytes that should be used to hold the texture. Valid values are 0.1 to 1.0.

virtual void vtkGPUVolumeRayCastMapper::SetReportProgress ( bool  ) [virtual]

Tells if the mapper will report intermediate progress. Initial value is true. As the progress works with a GL blocking call (glFinish()), this can be useful for huge dataset but can slow down rendering of small dataset. It should be set to true for big dataset or complex shading and streaming but to false for small datasets.

Tells if the mapper will report intermediate progress. Initial value is true. As the progress works with a GL blocking call (glFinish()), this can be useful for huge dataset but can slow down rendering of small dataset. It should be set to true for big dataset or complex shading and streaming but to false for small datasets.

virtual int vtkGPUVolumeRayCastMapper::IsRenderSupported ( vtkRenderWindow vtkNotUsedwindow,
vtkVolumeProperty vtkNotUsedproperty 
) [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 131 of file vtkGPUVolumeRayCastMapper.h.

void vtkGPUVolumeRayCastMapper::CreateCanonicalView ( vtkRenderer ren,
vtkVolume volume,
vtkImageData image,
int  blend_mode,
double  viewDirection[3],
double  viewUp[3] 
)

Optionally, set a mask input. This mask may be a binary mask or a label map. This must be specified via SetMaskType. If the mask is a binary mask, the volume rendering is confined to regions within the binary mask. The binary mask is assumed to have a datatype of UCHAR and values of 255 (inside) and 0 (outside). The mask may also be a label map. The label map is allowed to contain only 3 labels (values of 0, 1 and 2) and must have a datatype of UCHAR. In voxels with label value of 0, the color transfer function supplied by component 0 is used. In voxels with label value of 1, the color transfer function supplied by component 1 is used and blended with the transfer function supplied by component 0, with the blending weight being determined by MaskBlendFactor. In voxels with a label value of 2, the color transfer function supplied by component 2 is used and blended with the transfer function supplied by component 0, with the blending weight being determined by MaskBlendFactor.

Optionally, set a mask input. This mask may be a binary mask or a label map. This must be specified via SetMaskType. If the mask is a binary mask, the volume rendering is confined to regions within the binary mask. The binary mask is assumed to have a datatype of UCHAR and values of 255 (inside) and 0 (outside). The mask may also be a label map. The label map is allowed to contain only 3 labels (values of 0, 1 and 2) and must have a datatype of UCHAR. In voxels with label value of 0, the color transfer function supplied by component 0 is used. In voxels with label value of 1, the color transfer function supplied by component 1 is used and blended with the transfer function supplied by component 0, with the blending weight being determined by MaskBlendFactor. In voxels with a label value of 2, the color transfer function supplied by component 2 is used and blended with the transfer function supplied by component 0, with the blending weight being determined by MaskBlendFactor.

virtual void vtkGPUVolumeRayCastMapper::SetMaskType ( int  ) [virtual]

Set the mask type, if mask is to be used. See documentation for SetMaskInput(). The default is a LabelMapMaskType.

Set the mask type, if mask is to be used. See documentation for SetMaskInput(). The default is a LabelMapMaskType.

Set the mask type, if mask is to be used. See documentation for SetMaskInput(). The default is a LabelMapMaskType.

Set the mask type, if mask is to be used. See documentation for SetMaskInput(). The default is a LabelMapMaskType.

Tells how much mask color transfer function is used compared to the standard color transfer function when the mask is true. This is relevant only for the label map mask. 0.0 means only standard color transfer function. 1.0 means only mask color transfer function. The default value is 1.0.

Tells how much mask color transfer function is used compared to the standard color transfer function when the mask is true. This is relevant only for the label map mask. 0.0 means only standard color transfer function. 1.0 means only mask color transfer function. The default value is 1.0.

void vtkGPUVolumeRayCastMapper::Render ( vtkRenderer ,
vtkVolume  
) [virtual]

WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Initialize rendering for this volume.

Implements vtkVolumeMapper.

virtual void vtkGPUVolumeRayCastMapper::GPURender ( vtkRenderer ,
vtkVolume  
) [inline, virtual]

Handled in the subclass - the actual render method

Precondition:
input is up-to-date.

Reimplemented in vtkOpenGLGPUVolumeRayCastMapper.

Definition at line 195 of file vtkGPUVolumeRayCastMapper.h.

WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being consumed by this mapper. The parameter window could be used to determine which graphic resources to release.

Reimplemented from vtkVolumeMapper.

Reimplemented in vtkOpenGLGPUVolumeRayCastMapper.

Definition at line 201 of file vtkGPUVolumeRayCastMapper.h.

virtual void vtkGPUVolumeRayCastMapper::GetReductionRatio ( double  ratio[3]) [pure virtual]

Return how much the dataset has to be reduced in each dimension to fit on the GPU. If the value is 1.0, there is no need to reduce the dataset.

Precondition:
the calling thread has a current OpenGL context.
mapper_supported: IsRenderSupported(renderer->GetRenderWindow(),0) The computation is based on hardware limits (3D texture indexable size) and MaxMemoryInBytes.
Postcondition:
valid_i_ratio: ratio[0]>0 && ratio[0]<=1.0
valid_j_ratio: ratio[1]>0 && ratio[1]<=1.0
valid_k_ratio: ratio[2]>0 && ratio[2]<=1.0

Implemented in vtkOpenGLGPUVolumeRayCastMapper.

virtual void vtkGPUVolumeRayCastMapper::PreRender ( vtkRenderer ren,
vtkVolume vol,
double  datasetBounds[6],
double  scalarRange[2],
int  numberOfScalarComponents,
unsigned int  numberOfLevels 
) [protected, pure virtual]
virtual void vtkGPUVolumeRayCastMapper::RenderBlock ( vtkRenderer ren,
vtkVolume vol,
unsigned int  level 
) [protected, pure virtual]
virtual void vtkGPUVolumeRayCastMapper::PostRender ( vtkRenderer ren,
int  numberOfScalarComponents 
) [protected, pure virtual]
void vtkGPUVolumeRayCastMapper::SetCellFlag ( int  cellFlag) [protected]

Called by the AMR Volume Mapper. Set the flag that tells if the scalars are on point data (0) or cell data (1).

virtual void vtkGPUVolumeRayCastMapper::SetAMRMode ( int  ) [protected, virtual]

Set the mapper in AMR Mode or not. Initial value is false. Called only by the vtkKWAMRVolumeMapper

virtual int vtkGPUVolumeRayCastMapper::GetAMRMode ( ) [protected, virtual]

Set the mapper in AMR Mode or not. Initial value is false. Called only by the vtkKWAMRVolumeMapper

virtual void vtkGPUVolumeRayCastMapper::AMRModeOn ( ) [protected, virtual]

Set the mapper in AMR Mode or not. Initial value is false. Called only by the vtkKWAMRVolumeMapper

virtual void vtkGPUVolumeRayCastMapper::AMRModeOff ( ) [protected, virtual]

Set the mapper in AMR Mode or not. Initial value is false. Called only by the vtkKWAMRVolumeMapper

virtual void vtkGPUVolumeRayCastMapper::ClipCroppingRegionPlanes ( ) [protected, virtual]

Compute the cropping planes clipped by the bounds of the volume. The result is put into this->ClippedCroppingRegionPlanes. NOTE: IT WILL BE MOVED UP TO vtkVolumeMapper after bullet proof usage in this mapper. Other subclasses will use the ClippedCroppingRegionsPlanes members instead of CroppingRegionPlanes.

Precondition:
volume_exists: this->GetInput()!=0
valid_cropping: this->Cropping && this->CroppingRegionPlanes[0]<this->CroppingRegionPlanes[1] && this->CroppingRegionPlanes[2]<this->CroppingRegionPlanes[3] && this->CroppingRegionPlanes[4]<this->CroppingRegionPlanes[5])

Member Data Documentation

Definition at line 248 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 251 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 252 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 253 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 254 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 256 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 257 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 258 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 260 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 261 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 263 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 264 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 268 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 269 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 276 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 280 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 293 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 294 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 295 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 296 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 297 of file vtkGPUVolumeRayCastMapper.h.

Definition at line 298 of file vtkGPUVolumeRayCastMapper.h.

This is needed only to check if the input data has been changed since the last Render() call.

Definition at line 305 of file vtkGPUVolumeRayCastMapper.h.


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