VTK  9.3.20240328
vtkCheckerboardSplatter.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
86 #ifndef vtkCheckerboardSplatter_h
87 #define vtkCheckerboardSplatter_h
88 
89 #include "vtkImageAlgorithm.h"
90 #include "vtkImagingHybridModule.h" // For export macro
91 
92 #define VTK_ACCUMULATION_MODE_MIN 0
93 #define VTK_ACCUMULATION_MODE_MAX 1
94 #define VTK_ACCUMULATION_MODE_SUM 2
95 
96 VTK_ABI_NAMESPACE_BEGIN
97 class vtkDoubleArray;
99 
100 class VTKIMAGINGHYBRID_EXPORT vtkCheckerboardSplatter : public vtkImageAlgorithm
101 {
102 public:
104  void PrintSelf(ostream& os, vtkIndent indent) override;
105 
112 
114 
118  void SetSampleDimensions(int i, int j, int k);
119  void SetSampleDimensions(int dim[3]);
120  vtkGetVectorMacro(SampleDimensions, int, 3);
122 
124 
130  vtkSetVector6Macro(ModelBounds, double);
131  vtkGetVectorMacro(ModelBounds, double, 6);
133 
135 
145  vtkSetClampMacro(Footprint, int, 0, VTK_INT_MAX);
146  vtkGetMacro(Footprint, int);
148 
150 
156  vtkSetClampMacro(Radius, double, 0.0, VTK_DOUBLE_MAX);
157  vtkGetMacro(Radius, double);
159 
161 
166  vtkSetClampMacro(ScaleFactor, double, 0.0, VTK_DOUBLE_MAX);
167  vtkGetMacro(ScaleFactor, double);
169 
171 
176  vtkSetMacro(ExponentFactor, double);
177  vtkGetMacro(ExponentFactor, double);
179 
181 
184  vtkSetMacro(ScalarWarping, vtkTypeBool);
185  vtkGetMacro(ScalarWarping, vtkTypeBool);
186  vtkBooleanMacro(ScalarWarping, vtkTypeBool);
188 
190 
195  vtkSetMacro(NormalWarping, vtkTypeBool);
196  vtkGetMacro(NormalWarping, vtkTypeBool);
197  vtkBooleanMacro(NormalWarping, vtkTypeBool);
199 
201 
208  vtkSetClampMacro(Eccentricity, double, 0.001, VTK_DOUBLE_MAX);
209  vtkGetMacro(Eccentricity, double);
211 
213 
221  vtkSetClampMacro(AccumulationMode, int, VTK_ACCUMULATION_MODE_MIN, VTK_ACCUMULATION_MODE_SUM);
222  vtkGetMacro(AccumulationMode, int);
223  void SetAccumulationModeToMin() { this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MIN); }
224  void SetAccumulationModeToMax() { this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MAX); }
225  void SetAccumulationModeToSum() { this->SetAccumulationMode(VTK_ACCUMULATION_MODE_SUM); }
228 
230 
235  vtkSetMacro(OutputScalarType, int);
236  vtkGetMacro(OutputScalarType, int);
237  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
238  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
240 
242 
247  vtkSetMacro(Capping, vtkTypeBool);
248  vtkGetMacro(Capping, vtkTypeBool);
249  vtkBooleanMacro(Capping, vtkTypeBool);
251 
253 
257  vtkSetMacro(CapValue, double);
258  vtkGetMacro(CapValue, double);
260 
262 
269  vtkSetMacro(NullValue, double);
270  vtkGetMacro(NullValue, double);
272 
274 
281  vtkSetClampMacro(MaximumDimension, int, 0, 255);
282  vtkGetMacro(MaximumDimension, int);
284 
286 
293  vtkSetClampMacro(ParallelSplatCrossover, int, 0, 255);
294  vtkGetMacro(ParallelSplatCrossover, int);
296 
301  void ComputeModelBounds(vtkDataSet* input, vtkImageData* output, vtkInformation* outInfo);
302 
303 protected:
305  ~vtkCheckerboardSplatter() override = default;
306 
310 
311  int OutputScalarType; // the type of output scalars
312  int SampleDimensions[3]; // dimensions of volume to splat into
313  double Radius; // Radius factor in the Gaussian exponential function
314  int Footprint; // maximum distance splat propagates (in voxels 0->Dim)
315  double ExponentFactor; // scale exponent of gaussian function
316  double ModelBounds[6]; // bounding box of splatting dimensions
317  double Origin[3], Spacing[3]; // output geometry
318  vtkTypeBool NormalWarping; // on/off warping of splat via normal
319  double Eccentricity; // elliptic distortion due to normals
320  vtkTypeBool ScalarWarping; // on/off warping of splat via scalar
321  double ScaleFactor; // splat size influenced by scale factor
322  vtkTypeBool Capping; // Cap side of volume to close surfaces
323  double CapValue; // value to use for capping
324  int AccumulationMode; // how to combine scalar values
325  double NullValue; // initial value of voxels
326  unsigned char MaximumDimension; // max resolution of checkerboard
327  int ParallelSplatCrossover; // the point at which parallel splatting occurs
328 
329 private:
331  void operator=(const vtkCheckerboardSplatter&) = delete;
332 };
333 
334 VTK_ABI_NAMESPACE_END
335 #endif
splat points into a volume with an elliptical, Gaussian distribution
void SetOutputScalarTypeToDouble()
Set what type of scalar data this source should generate.
void SetAccumulationModeToSum()
Specify the scalar accumulation mode.
void SetAccumulationModeToMin()
Specify the scalar accumulation mode.
~vtkCheckerboardSplatter() override=default
void SetSampleDimensions(int i, int j, int k)
Set / get the dimensions of the sampling structured point set.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called in response to a REQUEST_DATA request from the executive.
static vtkCheckerboardSplatter * New()
Construct object with dimensions=(50,50,50); automatic computation of bounds; a Footprint of 2; a Rad...
const char * GetAccumulationModeAsString()
Specify the scalar accumulation mode.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetAccumulationModeToMax()
Specify the scalar accumulation mode.
void SetSampleDimensions(int dim[3])
Set / get the dimensions of the sampling structured point set.
void ComputeModelBounds(vtkDataSet *input, vtkImageData *output, vtkInformation *outInfo)
Compute the size of the sample bounding box automatically from the input data.
int FillInputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
void SetOutputScalarTypeToFloat()
Set what type of scalar data this source should generate.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
abstract superclass for composite (multi-block or AMR) datasets
abstract class to specify dataset behavior
Definition: vtkDataSet.h:165
dynamic, self-adjusting array of double
Generic algorithm superclass for image algs.
topologically and geometrically regular array of data
Definition: vtkImageData.h:155
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_ACCUMULATION_MODE_SUM
#define VTK_ACCUMULATION_MODE_MIN
#define VTK_ACCUMULATION_MODE_MAX
#define VTK_DOUBLE
Definition: vtkType.h:43
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154
#define VTK_FLOAT
Definition: vtkType.h:42
#define VTK_INT_MAX
Definition: vtkType.h:144