VTK  9.2.6
vtkImageLogic.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkImageLogic.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=========================================================================*/
27#ifndef vtkImageLogic_h
28#define vtkImageLogic_h
29
30// Operation options.
31#define VTK_AND 0
32#define VTK_OR 1
33#define VTK_XOR 2
34#define VTK_NAND 3
35#define VTK_NOR 4
36#define VTK_NOT 5
37#define VTK_NOP 6
38
39#include "vtkImagingMathModule.h" // For export macro
41
42class VTKIMAGINGMATH_EXPORT vtkImageLogic : public vtkThreadedImageAlgorithm
43{
44public:
45 static vtkImageLogic* New();
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
50
53 vtkSetMacro(Operation, int);
54 vtkGetMacro(Operation, int);
55 void SetOperationToAnd() { this->SetOperation(VTK_AND); }
56 void SetOperationToOr() { this->SetOperation(VTK_OR); }
57 void SetOperationToXor() { this->SetOperation(VTK_XOR); }
58 void SetOperationToNand() { this->SetOperation(VTK_NAND); }
59 void SetOperationToNor() { this->SetOperation(VTK_NOR); }
60 void SetOperationToNot() { this->SetOperation(VTK_NOT); }
62
64
67 vtkSetMacro(OutputTrueValue, double);
68 vtkGetMacro(OutputTrueValue, double);
70
74 virtual void SetInput1Data(vtkDataObject* input) { this->SetInputData(0, input); }
75
79 virtual void SetInput2Data(vtkDataObject* input) { this->SetInputData(1, input); }
80
81protected:
83 ~vtkImageLogic() override = default;
84
87
89 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
90 int id) override;
91 int FillInputPortInformation(int port, vtkInformation* info) override;
92
93private:
94 vtkImageLogic(const vtkImageLogic&) = delete;
95 void operator=(const vtkImageLogic&) = delete;
96};
97
98#endif
general representation of visualization data
Definition: vtkDataObject.h:66
void SetInputData(vtkDataObject *)
Assign a data object as input.
topologically and geometrically regular array of data
Definition: vtkImageData.h:54
And, or, xor, nand, nor, not.
Definition: vtkImageLogic.h:43
static vtkImageLogic * New()
void SetOperationToXor()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:57
virtual void SetInput2Data(vtkDataObject *input)
Set the Input2 of this filter.
Definition: vtkImageLogic.h:79
double OutputTrueValue
Definition: vtkImageLogic.h:86
void SetOperationToNor()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:59
void SetOperationToNand()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:58
void SetOperationToAnd()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:55
void SetOperationToOr()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:56
~vtkImageLogic() override=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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,...
virtual void SetInput1Data(vtkDataObject *input)
Set the Input1 of this filter.
Definition: vtkImageLogic.h:74
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 SetOperationToNot()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:60
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
#define VTK_NAND
Definition: vtkImageLogic.h:34
#define VTK_AND
Definition: vtkImageLogic.h:31
#define VTK_XOR
Definition: vtkImageLogic.h:33
#define VTK_NOR
Definition: vtkImageLogic.h:35
#define VTK_OR
Definition: vtkImageLogic.h:32
#define VTK_NOT
Definition: vtkImageLogic.h:36