VTK  9.0.1
vtkImageWeightedSum.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageWeightedSum.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 =========================================================================*/
28 #ifndef vtkImageWeightedSum_h
29 #define vtkImageWeightedSum_h
30 
31 #include "vtkImagingMathModule.h" // For export macro
33 
34 class vtkDoubleArray;
35 class VTKIMAGINGMATH_EXPORT vtkImageWeightedSum : public vtkThreadedImageAlgorithm
36 {
37 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
43 
47  virtual void SetWeights(vtkDoubleArray*);
48  vtkGetObjectMacro(Weights, vtkDoubleArray);
50 
54  virtual void SetWeight(vtkIdType id, double weight);
55 
57 
63  vtkGetMacro(NormalizeByWeight, vtkTypeBool);
64  vtkSetClampMacro(NormalizeByWeight, vtkTypeBool, 0, 1);
65  vtkBooleanMacro(NormalizeByWeight, vtkTypeBool);
67 
72 
73 protected:
76 
77  // Array to hold all the weights
79 
80  // Boolean flag to divide by sum or not
82 
83  int RequestInformation(vtkInformation* vtkNotUsed(request),
84  vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector) override;
85 
87  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
88  int id) override;
90 
91 private:
93  void operator=(const vtkImageWeightedSum&) = delete;
94 };
95 
96 #endif
dynamic, self-adjusting array of double
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
adds any number of images, weighting each according to the weight set using this->SetWeights(i,...
vtkDoubleArray * Weights
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int ext[6], int id) override
If the subclass does not define an Execute method, then the task will be broken up,...
int RequestInformation(vtkInformation *vtkNotUsed(request), vtkInformationVector **vtkNotUsed(inputVector), vtkInformationVector *outputVector) override
~vtkImageWeightedSum() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkImageWeightedSum * New()
int FillInputPortInformation(int i, vtkInformation *info) override
Fill the input port information objects for this algorithm.
double CalculateTotalWeight()
Compute the total value of all the weight.
virtual void SetWeights(vtkDoubleArray *)
The weights control the contribution of each input to the sum.
virtual void SetWeight(vtkIdType id, double weight)
Change a specific weight.
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
@ info
Definition: vtkX3D.h:382
@ weight
Definition: vtkX3D.h:538
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:338