VTK: Imaging/Core/vtkImageThreshold.h Source File

| VTK 9.3.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
24 #ifndef vtkImageThreshold_h
25 #define vtkImageThreshold_h
26
27 #include "vtkImagingCoreModule.h" // For export macro
28 #include "vtkThreadedImageAlgorithm.h"
29
30 VTK_ABI_NAMESPACE_BEGIN
31 class VTKIMAGINGCORE_EXPORT vtkImageThreshold : public vtkThreadedImageAlgorithm
32 {
33 public:
34 static vtkImageThreshold* New();
35 vtkTypeMacro(vtkImageThreshold, vtkThreadedImageAlgorithm);
36 void PrintSelf(ostream& os, vtkIndent indent) override;
37
41 void ThresholdByUpper(double thresh);
42
46 void ThresholdByLower(double thresh);
47
51 void ThresholdBetween(double lower, double upper);
52
54
57 vtkSetMacro(ReplaceIn, vtkTypeBool);
58 vtkGetMacro(ReplaceIn, vtkTypeBool);
59 vtkBooleanMacro(ReplaceIn, vtkTypeBool);
61
63
66 void SetInValue(double val);
67 vtkGetMacro(InValue, double);
69
71
74 vtkSetMacro(ReplaceOut, vtkTypeBool);
75 vtkGetMacro(ReplaceOut, vtkTypeBool);
76 vtkBooleanMacro(ReplaceOut, vtkTypeBool);
78
80
83 void SetOutValue(double val);
84 vtkGetMacro(OutValue, double);
86
88
91 vtkGetMacro(UpperThreshold, double);
92 vtkGetMacro(LowerThreshold, double);
94
96
99 vtkSetMacro(OutputScalarType, int);
100 vtkGetMacro(OutputScalarType, int);
101 void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
102 void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
103 void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
104 void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
105 void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
106 void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
107 void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
108 void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
109 void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
110 void SetOutputScalarTypeToSignedChar() { this->SetOutputScalarType(VTK_SIGNED_CHAR); }
111 void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
113
114 protected:
115 vtkImageThreshold();
116 ~vtkImageThreshold() override = default;
117
118 double UpperThreshold;
119 double LowerThreshold;
120 vtkTypeBool ReplaceIn;
121 double InValue;
122 vtkTypeBool ReplaceOut;
123 double OutValue;
124
125 int OutputScalarType;
126
127 int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
128
129 void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
130 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
131 int outExt[6], int id) override;
132
133 private:
134 vtkImageThreshold(const vtkImageThreshold&) = delete;
135 void operator=(const vtkImageThreshold&) = delete;
136 };
137
138 VTK_ABI_NAMESPACE_END
139 #endif
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
vtkImageThreshold
Flexible threshold.
Definition: vtkImageThreshold.h:32
vtkImageThreshold::ThresholdBetween
void ThresholdBetween(double lower, double upper)
The values in a range (inclusive) match.
vtkImageThreshold::SetOutputScalarTypeToInt
void SetOutputScalarTypeToInt()
Set the desired output scalar type to cast to.
Definition: vtkImageThreshold.h:105
vtkImageThreshold::SetOutValue
void SetOutValue(double val)
Replace the in range pixels with this value.
vtkImageThreshold::SetOutputScalarTypeToLong
void SetOutputScalarTypeToLong()
Set the desired output scalar type to cast to.
Definition: vtkImageThreshold.h:103
vtkImageThreshold::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageThreshold::SetOutputScalarTypeToChar
void SetOutputScalarTypeToChar()
Set the desired output scalar type to cast to.
Definition: vtkImageThreshold.h:109
vtkImageThreshold::SetOutputScalarTypeToDouble
void SetOutputScalarTypeToDouble()
Set the desired output scalar type to cast to.
Definition: vtkImageThreshold.h:101
vtkImageThreshold::SetOutputScalarTypeToSignedChar
void SetOutputScalarTypeToSignedChar()
Set the desired output scalar type to cast to.
Definition: vtkImageThreshold.h:110
vtkImageThreshold::UpperThreshold
double UpperThreshold
Definition: vtkImageThreshold.h:118
vtkImageThreshold::ThreadedRequestData
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,...
vtkImageThreshold::OutValue
double OutValue
Definition: vtkImageThreshold.h:123
vtkImageThreshold::ReplaceOut
vtkTypeBool ReplaceOut
Definition: vtkImageThreshold.h:122
vtkImageThreshold::InValue
double InValue
Definition: vtkImageThreshold.h:121
vtkImageThreshold::SetOutputScalarTypeToUnsignedLong
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type to cast to.
Definition: vtkImageThreshold.h:104
vtkImageThreshold::SetInValue
void SetInValue(double val)
Replace the in range pixels with this value.
vtkImageThreshold::SetOutputScalarTypeToShort
void SetOutputScalarTypeToShort()
Set the desired output scalar type to cast to.
Definition: vtkImageThreshold.h:107
vtkImageThreshold::SetOutputScalarTypeToUnsignedShort
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type to cast to.
Definition: vtkImageThreshold.h:108
vtkImageThreshold::New
static vtkImageThreshold * New()
vtkImageThreshold::OutputScalarType
int OutputScalarType
Definition: vtkImageThreshold.h:125
vtkImageThreshold::ThresholdByLower
void ThresholdByLower(double thresh)
The values less than or equal to the value match.
vtkImageThreshold::vtkImageThreshold
vtkImageThreshold()
vtkImageThreshold::ThresholdByUpper
void ThresholdByUpper(double thresh)
The values greater than or equal to the value match.
vtkImageThreshold::SetOutputScalarTypeToUnsignedChar
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type to cast to.
Definition: vtkImageThreshold.h:111
vtkImageThreshold::LowerThreshold
double LowerThreshold
Definition: vtkImageThreshold.h:119
vtkImageThreshold::ReplaceIn
vtkTypeBool ReplaceIn
Definition: vtkImageThreshold.h:120
vtkImageThreshold::SetOutputScalarTypeToUnsignedInt
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type to cast to.
Definition: vtkImageThreshold.h:106
vtkImageThreshold::~vtkImageThreshold
~vtkImageThreshold() override=default
vtkImageThreshold::SetOutputScalarTypeToFloat
void SetOutputScalarTypeToFloat()
Set the desired output scalar type to cast to.
Definition: vtkImageThreshold.h:102
vtkImageThreshold::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:34
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkThreadedImageAlgorithm.h
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:36
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:39
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:43
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:35
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:37
VTK_INT
#define VTK_INT
Definition: vtkType.h:38
VTK_SIGNED_CHAR
#define VTK_SIGNED_CHAR
Definition: vtkType.h:34
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:42
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:33
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:41
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:40