VTK  9.6.20260614
vtkImageWeightedSum.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
37
38#ifndef vtkImageWeightedSum_h
39#define vtkImageWeightedSum_h
40
41#include "vtkImagingMathModule.h" // For export macro
43
44VTK_ABI_NAMESPACE_BEGIN
45class vtkDoubleArray;
46class VTKIMAGINGMATH_EXPORT vtkImageWeightedSum : public vtkThreadedImageAlgorithm
47{
48public:
51 void PrintSelf(ostream& os, vtkIndent indent) override;
52
54
58 virtual void SetWeights(vtkDoubleArray*);
59 vtkGetObjectMacro(Weights, vtkDoubleArray);
61
65 virtual void SetWeight(vtkIdType id, double weight);
66
68
75 vtkSetClampMacro(NormalizeByWeight, vtkTypeBool, 0, 1);
76 vtkBooleanMacro(NormalizeByWeight, vtkTypeBool);
78
83
84protected:
87
88 // Array to hold all the weights
90
91 // Boolean flag to divide by sum or not
93
94 int RequestInformation(vtkInformation* vtkNotUsed(request),
95 vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector) override;
96
98 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
99 VTK_FUTURE_CONST int ext[6], int id) override;
100 int FillInputPortInformation(int i, vtkInformation* info) override;
101
102private:
104 void operator=(const vtkImageWeightedSum&) = delete;
105};
106
107VTK_ABI_NAMESPACE_END
108#endif
dynamic, self-adjusting array of double
topologically and geometrically regular array of data
static vtkImageWeightedSum * New()
vtkDoubleArray * Weights
~vtkImageWeightedSum() override
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int FillInputPortInformation(int i, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, VTK_FUTURE_CONST int ext[6], int id) override
If the subclass does not define an Execute method, then the task will be broken up,...
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:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:363