 |
VTK
9.1.0
|
Go to the documentation of this file.
114 #ifndef vtkFixedPointVolumeRayCastMapper_h
115 #define vtkFixedPointVolumeRayCastMapper_h
117 #include "vtkRenderingVolumeModule.h"
118 #include "vtkThreads.h"
121 #define VTKKW_FP_SHIFT 15
122 #define VTKKW_FPMM_SHIFT 17
123 #define VTKKW_FP_MASK 0x7fff
124 #define VTKKW_FP_SCALE 32767.0
166 vtkSetMacro(SampleDistance,
float);
167 vtkGetMacro(SampleDistance,
float);
178 vtkSetMacro(InteractiveSampleDistance,
float);
179 vtkGetMacro(InteractiveSampleDistance,
float);
190 vtkSetClampMacro(ImageSampleDistance,
float, 0.1f, 100.0f);
191 vtkGetMacro(ImageSampleDistance,
float);
199 vtkSetClampMacro(MinimumImageSampleDistance,
float, 0.1f, 100.0f);
200 vtkGetMacro(MinimumImageSampleDistance,
float);
208 vtkSetClampMacro(MaximumImageSampleDistance,
float, 0.1f, 100.0f);
209 vtkGetMacro(MaximumImageSampleDistance,
float);
236 vtkSetClampMacro(LockSampleDistanceToInputSpacing,
vtkTypeBool, 0, 1);
256 vtkSetClampMacro(IntermixIntersectingGeometry,
vtkTypeBool, 0, 1);
279 unsigned int ToFixedPointPosition(
float val);
280 void ToFixedPointPosition(
float in[3],
unsigned int out[3]);
281 unsigned int ToFixedPointDirection(
float dir);
282 void ToFixedPointDirection(
float in[3],
unsigned int out[3]);
283 void FixedPointIncrement(
unsigned int position[3],
unsigned int increment[3]);
284 void GetFloatTripleFromPointer(
float v[3],
float* ptr);
285 void GetUIntTripleFromPointer(
unsigned int v[3],
unsigned int* ptr);
286 void ShiftVectorDown(
unsigned int in[3],
unsigned int out[3]);
287 int CheckMinMaxVolumeFlag(
unsigned int pos[3],
int c);
288 int CheckMIPMinMaxVolumeFlag(
unsigned int pos[3],
int c,
unsigned short maxIdx,
int flip);
290 void LookupColorUC(
unsigned short* colorTable,
unsigned short* scalarOpacityTable,
291 unsigned short index,
unsigned char color[4]);
292 void LookupDependentColorUC(
unsigned short* colorTable,
unsigned short* scalarOpacityTable,
293 unsigned short index[4],
int components,
unsigned char color[4]);
294 void LookupAndCombineIndependentColorsUC(
unsigned short* colorTable[4],
295 unsigned short* scalarOpacityTable[4],
unsigned short index[4],
float weights[4],
296 int components,
unsigned char color[4]);
297 int CheckIfCropped(
unsigned int pos[3]);
305 vtkGetVectorMacro(TableShift,
float, 4);
306 vtkGetVectorMacro(TableScale,
float, 4);
307 vtkGetMacro(ShadingRequired,
int);
308 vtkGetMacro(GradientOpacityRequired,
int);
324 int x,
int y,
unsigned int pos[3],
unsigned int dir[3],
unsigned int* numSteps);
348 double viewDirection[3],
double viewUp[3]);
358 return this->RetrieveRenderTime(ren, vol);
376 vtkSetMacro(FinalColorWindow,
float);
377 vtkGetMacro(FinalColorWindow,
float);
378 vtkSetMacro(FinalColorLevel,
float);
379 vtkGetMacro(FinalColorLevel,
float);
385 vtkGetMacro(FlipMIPComparison,
int);
419 void ComputeMatrices(
double inputOrigin[3],
double inputSpacing[3],
int inputExtent[6],
468 int SavedColorChannels[4];
469 float SavedScalarOpacityDistance[4];
479 unsigned short ColorTable[4][32768 * 3];
480 unsigned short ScalarOpacityTable[4][32768];
481 unsigned short GradientOpacityTable[4][256];
486 float GradientMagnitudeScale[4];
487 float GradientMagnitudeShift[4];
502 unsigned short DiffuseShadingTable[4][65536 * 3];
503 unsigned short SpecularShadingTable[4][65536 * 3];
515 double rayStart[3],
double rayEnd[3],
float rayDirection[3],
double bounds[6]);
525 double rayStart[3],
double rayEnd[3],
int numClippingPlanes,
float* clippingPlanes);
527 unsigned int FixedPointCroppingRegionPlanes[6];
528 unsigned int CroppingRegionMask[27];
542 float ViewToVoxelsArray[16];
543 float WorldToVoxelsArray[16];
544 float VoxelsToWorldArray[16];
546 double CroppingBounds[6];
551 double SavedSpacing[3];
555 int MinMaxVolumeSize[4];
596 float in[3],
unsigned int out[3])
598 out[0] = ((in[0] < 0.0) ? (
static_cast<unsigned int>(-in[0] *
VTKKW_FP_SCALE + 0.5))
599 : (0x80000000 +
static_cast<unsigned int>(in[0] *
VTKKW_FP_SCALE + 0.5)));
600 out[1] = ((in[1] < 0.0) ? (
static_cast<unsigned int>(-in[1] *
VTKKW_FP_SCALE + 0.5))
601 : (0x80000000 +
static_cast<unsigned int>(in[1] *
VTKKW_FP_SCALE + 0.5)));
602 out[2] = ((in[2] < 0.0) ? (
static_cast<unsigned int>(-in[2] *
VTKKW_FP_SCALE + 0.5))
603 : (0x80000000 +
static_cast<unsigned int>(in[2] *
VTKKW_FP_SCALE + 0.5)));
607 unsigned int position[3],
unsigned int increment[3])
609 if (increment[0] & 0x80000000)
611 position[0] += (increment[0] & 0x7fffffff);
617 if (increment[1] & 0x80000000)
619 position[1] += (increment[1] & 0x7fffffff);
625 if (increment[2] & 0x80000000)
627 position[2] += (increment[2] & 0x7fffffff);
643 unsigned int v[3],
unsigned int* ptr)
651 unsigned int in[3],
unsigned int out[3])
662 mmpos[1] *
static_cast<vtkIdType>(this->MinMaxVolumeSize[0]) + mmpos[0]) +
665 return ((*(this->
MinMaxVolume + 3 * offset + 2)) & 0x00ff);
669 unsigned int mmpos[3],
int c,
unsigned short maxIdx,
int flip)
673 mmpos[1] *
static_cast<vtkIdType>(this->MinMaxVolumeSize[0]) + mmpos[0]) +
684 return (*(this->
MinMaxVolume + 3 * offset + 1) > maxIdx);
694 unsigned short* scalarOpacityTable,
unsigned short index,
unsigned char color[4])
696 unsigned short alpha = scalarOpacityTable[
index];
697 color[0] =
static_cast<unsigned char>(
699 color[1] =
static_cast<unsigned char>(
701 color[2] =
static_cast<unsigned char>(
707 unsigned short* scalarOpacityTable,
unsigned short index[4],
int components,
708 unsigned char color[4])
710 unsigned short alpha;
715 color[0] =
static_cast<unsigned char>(
717 color[1] =
static_cast<unsigned char>(
719 color[2] =
static_cast<unsigned char>(
734 unsigned short* colorTable[4],
unsigned short* scalarOpacityTable[4],
unsigned short index[4],
735 float weights[4],
int components,
unsigned char color[4])
737 unsigned int tmp[4] = { 0, 0, 0, 0 };
739 for (
int i = 0; i < components; i++)
741 unsigned short alpha =
742 static_cast<unsigned short>(
static_cast<float>(scalarOpacityTable[i][
index[i]]) * weights[i]);
743 tmp[0] +=
static_cast<unsigned char>(
745 tmp[1] +=
static_cast<unsigned char>(
747 tmp[2] +=
static_cast<unsigned char>(
752 color[0] =
static_cast<unsigned char>((tmp[0] > 255) ? (255) : (tmp[0]));
753 color[1] =
static_cast<unsigned char>((tmp[1] > 255) ? (255) : (tmp[1]));
754 color[2] =
static_cast<unsigned char>((tmp[2] > 255) ? (255) : (tmp[2]));
755 color[3] =
static_cast<unsigned char>((tmp[3] > 255) ? (255) : (tmp[3]));
unsigned short * GetSpecularShadingTable(int c)
unsigned short * ContiguousGradientNormal
vtkRenderer ** RenderRendererTable
unsigned char ** GetGradientMagnitude()
Abstract class for a volume mapper.
unsigned short ** GetGradientNormal()
vtkMultiThreader * Threader
represents a volume (data & properties) in a rendered scene
int UpdateGradients(vtkVolume *vol)
vtkImageData * SavedMinMaxInput
helper class for a ray cast image
helper class that draws the image to the screen
vtkFixedPointVolumeRayCastMIPHelper * MIPHelper
int ClipRayAgainstVolume(double rayStart[3], double rayEnd[3], float rayDirection[3], double bounds[6])
vtkTypeBool AutoAdjustSampleDistances
A fixed point mapper for volumes.
unsigned short * GetGradientOpacityTable(int c)
VTK_THREAD_RETURN_TYPE FixedPointVolumeRayCastMapper_CastRays(void *arg)
void SetNumberOfThreads(int num)
Set/Get the number of threads to use.
int UpdateShadingTable(vtkRenderer *ren, vtkVolume *vol)
float ComputeRequiredImageSampleDistance(float desiredTime, vtkRenderer *ren, vtkVolume *vol)
What is the image sample distance required to achieve the desired time? A version of this method is p...
record modification and/or execution time
int GradientOpacityRequired
vtkVolume ** RenderVolumeTable
vtkFixedPointRayCastImage * RayCastImage
void ComputeRayInfo(int x, int y, unsigned int pos[3], unsigned int dir[3], unsigned int *numSteps)
void ApplyFinalColorWindowLevel()
unsigned short * GetDiffuseShadingTable(int c)
void ShiftVectorDown(unsigned int in[3], unsigned int out[3])
A helper that generates MIP images for the volume ray cast mapper.
void LookupAndCombineIndependentColorsUC(unsigned short *colorTable[4], unsigned short *scalarOpacityTable[4], unsigned short index[4], float weights[4], int components, unsigned char color[4])
unsigned int FixedPointCroppingRegionPlanes[6]
vtkFixedPointVolumeRayCastCompositeShadeHelper * CompositeShadeHelper
float MinimumImageSampleDistance
void FixedPointIncrement(unsigned int position[3], unsigned int increment[3])
Use finite differences to estimate gradient.
float ImageSampleDistance
abstract superclass for arrays of numeric data
vtkMatrix4x4 * ViewToWorldMatrix
void CaptureZBuffer(vtkRenderer *ren)
void UpdateMinMaxVolume(vtkVolume *vol)
float * TransformedClippingPlanes
Defines a transfer function for mapping a property to an RGB color value.
vtkImageData * SavedGradientsInput
A helper that generates composite images for the volume ray cast mapper.
float OldImageSampleDistance
float RetrieveRenderTime(vtkRenderer *ren)
void ComputeMatrices(double inputOrigin[3], double inputSpacing[3], int inputExtent[6], vtkRenderer *ren, vtkVolume *vol)
vtkDirectionEncoder * DirectionEncoder
float MaximumImageSampleDistance
window superclass for vtkRenderWindow
int NumberOfGradientSlices
vtkMatrix4x4 * VoxelsToViewMatrix
vtkMatrix4x4 * PerspectiveMatrix
vtkImageData * SavedParametersInput
void UpdateCroppingRegions()
int UpdateColorTable(vtkVolume *vol)
int NumTransformedClippingPlanes
void GetFloatTripleFromPointer(float v[3], float *ptr)
vtkMatrix4x4 * VoxelsToWorldMatrix
A class for performing multithreaded execution.
vtkMatrix4x4 * ViewToVoxelsMatrix
void PerVolumeInitialization(vtkRenderer *, vtkVolume *)
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkFixedPointVolumeRayCastMapper()
unsigned int CroppingRegionMask[27]
Compute shading tables for encoded normals.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
float InteractiveSampleDistance
unsigned int ToFixedPointDirection(float dir)
vtkImageData * MinMaxVolumeCache
vtkMatrix4x4 * WorldToVoxelsMatrix
int CheckMIPMinMaxVolumeFlag(unsigned int pos[3], int c, unsigned short maxIdx, int flip)
vtkTypeBool IntermixIntersectingGeometry
void PerSubVolumeInitialization(vtkRenderer *, vtkVolume *, int)
topologically and geometrically regular array of data
a simple class to control print indentation
represent and manipulate 4x4 transformation matrices
float ComputeRequiredImageSampleDistance(float desiredTime, vtkRenderer *ren)
What is the image sample distance required to achieve the desired time? A version of this method is p...
Builds the space leaping data structure.
int CheckMinMaxVolumeFlag(unsigned int pos[3], int c)
vtkTransform * VoxelsTransform
friend VTK_THREAD_RETURN_TYPE vtkFPVRCMSwitchOnDataType(void *arg)
int GetNumberOfThreads()
Set/Get the number of threads to use.
int PerImageInitialization(vtkRenderer *, vtkVolume *, int, double *, double *, int *)
vtkTimeStamp SavedGradientsMTime
~vtkFixedPointVolumeRayCastMapper() override
float RetrieveRenderTime(vtkRenderer *ren, vtkVolume *vol)
vtkEncodedGradientShader * GradientShader
vtkRenderWindow * RenderWindow
unsigned char * ContiguousGradientMagnitude
void DisplayRenderedImage(vtkRenderer *, vtkVolume *)
vtkTransform * VoxelsToViewTransform
vtkFixedPointVolumeRayCastCompositeGOHelper * CompositeGOHelper
unsigned short * GetScalarOpacityTable(int c)
void LookupColorUC(unsigned short *colorTable, unsigned short *scalarOpacityTable, unsigned short index, unsigned char color[4])
void LookupDependentColorUC(unsigned short *colorTable, unsigned short *scalarOpacityTable, unsigned short index[4], int components, unsigned char color[4])
VTK_THREAD_RETURN_TYPE vtkFPVRCMSwitchOnDataType(void *arg)
vtkTransform * PerspectiveTransform
void SetRayCastImage(vtkFixedPointRayCastImage *)
Set / Get the underlying image object.
int CheckIfCropped(unsigned int pos[3])
Defines a 1D piecewise function.
vtkDataArray * CurrentScalars
void GetUIntTripleFromPointer(unsigned int v[3], unsigned int *ptr)
Timer support and logging.
float MinimumViewDistance
vtkRayCastImageDisplayHelper * ImageDisplayHelper
vtkVolumeRayCastSpaceLeapingImageFilter * SpaceLeapFilter
void ComputeGradients(vtkVolume *vol)
float GetEstimatedRenderTime(vtkRenderer *ren, vtkVolume *vol)
Get an estimate of the rendering time for a given volume / renderer.
unsigned short * GetColorTable(int c)
void StoreRenderTime(vtkRenderer *ren, vtkVolume *vol, float t)
abstract specification for renderers
encode a direction into a one or two byte value
vtkDataArray * PreviousScalars
int ComputeRowBounds(vtkRenderer *ren, int imageFlag, int rowBoundsFlag, int inputExtent[6])
vtkFiniteDifferenceGradientEstimator * GradientEstimator
unsigned short ** GradientNormal
int ShouldUseNearestNeighborInterpolation(vtkVolume *vol)
static vtkFixedPointVolumeRayCastMapper * New()
int CroppingRegionFlags
Cropping variables, and a method for converting the world coordinate cropping region planes to voxel ...
A helper that generates composite images for the volume ray cast mapper.
float GetZBufferValue(int x, int y)
vtkTypeBool LockSampleDistanceToInputSpacing
maintain a list of planes
create a window for renderers to draw into
A helper that generates composite images for the volume ray cast mapper.
void InitializeRayInfo(vtkVolume *vol)
vtkMatrix4x4 * VolumeMatrix
void CreateCanonicalView(vtkVolume *volume, vtkImageData *image, int blend_mode, double viewDirection[3], double viewUp[3])
friend VTK_THREAD_RETURN_TYPE FixedPointVolumeRayCastMapper_CastRays(void *arg)
unsigned int ToFixedPointPosition(float val)
void FillInMaxGradientMagnitudes(int fullDim[3], int smallDim[3])
A helper that generates composite images for the volume ray cast mapper.
vtkFixedPointVolumeRayCastCompositeGOShadeHelper * CompositeGOShadeHelper
vtkFixedPointVolumeRayCastCompositeHelper * CompositeHelper
float GetEstimatedRenderTime(vtkRenderer *ren)
void Render(vtkRenderer *, vtkVolume *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Initialize rendering for this volume.
unsigned short * MinMaxVolume
int ClipRayAgainstClippingPlanes(double rayStart[3], double rayEnd[3], int numClippingPlanes, float *clippingPlanes)
float SavedSampleDistance
unsigned char ** GradientMagnitude
vtkTimeStamp SavedParametersMTime