VTK  9.0.1
vtkImageThreshold.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageThreshold.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 vtkImageThreshold_h
25 #define vtkImageThreshold_h
26 
27 #include "vtkImagingCoreModule.h" // For export macro
29 
30 class VTKIMAGINGCORE_EXPORT vtkImageThreshold : public vtkThreadedImageAlgorithm
31 {
32 public:
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
40  void ThresholdByUpper(double thresh);
41 
45  void ThresholdByLower(double thresh);
46 
50  void ThresholdBetween(double lower, double upper);
51 
53 
56  vtkSetMacro(ReplaceIn, vtkTypeBool);
57  vtkGetMacro(ReplaceIn, vtkTypeBool);
58  vtkBooleanMacro(ReplaceIn, vtkTypeBool);
60 
62 
65  void SetInValue(double val);
66  vtkGetMacro(InValue, double);
68 
70 
73  vtkSetMacro(ReplaceOut, vtkTypeBool);
74  vtkGetMacro(ReplaceOut, vtkTypeBool);
75  vtkBooleanMacro(ReplaceOut, vtkTypeBool);
77 
79 
82  void SetOutValue(double val);
83  vtkGetMacro(OutValue, double);
85 
87 
90  vtkGetMacro(UpperThreshold, double);
91  vtkGetMacro(LowerThreshold, double);
93 
95 
98  vtkSetMacro(OutputScalarType, int);
99  vtkGetMacro(OutputScalarType, int);
100  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
101  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
102  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
103  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
104  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
105  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
106  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
107  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
108  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
109  void SetOutputScalarTypeToSignedChar() { this->SetOutputScalarType(VTK_SIGNED_CHAR); }
110  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
112 
113 protected:
115  ~vtkImageThreshold() override {}
116 
120  double InValue;
122  double OutValue;
123 
125 
127 
129  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
130  int extent[6], int id) override;
131 
132 private:
133  vtkImageThreshold(const vtkImageThreshold&) = delete;
134  void operator=(const vtkImageThreshold&) = delete;
135 };
136 
137 #endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
Flexible threshold.
void ThresholdBetween(double lower, double upper)
The values in a range (inclusive) match.
~vtkImageThreshold() override
void SetOutValue(double val)
Replace the in range pixels with this value.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetOutputScalarTypeToDouble()
void SetOutputScalarTypeToSignedChar()
void SetOutputScalarTypeToUnsignedLong()
void SetInValue(double val)
Replace the in range pixels with this value.
void SetOutputScalarTypeToUnsignedShort()
static vtkImageThreshold * New()
void ThresholdByLower(double thresh)
The values less than or equal to the value match.
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int id) override
If the subclass does not define an Execute method, then the task will be broken up,...
void ThresholdByUpper(double thresh)
The values greater than or equal to the value match.
void SetOutputScalarTypeToUnsignedChar()
void SetOutputScalarTypeToUnsignedInt()
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
@ extent
Definition: vtkX3D.h:351
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SHORT
Definition: vtkType.h:46
#define VTK_UNSIGNED_INT
Definition: vtkType.h:49
#define VTK_DOUBLE
Definition: vtkType.h:53
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:45
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:47
#define VTK_INT
Definition: vtkType.h:48
#define VTK_SIGNED_CHAR
Definition: vtkType.h:44
#define VTK_FLOAT
Definition: vtkType.h:52
#define VTK_CHAR
Definition: vtkType.h:43
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:51
#define VTK_LONG
Definition: vtkType.h:50