VTK  9.7.1
vtkImageThreshold.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
12 #ifndef vtkImageThreshold_h
13 #define vtkImageThreshold_h
14 
15 #include "vtkDeprecation.h"
16 #include "vtkImagingCoreModule.h" // For export macro
18 
19 VTK_ABI_NAMESPACE_BEGIN
20 
21 class VTKIMAGINGCORE_EXPORT VTK_DEPRECATED_IN_9_7_0(
22  "vtkImageThreshold is deprecated, please use vtkImageBinaryThreshold instead.") vtkImageThreshold
24 {
25 public:
26  static vtkImageThreshold* New();
28  void PrintSelf(ostream& os, vtkIndent indent) override;
29 
33  void ThresholdByUpper(double thresh);
34 
38  void ThresholdByLower(double thresh);
39 
43  void ThresholdBetween(double lower, double upper);
44 
46 
49  vtkSetMacro(ReplaceIn, vtkTypeBool);
50  vtkGetMacro(ReplaceIn, vtkTypeBool);
51  vtkBooleanMacro(ReplaceIn, vtkTypeBool);
53 
55 
58  void SetInValue(double val);
59  vtkGetMacro(InValue, double);
61 
63 
66  vtkSetMacro(ReplaceOut, vtkTypeBool);
67  vtkGetMacro(ReplaceOut, vtkTypeBool);
68  vtkBooleanMacro(ReplaceOut, vtkTypeBool);
70 
72 
75  void SetOutValue(double val);
76  vtkGetMacro(OutValue, double);
78 
80 
83  vtkGetMacro(UpperThreshold, double);
84  vtkGetMacro(LowerThreshold, double);
86 
88 
91  vtkSetMacro(OutputScalarType, int);
92  vtkGetMacro(OutputScalarType, int);
93  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
94  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
95  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
96  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
97  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
98  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
99  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
100  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
101  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
102  void SetOutputScalarTypeToSignedChar() { this->SetOutputScalarType(VTK_SIGNED_CHAR); }
103  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
105 
106 protected:
108  ~vtkImageThreshold() override = default;
109 
113  double InValue;
115  double OutValue;
116 
118 
120 
121  void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
122  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
123  VTK_FUTURE_CONST int outExt[6], int id) override;
124 
125 private:
126  vtkImageThreshold(const vtkImageThreshold&) = delete;
127  void operator=(const vtkImageThreshold&) = delete;
128 };
129 
130 VTK_ABI_NAMESPACE_END
131 #endif
#define VTK_UNSIGNED_INT
Definition: vtkType.h:40
void SetOutputScalarTypeToChar()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type to cast to.
Store vtkAlgorithm input/output information.
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:38
void SetOutputScalarTypeToSignedChar()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToInt()
Set the desired output scalar type to cast to.
vtkImageBinaryThreshold is an image thresholding algorithm that allows users to replace pixel data by...
Flexible threshold.
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_DOUBLE
Definition: vtkType.h:44
Generic filter that has one input.
#define VTK_FLOAT
Definition: vtkType.h:43
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
#define VTK_SHORT
Definition: vtkType.h:37
void SetOutputScalarTypeToFloat()
Set the desired output scalar type to cast to.
#define VTK_CHAR
Definition: vtkType.h:34
#define VTK_LONG
Definition: vtkType.h:41
void SetOutputScalarTypeToDouble()
Set the desired output scalar type to cast to.
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, VTK_FUTURE_CONST int extent[6], int threadId)
If the subclass does not define an Execute method, then the task will be broken up, multiple threads will be spawned, and each thread will call this method.
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToLong()
Set the desired output scalar type to cast to.
#define VTK_SIGNED_CHAR
Definition: vtkType.h:35
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:36
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToShort()
Set the desired output scalar type to cast to.
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.
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:42
#define VTK_DEPRECATED_IN_9_7_0(reason)
#define VTK_INT
Definition: vtkType.h:39
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type to cast to.