VTK
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 
28 #include "vtkImagingCoreModule.h" // For export macro
30 
31 class VTKIMAGINGCORE_EXPORT vtkImageThreshold : public vtkThreadedImageAlgorithm
32 {
33 public:
34  static vtkImageThreshold *New();
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);
102  {this->SetOutputScalarType(VTK_DOUBLE);}
104  {this->SetOutputScalarType(VTK_FLOAT);}
106  {this->SetOutputScalarType(VTK_LONG);}
108  {this->SetOutputScalarType(VTK_UNSIGNED_LONG);};
110  {this->SetOutputScalarType(VTK_INT);}
112  {this->SetOutputScalarType(VTK_UNSIGNED_INT);}
114  {this->SetOutputScalarType(VTK_SHORT);}
116  {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);}
118  {this->SetOutputScalarType(VTK_CHAR);}
120  {this->SetOutputScalarType(VTK_SIGNED_CHAR);}
122  {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);}
124 
125 protected:
127  ~vtkImageThreshold() override {}
128 
132  double InValue;
134  double OutValue;
135 
137 
139 
140  void ThreadedRequestData(vtkInformation *request,
141  vtkInformationVector **inputVector,
142  vtkInformationVector *outputVector,
143  vtkImageData ***inData, vtkImageData **outData,
144  int extent[6], int id) override;
145 
146 private:
147  vtkImageThreshold(const vtkImageThreshold&) = delete;
148  void operator=(const vtkImageThreshold&) = delete;
149 };
150 
151 #endif
152 
153 
154 
vtkThreadedImageAlgorithm::ThreadedRequestData
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId)
If the subclass does not define an Execute method, then the task will be broken up,...
vtkImageThreshold::~vtkImageThreshold
~vtkImageThreshold() override
Definition: vtkImageThreshold.h:127
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:55
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
vtkImageThreshold::SetOutputScalarTypeToInt
void SetOutputScalarTypeToInt()
Definition: vtkImageThreshold.h:109
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:37
vtkImageThreshold::ReplaceOut
vtkTypeBool ReplaceOut
Definition: vtkImageThreshold.h:133
vtkImageThreshold::InValue
double InValue
Definition: vtkImageThreshold.h:132
vtkImageThreshold::SetOutputScalarTypeToSignedChar
void SetOutputScalarTypeToSignedChar()
Definition: vtkImageThreshold.h:119
vtkImageThreshold::ReplaceIn
vtkTypeBool ReplaceIn
Definition: vtkImageThreshold.h:131
vtkThreadedImageAlgorithm.h
vtkImageAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkThreadedImageAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:49
vtkImageThreshold::SetOutputScalarTypeToUnsignedInt
void SetOutputScalarTypeToUnsignedInt()
Definition: vtkImageThreshold.h:111
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:58
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:59
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:51
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:56
vtkImageThreshold::SetOutputScalarTypeToDouble
void SetOutputScalarTypeToDouble()
Definition: vtkImageThreshold.h:101
vtkImageThreshold::SetOutputScalarTypeToLong
void SetOutputScalarTypeToLong()
Definition: vtkImageThreshold.h:105
vtkImageThreshold::UpperThreshold
double UpperThreshold
Definition: vtkImageThreshold.h:129
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:57
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkImageThreshold
Flexible threshold.
Definition: vtkImageThreshold.h:31
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:52
vtkImageThreshold::SetOutputScalarTypeToFloat
void SetOutputScalarTypeToFloat()
Definition: vtkImageThreshold.h:103
vtkImageThreshold::LowerThreshold
double LowerThreshold
Definition: vtkImageThreshold.h:130
vtkImageThreshold::OutputScalarType
int OutputScalarType
Definition: vtkImageThreshold.h:136
VTK_SIGNED_CHAR
#define VTK_SIGNED_CHAR
Definition: vtkType.h:50
vtkImageThreshold::SetOutputScalarTypeToUnsignedShort
void SetOutputScalarTypeToUnsignedShort()
Definition: vtkImageThreshold.h:115
vtkX3D::extent
Definition: vtkX3D.h:345
VTK_INT
#define VTK_INT
Definition: vtkType.h:54
vtkImageThreshold::SetOutputScalarTypeToShort
void SetOutputScalarTypeToShort()
Definition: vtkImageThreshold.h:113
vtkImageThreshold::SetOutputScalarTypeToChar
void SetOutputScalarTypeToChar()
Definition: vtkImageThreshold.h:117
vtkImageThreshold::SetOutputScalarTypeToUnsignedLong
void SetOutputScalarTypeToUnsignedLong()
Definition: vtkImageThreshold.h:107
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkImageThreshold::SetOutputScalarTypeToUnsignedChar
void SetOutputScalarTypeToUnsignedChar()
Definition: vtkImageThreshold.h:121
vtkImageThreshold::OutValue
double OutValue
Definition: vtkImageThreshold.h:134