VTK  9.3.1
vtkVolumeRayCastSpaceLeapingImageFilter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
20 #ifndef vtkVolumeRayCastSpaceLeapingImageFilter_h
21 #define vtkVolumeRayCastSpaceLeapingImageFilter_h
22 
23 #include "vtkRenderingVolumeModule.h" // For export macro
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkDataArray;
28 
29 class VTKRENDERINGVOLUME_EXPORT vtkVolumeRayCastSpaceLeapingImageFilter
31 {
32 public:
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
37 
39 
42  virtual void SetCurrentScalars(vtkDataArray*);
43  vtkGetObjectMacro(CurrentScalars, vtkDataArray);
45 
47 
50  vtkSetMacro(IndependentComponents, int);
51  vtkGetMacro(IndependentComponents, int);
53 
55 
58  vtkSetMacro(ComputeGradientOpacity, vtkTypeBool);
59  vtkGetMacro(ComputeGradientOpacity, vtkTypeBool);
60  vtkBooleanMacro(ComputeGradientOpacity, vtkTypeBool);
62 
64 
67  vtkSetMacro(ComputeMinMax, vtkTypeBool);
68  vtkGetMacro(ComputeMinMax, vtkTypeBool);
69  vtkBooleanMacro(ComputeMinMax, vtkTypeBool);
71 
73 
77  vtkSetMacro(UpdateGradientOpacityFlags, vtkTypeBool);
78  vtkGetMacro(UpdateGradientOpacityFlags, vtkTypeBool);
79  vtkBooleanMacro(UpdateGradientOpacityFlags, vtkTypeBool);
81 
86  vtkMTimeType GetLastMinMaxBuildTime() { return LastMinMaxBuildTime.GetMTime(); }
87 
92  vtkMTimeType GetLastMinMaxFlagTime() { return LastMinMaxFlagTime.GetMTime(); }
93 
95 
103  vtkSetVector4Macro(TableShift, float);
104  vtkGetVector4Macro(TableShift, float);
105  vtkSetVector4Macro(TableScale, float);
106  vtkGetVector4Macro(TableScale, float);
107  vtkSetVector4Macro(TableSize, int);
108  vtkGetVector4Macro(TableSize, int);
110 
115  int GetNumberOfIndependentComponents();
116 
125  unsigned short* GetMinMaxVolume(int dims[4]);
126 
132  virtual void SetCache(vtkImageData* imageCache);
133 
139  static void ComputeInputExtentsForOutput(
140  int inExt[6], int inDim[3], int outExt[6], vtkImageData* inData);
141 
143 
148  unsigned short* GetMinNonZeroScalarIndex();
149  unsigned char* GetMinNonZeroGradientMagnitudeIndex();
151 
153 
158  void SetGradientMagnitude(unsigned char** gradientMagnitude);
159  unsigned char** GetGradientMagnitude();
161 
163 
167  void SetScalarOpacityTable(int c, unsigned short* t);
168  void SetGradientOpacityTable(int c, unsigned short* t);
170 
176  vtkIdType ComputeOffset(const int ext[6], const int wholeExt[6], int nComponents);
177 
178  // This method helps debug. It writes out a specific component of the
179  // computed min-max-volume structure
180  // static void WriteMinMaxVolume( int component, unsigned short *minMaxVolume,
181  // int minMaxVolumeSize[4], const char *filename );
182 
183 protected:
186 
191  float TableShift[4];
192  float TableScale[4];
193  int TableSize[4];
197  unsigned short* MinNonZeroScalarIndex;
199  unsigned char** GradientMagnitude;
200  unsigned short* ScalarOpacityTable[4];
201  unsigned short* GradientOpacityTable[4];
203 
204  void InternalRequestUpdateExtent(int*, int*);
205 
207 
211  void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
212  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
213  int outExt[6], int id) override;
214  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
215  vtkInformationVector* outputVector) override;
218 
224  void ComputeFirstNonZeroOpacityIndices();
225 
230  void FillScalarOpacityFlags(vtkImageData* minMaxVolume, int outExt[6]);
231 
237  void FillScalarAndGradientOpacityFlags(vtkImageData* minMaxVolume, int outExt[6]);
238 
240 
245  void AllocateOutputData(vtkImageData* out, vtkInformation* outInfo, int* uExtent) override;
248 
249 private:
251  void operator=(const vtkVolumeRayCastSpaceLeapingImageFilter&) = delete;
252 };
253 
254 VTK_ABI_NAMESPACE_END
255 #endif
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
record modification and/or execution time
Definition: vtkTimeStamp.h:24
int vtkIdType
Definition: vtkType.h:315
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:64
Generic filter that has one input.
vtkMTimeType GetLastMinMaxBuildTime()
Get the last execution time.
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
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:44
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:54