VTK  9.1.0
vtkImageMaskBits.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkImageMaskBits.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 vtkImageMaskBits_h
25#define vtkImageMaskBits_h
26
27#include "vtkImageLogic.h" //For VTK_AND, VTK_OR ...
28#include "vtkImagingMathModule.h" // For export macro
30
31class VTKIMAGINGMATH_EXPORT vtkImageMaskBits : public vtkThreadedImageAlgorithm
32{
33public:
36 void PrintSelf(ostream& os, vtkIndent indent) override;
37
39
42 vtkSetVector4Macro(Masks, unsigned int);
43 void SetMask(unsigned int mask) { this->SetMasks(mask, mask, mask, mask); }
44 void SetMasks(unsigned int mask1, unsigned int mask2)
45 {
46 this->SetMasks(mask1, mask2, 0xffffffff, 0xffffffff);
47 }
48 void SetMasks(unsigned int mask1, unsigned int mask2, unsigned int mask3)
49 {
50 this->SetMasks(mask1, mask2, mask3, 0xffffffff);
51 }
52 vtkGetVector4Macro(Masks, unsigned int);
54
56
59 vtkSetMacro(Operation, int);
60 vtkGetMacro(Operation, int);
61 void SetOperationToAnd() { this->SetOperation(VTK_AND); }
62 void SetOperationToOr() { this->SetOperation(VTK_OR); }
63 void SetOperationToXor() { this->SetOperation(VTK_XOR); }
64 void SetOperationToNand() { this->SetOperation(VTK_NAND); }
65 void SetOperationToNor() { this->SetOperation(VTK_NOR); }
67
68protected:
70 ~vtkImageMaskBits() override = default;
71
72 void ThreadedExecute(vtkImageData* inData, vtkImageData* outData, int ext[6], int id) override;
73
74 unsigned int Masks[4];
76
77private:
78 vtkImageMaskBits(const vtkImageMaskBits&) = delete;
79 void operator=(const vtkImageMaskBits&) = delete;
80};
81
82#endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
applies a bit-mask pattern to each component.
void SetOperationToAnd()
Set/Get the boolean operator.
static vtkImageMaskBits * New()
void SetMasks(unsigned int mask1, unsigned int mask2)
Set/Get the bit-masks.
~vtkImageMaskBits() override=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetMask(unsigned int mask)
Set/Get the bit-masks.
void SetMasks(unsigned int mask1, unsigned int mask2, unsigned int mask3)
Set/Get the bit-masks.
void SetOperationToNand()
Set/Get the boolean operator.
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int ext[6], int id) override
void SetOperationToOr()
Set/Get the boolean operator.
void SetOperationToNor()
Set/Get the boolean operator.
void SetOperationToXor()
Set/Get the boolean operator.
a simple class to control print indentation
Definition: vtkIndent.h:113
Generic filter that has one input.
#define VTK_NAND
Definition: vtkImageLogic.h:31
#define VTK_AND
Definition: vtkImageLogic.h:28
#define VTK_XOR
Definition: vtkImageLogic.h:30
#define VTK_NOR
Definition: vtkImageLogic.h:32
#define VTK_OR
Definition: vtkImageLogic.h:29