VTK  9.0.1
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 =========================================================================*/
32 #ifndef vtkVolumeRayCastSpaceLeapingImageFilter_h
33 #define vtkVolumeRayCastSpaceLeapingImageFilter_h
34 
35 #include "vtkRenderingVolumeModule.h" // For export macro
37 
38 class vtkDataArray;
39 
40 class VTKRENDERINGVOLUME_EXPORT vtkVolumeRayCastSpaceLeapingImageFilter
42 {
43 public:
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
50 
53  virtual void SetCurrentScalars(vtkDataArray*);
54  vtkGetObjectMacro(CurrentScalars, vtkDataArray);
56 
58 
61  vtkSetMacro(IndependentComponents, int);
62  vtkGetMacro(IndependentComponents, int);
64 
66 
69  vtkSetMacro(ComputeGradientOpacity, vtkTypeBool);
70  vtkGetMacro(ComputeGradientOpacity, vtkTypeBool);
71  vtkBooleanMacro(ComputeGradientOpacity, vtkTypeBool);
73 
75 
78  vtkSetMacro(ComputeMinMax, vtkTypeBool);
79  vtkGetMacro(ComputeMinMax, vtkTypeBool);
80  vtkBooleanMacro(ComputeMinMax, vtkTypeBool);
82 
84 
88  vtkSetMacro(UpdateGradientOpacityFlags, vtkTypeBool);
89  vtkGetMacro(UpdateGradientOpacityFlags, vtkTypeBool);
90  vtkBooleanMacro(UpdateGradientOpacityFlags, vtkTypeBool);
92 
97  vtkMTimeType GetLastMinMaxBuildTime() { return LastMinMaxBuildTime.GetMTime(); }
98 
103  vtkMTimeType GetLastMinMaxFlagTime() { return LastMinMaxFlagTime.GetMTime(); }
104 
106 
114  vtkSetVector4Macro(TableShift, float);
115  vtkGetVector4Macro(TableShift, float);
116  vtkSetVector4Macro(TableScale, float);
117  vtkGetVector4Macro(TableScale, float);
118  vtkSetVector4Macro(TableSize, int);
119  vtkGetVector4Macro(TableSize, int);
121 
126  int GetNumberOfIndependentComponents();
127 
136  unsigned short* GetMinMaxVolume(int dims[4]);
137 
143  virtual void SetCache(vtkImageData* imageCache);
144 
150  static void ComputeInputExtentsForOutput(
151  int inExt[6], int inDim[3], int outExt[6], vtkImageData* inData);
152 
154 
159  unsigned short* GetMinNonZeroScalarIndex();
160  unsigned char* GetMinNonZeroGradientMagnitudeIndex();
162 
164 
169  void SetGradientMagnitude(unsigned char** gradientMagnitude);
170  unsigned char** GetGradientMagnitude();
172 
174 
178  void SetScalarOpacityTable(int c, unsigned short* t);
179  void SetGradientOpacityTable(int c, unsigned short* t);
181 
187  vtkIdType ComputeOffset(const int ext[6], const int wholeExt[6], int nComponents);
188 
189  // This method helps debug. It writes out a specific component of the
190  // computed min-max-volume structure
191  // static void WriteMinMaxVolume( int component, unsigned short *minMaxVolume,
192  // int minMaxVolumeSize[4], const char *filename );
193 
194 protected:
197 
202  float TableShift[4];
203  float TableScale[4];
204  int TableSize[4];
208  unsigned short* MinNonZeroScalarIndex;
210  unsigned char** GradientMagnitude;
211  unsigned short* ScalarOpacityTable[4];
212  unsigned short* GradientOpacityTable[4];
214 
215  void InternalRequestUpdateExtent(int*, int*);
216 
218 
222  void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
223  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
224  int outExt[6], int id) override;
225  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
226  vtkInformationVector* outputVector) override;
229 
235  void ComputeFirstNonZeroOpacityIndices();
236 
241  void FillScalarOpacityFlags(vtkImageData* minMaxVolume, int outExt[6]);
242 
248  void FillScalarAndGradientOpacityFlags(vtkImageData* minMaxVolume, int outExt[6]);
249 
251 
256  void AllocateOutputData(vtkImageData* out, vtkInformation* outInfo, int* uExtent) override;
259 
260 private:
262  void operator=(const vtkVolumeRayCastSpaceLeapingImageFilter&) = delete;
263 };
264 
265 #endif
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
record modification and/or execution time
Definition: vtkTimeStamp.h:32
int vtkIdType
Definition: vtkType.h:338
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to translate the update extent requests from each output port ...
virtual void AllocateOutputData(vtkImageData *out, vtkInformation *outInfo, int *uExtent)
Allocate the output data.
int vtkTypeBool
Definition: vtkABI.h:69
Generic filter that has one input.
vtkMTimeType GetLastMinMaxBuildTime()
Get the last execution time.
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId)
If the subclass does not define an Execute method, then the task will be broken up, multiple threads will be spawned, and each thread will call this method.
vtkMTimeType GetLastMinMaxFlagTime()
Get the last execution time.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
general representation of visualization data
Definition: vtkDataObject.h:59