VTK
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 =========================================================================*/
24 #ifndef vtkImageLogic_h
25 #define vtkImageLogic_h
26 
27 
28 // Operation options.
29 #define VTK_AND 0
30 #define VTK_OR 1
31 #define VTK_XOR 2
32 #define VTK_NAND 3
33 #define VTK_NOR 4
34 #define VTK_NOT 5
35 #define VTK_NOP 6
36 
37 
38 
39 #include "vtkImagingMathModule.h" // For export macro
41 
42 class VTKIMAGINGMATH_EXPORT vtkImageLogic : public vtkThreadedImageAlgorithm
43 {
44 public:
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 
81 protected:
82  vtkImageLogic();
83  ~vtkImageLogic() override {}
84 
85  int Operation;
87 
88  void ThreadedRequestData (vtkInformation* request,
89  vtkInformationVector** inputVector,
90  vtkInformationVector* outputVector,
91  vtkImageData ***inData, vtkImageData **outData,
92  int ext[6], int id) override;
94 
95 private:
96  vtkImageLogic(const vtkImageLogic&) = delete;
97  void operator=(const vtkImageLogic&) = delete;
98 };
99 
100 #endif
101 
102 
103 
104 
105 
106 
107 
108 
109 
110 
111 
112 
113 
void SetOperationToXor()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:57
Store vtkAlgorithm input/output information.
void SetOperationToAnd()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:55
void SetInputData(vtkDataObject *)
Assign a data object as input.
#define VTK_NOR
Definition: vtkImageLogic.h:33
Generic filter that has one input.
#define VTK_OR
Definition: vtkImageLogic.h:30
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
void SetOperationToNor()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:59
#define VTK_NAND
Definition: vtkImageLogic.h:32
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId)
If the subclass does not define an Execute method, then the task will be broken up,...
void SetOperationToOr()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:56
void SetOperationToNand()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:58
virtual void SetInput1Data(vtkDataObject *input)
Set the Input1 of this filter.
Definition: vtkImageLogic.h:74
#define VTK_XOR
Definition: vtkImageLogic.h:31
int FillInputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
#define VTK_NOT
Definition: vtkImageLogic.h:34
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkImageLogic() override
Definition: vtkImageLogic.h:83
void SetOperationToNot()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:60
general representation of visualization data
Definition: vtkDataObject.h:58
And, or, xor, nand, nor, not.
Definition: vtkImageLogic.h:42
#define VTK_AND
Definition: vtkImageLogic.h:29
double OutputTrueValue
Definition: vtkImageLogic.h:86
virtual void SetInput2Data(vtkDataObject *input)
Set the Input2 of this filter.
Definition: vtkImageLogic.h:79