/usr/include/vtk-7.1/vtkVolumeMapper.h is in libvtk7-dev 7.1.1+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkVolumeMapper.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkVolumeMapper
* @brief Abstract class for a volume mapper
*
*
* vtkVolumeMapper is the abstract definition of a volume mapper for regular
* rectilinear data (vtkImageData). Several basic types of volume mappers
* are supported.
*
* @sa
* vtkVolumeRayCastMapper vtkVolumeTextureMapper2D
*/
#ifndef vtkVolumeMapper_h
#define vtkVolumeMapper_h
#include "vtkRenderingVolumeModule.h" // For export macro
#include "vtkAbstractVolumeMapper.h"
class vtkRenderer;
class vtkVolume;
class vtkImageData;
#define VTK_CROP_SUBVOLUME 0x0002000
#define VTK_CROP_FENCE 0x2ebfeba
#define VTK_CROP_INVERTED_FENCE 0x5140145
#define VTK_CROP_CROSS 0x0417410
#define VTK_CROP_INVERTED_CROSS 0x7be8bef
class vtkWindow;
class VTKRENDERINGVOLUME_EXPORT vtkVolumeMapper : public vtkAbstractVolumeMapper
{
public:
vtkTypeMacro(vtkVolumeMapper,vtkAbstractVolumeMapper);
void PrintSelf( ostream& os, vtkIndent indent );
//@{
/**
* Set/Get the input data
*/
virtual void SetInputData( vtkImageData * );
virtual void SetInputData( vtkDataSet * );
vtkImageData *GetInput();
//@}
//@{
/**
* Set/Get the blend mode.
* The default mode is Composite where the scalar values are sampled through
* the volume and composited in a front-to-back scheme through alpha blending.
* The final color and opacity is determined using the color and opacity
* transfer functions.
*
* Maximum and minimum intensity blend modes use the maximum and minimum
* scalar values, respectively, along the sampling ray. The final color and
* opacity is determined by passing the resultant value through the color and
* opacity transfer functions.
*
* Additive blend mode accumulates scalar values by passing each value through
* the opacity transfer function and then adding up the product of the value
* and its opacity. In other words, the scalar values are scaled using the
* opacity transfer function and summed to derive the final color. Note that
* the resulting image is always grayscale i.e. aggregated values are not
* passed through the color transfer function. This is because the final
* value is a derived value and not a real data value along the sampling ray.
*
* Average intensity blend mode works similar to the additive blend mode where
* the scalar values are multiplied by opacity calculated from the opacity
* transfer function and then added. The additional step here is to
* divide the sum by the number of samples taken through the volume.
* One can control the scalar range by setting the AverageIPScalarRange ivar
* to disregard scalar values, not in the range of interest, from the average
* computation.
* As is the case with the additive intensity projection, the final
* image will always be grayscale i.e. the aggregated values are not
* passed through the color transfer function. This is because the
* resultant value is a derived value and not a real data value along
* the sampling ray.
*
* \note vtkVolumeMapper::AVERAGE_INTENSITY_BLEND is only supported by the
* vtkGPUVolumeRayCastMapper with the OpenGL2 backend.
* \sa SetAverageIPScalarRange()
*/
vtkSetMacro( BlendMode, int );
void SetBlendModeToComposite()
{ this->SetBlendMode( vtkVolumeMapper::COMPOSITE_BLEND ); }
void SetBlendModeToMaximumIntensity()
{ this->SetBlendMode( vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND ); }
void SetBlendModeToMinimumIntensity()
{ this->SetBlendMode( vtkVolumeMapper::MINIMUM_INTENSITY_BLEND ); }
void SetBlendModeToAverageIntensity()
{ this->SetBlendMode( vtkVolumeMapper::AVERAGE_INTENSITY_BLEND ); }
void SetBlendModeToAdditive()
{ this->SetBlendMode( vtkVolumeMapper::ADDITIVE_BLEND ); }
vtkGetMacro( BlendMode, int );
//@}
//@{
/**
* Set/Get the scalar range to be considered for average intensity projection
* blend mode. Only scalar values between this range will be averaged during
* ray casting. This can be useful when volume rendering CT datasets where the
* areas occupied by air would deviate the final rendering. By default, the
* range is set to (VTK_DOUBLE_MIN, VTK_DOUBLE_MAX).
* \sa SetBlendModeToAverageIntensity()
*/
vtkSetVector2Macro(AverageIPScalarRange, double);
vtkGetVectorMacro(AverageIPScalarRange, double, 2);
//@}
//@{
/**
* Turn On/Off orthogonal cropping. (Clipping planes are
* perpendicular to the coordinate axes.)
*/
vtkSetClampMacro(Cropping,int,0,1);
vtkGetMacro(Cropping,int);
vtkBooleanMacro(Cropping,int);
//@}
//@{
/**
* Set/Get the Cropping Region Planes ( xmin, xmax, ymin, ymax, zmin, zmax )
* These planes are defined in volume coordinates - spacing and origin are
* considered.
*/
vtkSetVector6Macro( CroppingRegionPlanes, double );
vtkGetVectorMacro( CroppingRegionPlanes, double, 6 );
//@}
//@{
/**
* Get the cropping region planes in voxels. Only valid during the
* rendering process
*/
vtkGetVectorMacro( VoxelCroppingRegionPlanes, double, 6 );
//@}
//@{
/**
* Set the flags for the cropping regions. The clipping planes divide the
* volume into 27 regions - there is one bit for each region. The regions
* start from the one containing voxel (0,0,0), moving along the x axis
* fastest, the y axis next, and the z axis slowest. These are represented
* from the lowest bit to bit number 27 in the integer containing the
* flags. There are several convenience functions to set some common
* configurations - subvolume (the default), fence (between any of the
* clip plane pairs), inverted fence, cross (between any two of the
* clip plane pairs) and inverted cross.
*/
vtkSetClampMacro( CroppingRegionFlags, int, 0x0, 0x7ffffff );
vtkGetMacro( CroppingRegionFlags, int );
void SetCroppingRegionFlagsToSubVolume()
{this->SetCroppingRegionFlags( VTK_CROP_SUBVOLUME );};
void SetCroppingRegionFlagsToFence()
{this->SetCroppingRegionFlags( VTK_CROP_FENCE );};
void SetCroppingRegionFlagsToInvertedFence()
{this->SetCroppingRegionFlags( VTK_CROP_INVERTED_FENCE );};
void SetCroppingRegionFlagsToCross()
{this->SetCroppingRegionFlags( VTK_CROP_CROSS );};
void SetCroppingRegionFlagsToInvertedCross()
{this->SetCroppingRegionFlags( VTK_CROP_INVERTED_CROSS );};
//@}
/**
* WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE
* DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS
* Render the volume
*/
virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0;
/**
* 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.
*/
virtual void ReleaseGraphicsResources(vtkWindow *) {}
/**
* Blend modes.
* The default mode is Composite where the scalar values are sampled through
* the volume and composited in a front-to-back scheme through alpha blending.
* The final color and opacity is determined using the color and opacity
* transfer functions.
*
* Maximum and minimum intensity blend modes use the maximum and minimum
* scalar values, respectively, along the sampling ray. The final color and
* opacity is determined by passing the resultant value through the color and
* opacity transfer functions.
*
* Additive blend mode accumulates scalar values by passing each value through
* the opacity transfer function and then adding up the product of the value
* and its opacity. In other words, the scalar values are scaled using the
* opacity transfer function and summed to derive the final color. Note that
* the resulting image is always grayscale i.e. aggregated values are not
* passed through the color transfer function. This is because the final
* value is a derived value and not a real data value along the sampling ray.
*
* Average intensity blend mode works similar to the additive blend mode where
* the scalar values are multiplied by opacity calculated from the opacity
* transfer function and then added. The additional step here is to
* divide the sum by the number of samples taken through the volume.
* As is the case with the additive intensity projection, the final
* image will always be grayscale i.e. the aggregated values are not
* passed through the color transfer function. This is because the
* resultant value is a derived value and not a real data value along
* the sampling ray.
*
* \note vtkVolumeMapper::AVERAGE_INTENSITY_BLEND is only supported by the
* vtkGPUVolumeRayCastMapper with the OpenGL2 backend.
*/
enum BlendModes
{
COMPOSITE_BLEND,
MAXIMUM_INTENSITY_BLEND,
MINIMUM_INTENSITY_BLEND,
AVERAGE_INTENSITY_BLEND,
ADDITIVE_BLEND
};
protected:
vtkVolumeMapper();
~vtkVolumeMapper();
/**
* Compute a sample distance from the data spacing. When the number of
* voxels is 8, the sample distance will be roughly 1/200 the average voxel
* size. The distance will grow proportionally to numVoxels^(1/3).
*/
double SpacingAdjustedSampleDistance(double inputSpacing[3],
int inputExtent[6]);
int BlendMode;
/**
* Threshold range for average intensity projection
*/
double AverageIPScalarRange[2];
//@{
/**
* Cropping variables, and a method for converting the world
* coordinate cropping region planes to voxel coordinates
*/
int Cropping;
double CroppingRegionPlanes[6];
double VoxelCroppingRegionPlanes[6];
int CroppingRegionFlags;
void ConvertCroppingRegionPlanesToVoxels();
//@}
virtual int FillInputPortInformation(int, vtkInformation*);
private:
vtkVolumeMapper(const vtkVolumeMapper&) VTK_DELETE_FUNCTION;
void operator=(const vtkVolumeMapper&) VTK_DELETE_FUNCTION;
};
#endif
|