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) VTK_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, int);
58  vtkGetMacro(ReplaceIn, int);
59  vtkBooleanMacro(ReplaceIn, int);
61 
63 
66  void SetInValue(double val);
67  vtkGetMacro(InValue, double);
69 
71 
74  vtkSetMacro(ReplaceOut, int);
75  vtkGetMacro(ReplaceOut, int);
76  vtkBooleanMacro(ReplaceOut, int);
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()VTK_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) VTK_OVERRIDE;
145 
146 private:
147  vtkImageThreshold(const vtkImageThreshold&) VTK_DELETE_FUNCTION;
148  void operator=(const vtkImageThreshold&) VTK_DELETE_FUNCTION;
149 };
150 
151 #endif
152 
153 
154 
#define VTK_UNSIGNED_INT
Definition: vtkType.h:55
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.
~vtkImageThreshold() override
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
void SetOutputScalarTypeToSignedChar()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToInt()
Set the desired output scalar type to cast to.
Flexible threshold.
#define VTK_DOUBLE
Definition: vtkType.h:59
Generic filter that has one input.
#define VTK_FLOAT
Definition: vtkType.h:58
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
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:52
void SetOutputScalarTypeToFloat()
Set the desired output scalar type to cast to.
#define VTK_CHAR
Definition: vtkType.h:49
#define VTK_LONG
Definition: vtkType.h:56
void SetOutputScalarTypeToDouble()
Set the desired output scalar type to cast to.
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, multiple threads will be spawned, and each thread will call this method.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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:50
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:51
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:57
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
#define VTK_INT
Definition: vtkType.h:54
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type to cast to.