VTK  9.0.1
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 // Operation options.
28 #define VTK_AND 0
29 #define VTK_OR 1
30 #define VTK_XOR 2
31 #define VTK_NAND 3
32 #define VTK_NOR 4
33 #define VTK_NOT 5
34 #define VTK_NOP 6
35 
36 #include "vtkImagingMathModule.h" // For export macro
38 
39 class VTKIMAGINGMATH_EXPORT vtkImageLogic : public vtkThreadedImageAlgorithm
40 {
41 public:
42  static vtkImageLogic* New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
50  vtkSetMacro(Operation, int);
51  vtkGetMacro(Operation, int);
52  void SetOperationToAnd() { this->SetOperation(VTK_AND); }
53  void SetOperationToOr() { this->SetOperation(VTK_OR); }
54  void SetOperationToXor() { this->SetOperation(VTK_XOR); }
55  void SetOperationToNand() { this->SetOperation(VTK_NAND); }
56  void SetOperationToNor() { this->SetOperation(VTK_NOR); }
57  void SetOperationToNot() { this->SetOperation(VTK_NOT); }
59 
61 
64  vtkSetMacro(OutputTrueValue, double);
65  vtkGetMacro(OutputTrueValue, double);
67 
71  virtual void SetInput1Data(vtkDataObject* input) { this->SetInputData(0, input); }
72 
76  virtual void SetInput2Data(vtkDataObject* input) { this->SetInputData(1, input); }
77 
78 protected:
79  vtkImageLogic();
80  ~vtkImageLogic() override {}
81 
82  int Operation;
84 
85  void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
86  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
87  int id) override;
89 
90 private:
91  vtkImageLogic(const vtkImageLogic&) = delete;
92  void operator=(const vtkImageLogic&) = delete;
93 };
94 
95 #endif
void SetOperationToXor()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:54
Store vtkAlgorithm input/output information.
void SetOperationToAnd()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:52
void SetInputData(vtkDataObject *)
Assign a data object as input.
#define VTK_NOR
Definition: vtkImageLogic.h:32
Generic filter that has one input.
#define VTK_OR
Definition: vtkImageLogic.h:29
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
void SetOperationToNor()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:56
#define VTK_NAND
Definition: vtkImageLogic.h:31
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:53
void SetOperationToNand()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:55
virtual void SetInput1Data(vtkDataObject *input)
Set the Input1 of this filter.
Definition: vtkImageLogic.h:71
#define VTK_XOR
Definition: vtkImageLogic.h:30
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:33
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:80
void SetOperationToNot()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:57
general representation of visualization data
Definition: vtkDataObject.h:59
And, or, xor, nand, nor, not.
Definition: vtkImageLogic.h:39
#define VTK_AND
Definition: vtkImageLogic.h:28
double OutputTrueValue
Definition: vtkImageLogic.h:83
virtual void SetInput2Data(vtkDataObject *input)
Set the Input2 of this filter.
Definition: vtkImageLogic.h:76