VTK: Imaging/Math/vtkImageWeightedSum.h Source File

| VTK 9.3.1

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
28 #ifndef vtkImageWeightedSum_h
29 #define vtkImageWeightedSum_h
30
31 #include "vtkImagingMathModule.h" // For export macro
32 #include "vtkThreadedImageAlgorithm.h"
33
34 VTK_ABI_NAMESPACE_BEGIN
35 class vtkDoubleArray;
36 class VTKIMAGINGMATH_EXPORT vtkImageWeightedSum : public vtkThreadedImageAlgorithm
37 {
38 public:
39 static vtkImageWeightedSum* New();
40 vtkTypeMacro(vtkImageWeightedSum, vtkThreadedImageAlgorithm);
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
44
48 virtual void SetWeights(vtkDoubleArray*);
49 vtkGetObjectMacro(Weights, vtkDoubleArray);
51
55 virtual void SetWeight(vtkIdType id, double weight);
56
58
64 vtkGetMacro(NormalizeByWeight, vtkTypeBool);
65 vtkSetClampMacro(NormalizeByWeight, vtkTypeBool, 0, 1);
66 vtkBooleanMacro(NormalizeByWeight, vtkTypeBool);
68
72 double CalculateTotalWeight();
73
74 protected:
75 vtkImageWeightedSum();
76 ~vtkImageWeightedSum() override;
77
78 // Array to hold all the weights
79 vtkDoubleArray* Weights;
80
81 // Boolean flag to divide by sum or not
82 vtkTypeBool NormalizeByWeight;
83
84 int RequestInformation(vtkInformation* vtkNotUsed(request),
85 vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector) override;
86
87 void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
88 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
89 int id) override;
90 int FillInputPortInformation(int i, vtkInformation* info) override;
91
92 private:
93 vtkImageWeightedSum(const vtkImageWeightedSum&) = delete;
94 void operator=(const vtkImageWeightedSum&) = delete;
95 };
96
97 VTK_ABI_NAMESPACE_END
98 #endif
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:40
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
vtkImageWeightedSum
adds any number of images, weighting each according to the weight set using this->SetWeights(i,...
Definition: vtkImageWeightedSum.h:37
vtkImageWeightedSum::NormalizeByWeight
vtkTypeBool NormalizeByWeight
Definition: vtkImageWeightedSum.h:82
vtkImageWeightedSum::Weights
vtkDoubleArray * Weights
Definition: vtkImageWeightedSum.h:79
vtkImageWeightedSum::ThreadedRequestData
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,...
vtkImageWeightedSum::vtkImageWeightedSum
vtkImageWeightedSum()
vtkImageWeightedSum::RequestInformation
int RequestInformation(vtkInformation *vtkNotUsed(request), vtkInformationVector **vtkNotUsed(inputVector), vtkInformationVector *outputVector) override
vtkImageWeightedSum::~vtkImageWeightedSum
~vtkImageWeightedSum() override
vtkImageWeightedSum::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageWeightedSum::New
static vtkImageWeightedSum * New()
vtkImageWeightedSum::FillInputPortInformation
int FillInputPortInformation(int i, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
vtkImageWeightedSum::CalculateTotalWeight
double CalculateTotalWeight()
Compute the total value of all the weight.
vtkImageWeightedSum::SetWeights
virtual void SetWeights(vtkDoubleArray *)
The weights control the contribution of each input to the sum.
vtkImageWeightedSum::SetWeight
virtual void SetWeight(vtkIdType id, double weight)
Change a specific weight.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:34
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::weight
@ weight
Definition: vtkX3D.h:532
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkThreadedImageAlgorithm.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315