VTK
vtkVolumeRayCastSpaceLeapingImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkFixedPointVolumeRayCastMapper.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
31 #ifndef vtkVolumeRayCastSpaceLeapingImageFilter_h
32 #define vtkVolumeRayCastSpaceLeapingImageFilter_h
33 
34 #include "vtkRenderingVolumeModule.h" // For export macro
36 
37 class vtkDataArray;
38 
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent);
44 
46 
48 
49  virtual void SetCurrentScalars( vtkDataArray * );
50  vtkGetObjectMacro( CurrentScalars, vtkDataArray );
52 
54 
55  vtkSetMacro( IndependentComponents, int );
56  vtkGetMacro( IndependentComponents, int );
58 
60 
61  vtkSetMacro( ComputeGradientOpacity, int );
62  vtkGetMacro( ComputeGradientOpacity, int );
63  vtkBooleanMacro( ComputeGradientOpacity, int );
65 
67 
68  vtkSetMacro( ComputeMinMax, int );
69  vtkGetMacro( ComputeMinMax, int );
70  vtkBooleanMacro( ComputeMinMax, int );
72 
74 
76  vtkSetMacro( UpdateGradientOpacityFlags, int );
77  vtkGetMacro( UpdateGradientOpacityFlags, int );
78  vtkBooleanMacro( UpdateGradientOpacityFlags, int );
80 
82 
84  unsigned long GetLastMinMaxBuildTime()
85  { return LastMinMaxBuildTime.GetMTime(); }
87 
89 
91  unsigned long GetLastMinMaxFlagTime()
92  { return LastMinMaxFlagTime.GetMTime(); }
94 
96 
102  vtkSetVector4Macro( TableShift, float );
103  vtkGetVector4Macro( TableShift, float );
104  vtkSetVector4Macro( TableScale, float );
105  vtkGetVector4Macro( TableScale, float );
106  vtkSetVector4Macro( TableSize, int );
107  vtkGetVector4Macro( TableSize, int );
109 
113 
120  unsigned short * GetMinMaxVolume( int dims[4] );
121 
124  virtual void SetCache(vtkImageData * imageCache);
125 
127 
130  static void ComputeInputExtentsForOutput( int inExt[6],
131  int inDim[3], int outExt[6], vtkImageData *inData );
133 
135 
137  unsigned short * GetMinNonZeroScalarIndex();
140 
141  //BTX
143 
146  void SetGradientMagnitude( unsigned char ** gradientMagnitude );
147  unsigned char **GetGradientMagnitude();
149 
151 
153  void SetScalarOpacityTable( int c, unsigned short * t);
154  void SetGradientOpacityTable( int c, unsigned short * t );
155  //ETX
157 
159 
161  vtkIdType ComputeOffset(const int ext[6], const int wholeExt[6],
162  int nComponents);
164 
165  //BTX
166  // This method helps debug. It writes out a specific component of the
167  // computed min-max-volume structure
168  //static void WriteMinMaxVolume( int component, unsigned short *minMaxVolume,
169  // int minMaxVolumeSize[4], const char *filename );
170  //ETX
171 
172 protected:
175 
180  float TableShift[4];
181  float TableScale[4];
182  int TableSize[4];
186  unsigned short * MinNonZeroScalarIndex;
188  unsigned char ** GradientMagnitude;
189  unsigned short * ScalarOpacityTable[4];
190  unsigned short * GradientOpacityTable[4];
192 
193 
194  void InternalRequestUpdateExtent(int *, int*);
195 
197 
202  vtkInformationVector **inputVector,
203  vtkInformationVector *outputVector,
204  vtkImageData ***inData,
205  vtkImageData **outData,
206  int outExt[6], int id);
207  virtual int RequestData( vtkInformation* request,
208  vtkInformationVector** inputVector,
209  vtkInformationVector* outputVector);
214 
219 
221 
225  vtkImageData *minMaxVolume, int outExt[6] );
227 
229 
233  vtkImageData *minMaxVolume, int outExt[6] );
235 
237 
240  virtual void AllocateOutputData(vtkImageData *out,
241  vtkInformation* outInfo,
242  int *uExtent);
244  vtkInformation *outInfo);
246 
247 private:
249  void operator=(const vtkVolumeRayCastSpaceLeapingImageFilter&); // Not implemented.
250 };
251 
252 #endif
vtkVolumeRayCastSpaceLeapingImageFilter::GetMinMaxVolume
unsigned short * GetMinMaxVolume(int dims[4])
vtkVolumeRayCastSpaceLeapingImageFilter::LastMinMaxBuildTime
vtkTimeStamp LastMinMaxBuildTime
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:177
vtkVolumeRayCastSpaceLeapingImageFilter::GetMinNonZeroGradientMagnitudeIndex
unsigned char * GetMinNonZeroGradientMagnitudeIndex()
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkVolumeRayCastSpaceLeapingImageFilter::RequestInformation
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkVolumeRayCastSpaceLeapingImageFilter::vtkVolumeRayCastSpaceLeapingImageFilter
vtkVolumeRayCastSpaceLeapingImageFilter()
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkVolumeRayCastSpaceLeapingImageFilter::SetGradientOpacityTable
void SetGradientOpacityTable(int c, unsigned short *t)
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkVolumeRayCastSpaceLeapingImageFilter::AllocateOutputData
virtual vtkImageData * AllocateOutputData(vtkDataObject *out, vtkInformation *outInfo)
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkRenderingVolumeModule.h
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkThreadedImageAlgorithm
Generic filter that has one input..
Definition: vtkThreadedImageAlgorithm.h:37
vtkVolumeRayCastSpaceLeapingImageFilter::GradientMagnitude
unsigned char ** GradientMagnitude
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:188
vtkVolumeRayCastSpaceLeapingImageFilter::ComputeGradientOpacity
int ComputeGradientOpacity
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:183
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkVolumeRayCastSpaceLeapingImageFilter::MinNonZeroScalarIndex
unsigned short * MinNonZeroScalarIndex
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:186
vtkThreadedImageAlgorithm.h
vtkVolumeRayCastSpaceLeapingImageFilter::New
static vtkVolumeRayCastSpaceLeapingImageFilter * New()
vtkVolumeRayCastSpaceLeapingImageFilter::FillScalarOpacityFlags
void FillScalarOpacityFlags(vtkImageData *minMaxVolume, int outExt[6])
vtkVolumeRayCastSpaceLeapingImageFilter::~vtkVolumeRayCastSpaceLeapingImageFilter
~vtkVolumeRayCastSpaceLeapingImageFilter()
vtkVolumeRayCastSpaceLeapingImageFilter::LastMinMaxFlagTime
vtkTimeStamp LastMinMaxFlagTime
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:178
vtkVolumeRayCastSpaceLeapingImageFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkVolumeRayCastSpaceLeapingImageFilter::ComputeInputExtentsForOutput
static void ComputeInputExtentsForOutput(int inExt[6], int inDim[3], int outExt[6], vtkImageData *inData)
vtkgl::c
const GLubyte * c
Definition: vtkgl.h:15720
vtkVolumeRayCastSpaceLeapingImageFilter::ThreadedRequestData
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int outExt[6], int id)
vtkVolumeRayCastSpaceLeapingImageFilter::AllocateOutputData
virtual void AllocateOutputData(vtkImageData *out, vtkInformation *outInfo, int *uExtent)
vtkVolumeRayCastSpaceLeapingImageFilter::GetGradientMagnitude
unsigned char ** GetGradientMagnitude()
vtkVolumeRayCastSpaceLeapingImageFilter::SetCurrentScalars
virtual void SetCurrentScalars(vtkDataArray *)
vtkVolumeRayCastSpaceLeapingImageFilter::SetGradientMagnitude
void SetGradientMagnitude(unsigned char **gradientMagnitude)
vtkVolumeRayCastSpaceLeapingImageFilter::FillScalarAndGradientOpacityFlags
void FillScalarAndGradientOpacityFlags(vtkImageData *minMaxVolume, int outExt[6])
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkVolumeRayCastSpaceLeapingImageFilter
Builds the space leaping data structure.
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:40
vtkVolumeRayCastSpaceLeapingImageFilter::ComputeFirstNonZeroOpacityIndices
void ComputeFirstNonZeroOpacityIndices()
vtkVolumeRayCastSpaceLeapingImageFilter::GetLastMinMaxBuildTime
unsigned long GetLastMinMaxBuildTime()
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:84
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkVolumeRayCastSpaceLeapingImageFilter::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkVolumeRayCastSpaceLeapingImageFilter::UpdateGradientOpacityFlags
int UpdateGradientOpacityFlags
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:185
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkVolumeRayCastSpaceLeapingImageFilter::GetNumberOfIndependentComponents
int GetNumberOfIndependentComponents()
vtkVolumeRayCastSpaceLeapingImageFilter::SetScalarOpacityTable
void SetScalarOpacityTable(int c, unsigned short *t)
vtkSetVector4Macro
#define vtkSetVector4Macro(name, type)
Definition: vtkSetGet.h:322
vtkgl::t
GLdouble GLdouble t
Definition: vtkgl.h:11602
vtkVolumeRayCastSpaceLeapingImageFilter::InternalRequestUpdateExtent
void InternalRequestUpdateExtent(int *, int *)
vtkVolumeRayCastSpaceLeapingImageFilter::SetCache
virtual void SetCache(vtkImageData *imageCache)
vtkVolumeRayCastSpaceLeapingImageFilter::Cache
vtkImageData * Cache
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:191
vtkVolumeRayCastSpaceLeapingImageFilter::IndependentComponents
int IndependentComponents
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:176
vtkVolumeRayCastSpaceLeapingImageFilter::ComputeOffset
vtkIdType ComputeOffset(const int ext[6], const int wholeExt[6], int nComponents)
vtkVolumeRayCastSpaceLeapingImageFilter::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkVolumeRayCastSpaceLeapingImageFilter::CurrentScalars
vtkDataArray * CurrentScalars
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:179
VTKRENDERINGVOLUME_EXPORT
#define VTKRENDERINGVOLUME_EXPORT
Definition: vtkRenderingVolumeModule.h:15
vtkVolumeRayCastSpaceLeapingImageFilter::GetLastMinMaxFlagTime
unsigned long GetLastMinMaxFlagTime()
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:91
vtkVolumeRayCastSpaceLeapingImageFilter::GetMinNonZeroScalarIndex
unsigned short * GetMinNonZeroScalarIndex()
vtkVolumeRayCastSpaceLeapingImageFilter::MinNonZeroGradientMagnitudeIndex
unsigned char * MinNonZeroGradientMagnitudeIndex
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:187
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkGetVector4Macro
#define vtkGetVector4Macro(name, type)
Definition: vtkSetGet.h:341
vtkVolumeRayCastSpaceLeapingImageFilter::ComputeMinMax
int ComputeMinMax
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:184