VTK  9.2.6
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 =========================================================================*/
36 #ifndef vtkImageThreshold_h
37 #define vtkImageThreshold_h
38 
39 #include "vtkImagingCoreModule.h" // For export macro
41 
42 class VTKIMAGINGCORE_EXPORT vtkImageThreshold : public vtkThreadedImageAlgorithm
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
52  void ThresholdByUpper(double thresh);
53 
57  void ThresholdByLower(double thresh);
58 
62  void ThresholdBetween(double lower, double upper);
63 
65 
68  vtkSetMacro(ReplaceIn, vtkTypeBool);
69  vtkGetMacro(ReplaceIn, vtkTypeBool);
70  vtkBooleanMacro(ReplaceIn, vtkTypeBool);
72 
74 
77  void SetInValue(double val);
78  vtkGetMacro(InValue, double);
80 
82 
85  vtkSetMacro(ReplaceOut, vtkTypeBool);
86  vtkGetMacro(ReplaceOut, vtkTypeBool);
87  vtkBooleanMacro(ReplaceOut, vtkTypeBool);
89 
91 
94  void SetOutValue(double val);
95  vtkGetMacro(OutValue, double);
97 
99 
102  vtkGetMacro(UpperThreshold, double);
103  vtkGetMacro(LowerThreshold, double);
105 
107 
110  vtkSetMacro(OutputScalarType, int);
111  vtkGetMacro(OutputScalarType, int);
112  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
113  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
114  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
115  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
116  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
117  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
118  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
119  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
120  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
121  void SetOutputScalarTypeToSignedChar() { this->SetOutputScalarType(VTK_SIGNED_CHAR); }
122  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
124 
125 protected:
127  ~vtkImageThreshold() override = default;
128 
132  double InValue;
134  double OutValue;
135 
137 
139 
141  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
142  int outExt[6], int id) override;
143 
144 private:
145  vtkImageThreshold(const vtkImageThreshold&) = delete;
146  void operator=(const vtkImageThreshold&) = delete;
147 };
148 
149 #endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:63
Flexible threshold.
void ThresholdBetween(double lower, double upper)
The values in a range (inclusive) match.
void SetOutputScalarTypeToInt()
Set the desired output scalar type to cast to.
void SetOutValue(double val)
Replace the in range pixels with this value.
void SetOutputScalarTypeToLong()
Set the desired output scalar type to cast to.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetOutputScalarTypeToChar()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToDouble()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToSignedChar()
Set the desired output scalar type to cast to.
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int outExt[6], int id) override
If the subclass does not define an Execute method, then the task will be broken up,...
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type to cast to.
void SetInValue(double val)
Replace the in range pixels with this value.
void SetOutputScalarTypeToShort()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type to cast to.
static vtkImageThreshold * New()
void ThresholdByLower(double thresh)
The values less than or equal to the value match.
void ThresholdByUpper(double thresh)
The values greater than or equal to the value match.
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type to cast to.
~vtkImageThreshold() override=default
void SetOutputScalarTypeToFloat()
Set the desired output scalar type to cast to.
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:49
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SHORT
Definition: vtkType.h:48
#define VTK_UNSIGNED_INT
Definition: vtkType.h:51
#define VTK_DOUBLE
Definition: vtkType.h:55
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:47
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:49
#define VTK_INT
Definition: vtkType.h:50
#define VTK_SIGNED_CHAR
Definition: vtkType.h:46
#define VTK_FLOAT
Definition: vtkType.h:54
#define VTK_CHAR
Definition: vtkType.h:45
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:53
#define VTK_LONG
Definition: vtkType.h:52