VTK  9.2.6
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=========================================================================*/
40#ifndef vtkImageWeightedSum_h
41#define vtkImageWeightedSum_h
42
43#include "vtkImagingMathModule.h" // For export macro
45
46class vtkDoubleArray;
47class VTKIMAGINGMATH_EXPORT vtkImageWeightedSum : public vtkThreadedImageAlgorithm
48{
49public:
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
55
59 virtual void SetWeights(vtkDoubleArray*);
60 vtkGetObjectMacro(Weights, vtkDoubleArray);
62
66 virtual void SetWeight(vtkIdType id, double weight);
67
69
75 vtkGetMacro(NormalizeByWeight, vtkTypeBool);
76 vtkSetClampMacro(NormalizeByWeight, vtkTypeBool, 0, 1);
77 vtkBooleanMacro(NormalizeByWeight, vtkTypeBool);
79
84
85protected:
88
89 // Array to hold all the weights
91
92 // Boolean flag to divide by sum or not
94
95 int RequestInformation(vtkInformation* vtkNotUsed(request),
96 vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector) override;
97
99 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
100 int id) override;
101 int FillInputPortInformation(int i, vtkInformation* info) override;
102
103private:
105 void operator=(const vtkImageWeightedSum&) = delete;
106};
107
108#endif
dynamic, self-adjusting array of double
topologically and geometrically regular array of data
adds any number of images, weighting each according to the weight set using this->SetWeights(i,...
static vtkImageWeightedSum * New()
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.
int FillInputPortInformation(int i, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
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:49
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
int vtkTypeBool
Definition vtkABI.h:69
int vtkIdType
Definition vtkType.h:332