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 =========================================================================*/
32 #ifndef vtkVolumeRayCastSpaceLeapingImageFilter_h
33 #define vtkVolumeRayCastSpaceLeapingImageFilter_h
34 
35 #include "vtkRenderingVolumeModule.h" // For export macro
37 
38 class vtkDataArray;
39 
41 {
42 public:
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
49 
52  virtual void SetCurrentScalars( vtkDataArray * );
53  vtkGetObjectMacro( CurrentScalars, vtkDataArray );
55 
57 
60  vtkSetMacro( IndependentComponents, int );
61  vtkGetMacro( IndependentComponents, int );
63 
65 
68  vtkSetMacro( ComputeGradientOpacity, vtkTypeBool );
69  vtkGetMacro( ComputeGradientOpacity, vtkTypeBool );
70  vtkBooleanMacro( ComputeGradientOpacity, vtkTypeBool );
72 
74 
77  vtkSetMacro( ComputeMinMax, vtkTypeBool );
78  vtkGetMacro( ComputeMinMax, vtkTypeBool );
79  vtkBooleanMacro( ComputeMinMax, vtkTypeBool );
81 
83 
87  vtkSetMacro( UpdateGradientOpacityFlags, vtkTypeBool );
88  vtkGetMacro( UpdateGradientOpacityFlags, vtkTypeBool );
89  vtkBooleanMacro( UpdateGradientOpacityFlags, vtkTypeBool );
91 
97  { return LastMinMaxBuildTime.GetMTime(); }
98 
104  { return LastMinMaxFlagTime.GetMTime(); }
105 
107 
115  vtkSetVector4Macro( TableShift, float );
116  vtkGetVector4Macro( TableShift, float );
117  vtkSetVector4Macro( TableScale, float );
118  vtkGetVector4Macro( TableScale, float );
119  vtkSetVector4Macro( TableSize, int );
120  vtkGetVector4Macro( TableSize, int );
122 
127  int GetNumberOfIndependentComponents();
128 
137  unsigned short * GetMinMaxVolume( int dims[4] );
138 
144  virtual void SetCache(vtkImageData * imageCache);
145 
151  static void ComputeInputExtentsForOutput( int inExt[6],
152  int inDim[3], int outExt[6], vtkImageData *inData );
153 
155 
160  unsigned short * GetMinNonZeroScalarIndex();
161  unsigned char * GetMinNonZeroGradientMagnitudeIndex();
163 
165 
170  void SetGradientMagnitude( unsigned char ** gradientMagnitude );
171  unsigned char **GetGradientMagnitude();
173 
175 
179  void SetScalarOpacityTable( int c, unsigned short * t);
180  void SetGradientOpacityTable( int c, unsigned short * t );
182 
188  vtkIdType ComputeOffset(const int ext[6], const int wholeExt[6],
189  int nComponents);
190 
191  // This method helps debug. It writes out a specific component of the
192  // computed min-max-volume structure
193  //static void WriteMinMaxVolume( int component, unsigned short *minMaxVolume,
194  // int minMaxVolumeSize[4], const char *filename );
195 
196 protected:
199 
204  float TableShift[4];
205  float TableScale[4];
206  int TableSize[4];
210  unsigned short * MinNonZeroScalarIndex;
212  unsigned char ** GradientMagnitude;
213  unsigned short * ScalarOpacityTable[4];
214  unsigned short * GradientOpacityTable[4];
216 
217 
218  void InternalRequestUpdateExtent(int *, int*);
219 
221 
226  vtkInformationVector *) override;
227  void ThreadedRequestData( vtkInformation *request,
228  vtkInformationVector **inputVector,
229  vtkInformationVector *outputVector,
230  vtkImageData ***inData,
231  vtkImageData **outData,
232  int outExt[6], int id) override;
233  int RequestData( vtkInformation* request,
234  vtkInformationVector** inputVector,
235  vtkInformationVector* outputVector) override;
238  vtkInformationVector *) override;
240 
246  void ComputeFirstNonZeroOpacityIndices();
247 
252  void FillScalarOpacityFlags(
253  vtkImageData *minMaxVolume, int outExt[6] );
254 
260  void FillScalarAndGradientOpacityFlags(
261  vtkImageData *minMaxVolume, int outExt[6] );
262 
264 
270  vtkInformation* outInfo,
271  int *uExtent) override;
273  vtkInformation *outInfo) override;
275 
276 private:
278  void operator=(const vtkVolumeRayCastSpaceLeapingImageFilter&) = delete;
279 };
280 
281 #endif
vtkThreadedImageAlgorithm::ThreadedRequestData
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,...
vtkVolumeRayCastSpaceLeapingImageFilter::LastMinMaxBuildTime
vtkTimeStamp LastMinMaxBuildTime
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:201
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:43
vtkVolumeRayCastSpaceLeapingImageFilter::GradientMagnitude
unsigned char ** GradientMagnitude
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:212
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkVolumeRayCastSpaceLeapingImageFilter::MinNonZeroScalarIndex
unsigned short * MinNonZeroScalarIndex
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:210
vtkThreadedImageAlgorithm.h
vtkVolumeRayCastSpaceLeapingImageFilter::LastMinMaxFlagTime
vtkTimeStamp LastMinMaxFlagTime
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:202
vtkImageAlgorithm::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to translate the update extent requests from each output port ...
vtkImageAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkThreadedImageAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageAlgorithm::AllocateOutputData
virtual void AllocateOutputData(vtkImageData *out, vtkInformation *outInfo, int *uExtent)
Allocate the output data.
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::GetLastMinMaxFlagTime
vtkMTimeType GetLastMinMaxFlagTime()
Get the last execution time.
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:103
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkVolumeRayCastSpaceLeapingImageFilter::GetLastMinMaxBuildTime
vtkMTimeType GetLastMinMaxBuildTime()
Get the last execution time.
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:96
vtkVolumeRayCastSpaceLeapingImageFilter::ComputeGradientOpacity
vtkTypeBool ComputeGradientOpacity
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:207
vtkVolumeRayCastSpaceLeapingImageFilter::Cache
vtkImageData * Cache
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:215
vtkVolumeRayCastSpaceLeapingImageFilter::IndependentComponents
int IndependentComponents
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:200
vtkVolumeRayCastSpaceLeapingImageFilter::CurrentScalars
vtkDataArray * CurrentScalars
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:203
vtkVolumeRayCastSpaceLeapingImageFilter::MinNonZeroGradientMagnitudeIndex
unsigned char * MinNonZeroGradientMagnitudeIndex
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:211
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkVolumeRayCastSpaceLeapingImageFilter::UpdateGradientOpacityFlags
vtkTypeBool UpdateGradientOpacityFlags
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:209
vtkThreadedImageAlgorithm::RequestData
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
vtkVolumeRayCastSpaceLeapingImageFilter::ComputeMinMax
vtkTypeBool ComputeMinMax
Definition: vtkVolumeRayCastSpaceLeapingImageFilter.h:208
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302