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 
35 
36 class vtkDataArray;
37 
39 {
40 public:
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
45 
47 
48  virtual void SetCurrentScalars( vtkDataArray * );
49  vtkGetObjectMacro( CurrentScalars, vtkDataArray );
51 
53 
54  vtkSetMacro( IndependentComponents, int );
55  vtkGetMacro( IndependentComponents, int );
57 
59 
60  vtkSetMacro( ComputeGradientOpacity, int );
61  vtkGetMacro( ComputeGradientOpacity, int );
62  vtkBooleanMacro( ComputeGradientOpacity, int );
64 
66 
67  vtkSetMacro( ComputeMinMax, int );
68  vtkGetMacro( ComputeMinMax, int );
69  vtkBooleanMacro( ComputeMinMax, int );
71 
73 
75  vtkSetMacro( UpdateGradientOpacityFlags, int );
76  vtkGetMacro( UpdateGradientOpacityFlags, int );
77  vtkBooleanMacro( UpdateGradientOpacityFlags, int );
79 
81 
83  unsigned long GetLastMinMaxBuildTime()
84  { return LastMinMaxBuildTime.GetMTime(); }
86 
88 
90  unsigned long GetLastMinMaxFlagTime()
91  { return LastMinMaxFlagTime.GetMTime(); }
93 
95 
101  vtkSetVector4Macro( TableShift, float );
102  vtkGetVector4Macro( TableShift, float );
103  vtkSetVector4Macro( TableScale, float );
104  vtkGetVector4Macro( TableScale, float );
105  vtkSetVector4Macro( TableSize, int );
106  vtkGetVector4Macro( TableSize, int );
108 
111  int GetNumberOfIndependentComponents();
112 
119  unsigned short * GetMinMaxVolume( int dims[4] );
120 
123  virtual void SetCache(vtkImageData * imageCache);
124 
126 
129  static void ComputeInputExtentsForOutput( int inExt[6],
130  int inDim[3], int outExt[6], vtkImageData *inData );
132 
134 
136  unsigned short * GetMinNonZeroScalarIndex();
137  unsigned char * GetMinNonZeroGradientMagnitudeIndex();
139 
140  //BTX
142 
145  void SetGradientMagnitude( unsigned char ** gradientMagnitude );
146  unsigned char **GetGradientMagnitude();
148 
150 
152  void SetScalarOpacityTable( int c, unsigned short * t);
153  void SetGradientOpacityTable( int c, unsigned short * t );
154  //ETX
156 
158 
160  vtkIdType ComputeOffset(const int ext[6], const int wholeExt[6],
161  int nComponents);
163 
164  //BTX
165  // This method helps debug. It writes out a specific component of the
166  // computed min-max-volume structure
167  //static void WriteMinMaxVolume( int component, unsigned short *minMaxVolume,
168  // int minMaxVolumeSize[4], const char *filename );
169  //ETX
170 
171 protected:
174 
179  float TableShift[4];
180  float TableScale[4];
181  int TableSize[4];
185  unsigned short * MinNonZeroScalarIndex;
187  unsigned char ** GradientMagnitude;
188  unsigned short * ScalarOpacityTable[4];
189  unsigned short * GradientOpacityTable[4];
191 
192 
193  void InternalRequestUpdateExtent(int *, int*);
194 
196 
197  virtual int RequestUpdateExtent(vtkInformation *,
200  void ThreadedRequestData( vtkInformation *request,
201  vtkInformationVector **inputVector,
202  vtkInformationVector *outputVector,
203  vtkImageData ***inData,
204  vtkImageData **outData,
205  int outExt[6], int id);
206  virtual int RequestData( vtkInformation* request,
207  vtkInformationVector** inputVector,
208  vtkInformationVector* outputVector);
209  virtual int RequestInformation( vtkInformation *,
213 
217  void ComputeFirstNonZeroOpacityIndices();
218 
220 
223  void FillScalarOpacityFlags(
224  vtkImageData *minMaxVolume, int outExt[6] );
226 
228 
231  void FillScalarAndGradientOpacityFlags(
232  vtkImageData *minMaxVolume, int outExt[6] );
234 
236 
239  virtual void AllocateOutputData( vtkImageData *out, int *uExtent );
242 
243 private:
245  void operator=(const vtkVolumeRayCastSpaceLeapingImageFilter&); // Not implemented.
246 };
247 
248 #endif