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 =========================================================================*/
27 #ifndef vtkImageThreshold_h
28 #define vtkImageThreshold_h
29 
30 
31 #include "vtkImagingCoreModule.h" // For export macro
33 
34 class VTKIMAGINGCORE_EXPORT vtkImageThreshold : public vtkThreadedImageAlgorithm
35 {
36 public:
39  void PrintSelf(ostream& os, vtkIndent indent);
40 
44  void ThresholdByUpper(double thresh);
45 
49  void ThresholdByLower(double thresh);
50 
54  void ThresholdBetween(double lower, double upper);
55 
57 
60  vtkSetMacro(ReplaceIn, int);
61  vtkGetMacro(ReplaceIn, int);
62  vtkBooleanMacro(ReplaceIn, int);
64 
66 
69  void SetInValue(double val);
70  vtkGetMacro(InValue, double);
72 
74 
77  vtkSetMacro(ReplaceOut, int);
78  vtkGetMacro(ReplaceOut, int);
79  vtkBooleanMacro(ReplaceOut, int);
81 
83 
86  void SetOutValue(double val);
87  vtkGetMacro(OutValue, double);
89 
91 
94  vtkGetMacro(UpperThreshold, double);
95  vtkGetMacro(LowerThreshold, double);
97 
99 
102  vtkSetMacro(OutputScalarType, int);
103  vtkGetMacro(OutputScalarType, int);
105  {this->SetOutputScalarType(VTK_DOUBLE);}
107  {this->SetOutputScalarType(VTK_FLOAT);}
109  {this->SetOutputScalarType(VTK_LONG);}
111  {this->SetOutputScalarType(VTK_UNSIGNED_LONG);};
113  {this->SetOutputScalarType(VTK_INT);}
115  {this->SetOutputScalarType(VTK_UNSIGNED_INT);}
117  {this->SetOutputScalarType(VTK_SHORT);}
119  {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);}
121  {this->SetOutputScalarType(VTK_CHAR);}
123  {this->SetOutputScalarType(VTK_SIGNED_CHAR);}
125  {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);}
127 
128 protected:
131 
135  double InValue;
137  double OutValue;
138 
140 
142 
144  vtkInformationVector **inputVector,
145  vtkInformationVector *outputVector,
146  vtkImageData ***inData, vtkImageData **outData,
147  int extent[6], int id);
148 
149 private:
150  vtkImageThreshold(const vtkImageThreshold&) VTK_DELETE_FUNCTION;
151  void operator=(const vtkImageThreshold&) VTK_DELETE_FUNCTION;
152 };
153 
154 #endif
155 
156 
157 
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
Flexible threshold.
void ThresholdBetween(double lower, double upper)
The values in a range (inclusive) match.
void SetOutValue(double val)
Replace the in range pixels with this value.
void SetOutputScalarTypeToDouble()
void SetOutputScalarTypeToSignedChar()
void SetOutputScalarTypeToUnsignedLong()
void SetInValue(double val)
Replace the in range pixels with this value.
void SetOutputScalarTypeToUnsignedShort()
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static vtkImageThreshold * New()
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int id)
If the subclass does not define an Execute method, then the task will be broken up,...
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to collect information from their inputs and set information f...
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()
void SetOutputScalarTypeToUnsignedInt()
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
@ extent
Definition: vtkX3D.h:345
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
#define VTK_SHORT
Definition: vtkType.h:52
#define VTK_UNSIGNED_INT
Definition: vtkType.h:55
#define VTK_DOUBLE
Definition: vtkType.h:59
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:51
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
#define VTK_INT
Definition: vtkType.h:54
#define VTK_SIGNED_CHAR
Definition: vtkType.h:50
#define VTK_FLOAT
Definition: vtkType.h:58
#define VTK_CHAR
Definition: vtkType.h:49
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:57
#define VTK_LONG
Definition: vtkType.h:56