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 
112  int GetNumberOfIndependentComponents();
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();
138  unsigned char * GetMinNonZeroGradientMagnitudeIndex();
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 
198  virtual int RequestUpdateExtent(vtkInformation *,
201  void ThreadedRequestData( vtkInformation *request,
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);
210  virtual int RequestInformation( vtkInformation *,
214 
218  void ComputeFirstNonZeroOpacityIndices();
219 
221 
224  void FillScalarOpacityFlags(
225  vtkImageData *minMaxVolume, int outExt[6] );
227 
229 
232  void FillScalarAndGradientOpacityFlags(
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
Store vtkAlgorithm input/output information.
#define VTKRENDERINGVOLUME_EXPORT
record modification and/or execution time
Definition: vtkTimeStamp.h:34
int vtkIdType
Definition: vtkType.h:247
void PrintSelf(ostream &os, vtkIndent indent)
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual void AllocateOutputData(vtkImageData *out, vtkInformation *outInfo, int *uExtent)
Generic filter that has one input..
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId)
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
general representation of visualization data
Definition: vtkDataObject.h:64