VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageThreshold.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00026 #ifndef __vtkImageThreshold_h 00027 #define __vtkImageThreshold_h 00028 00029 00030 #include "vtkThreadedImageAlgorithm.h" 00031 00032 class VTK_IMAGING_EXPORT vtkImageThreshold : public vtkThreadedImageAlgorithm 00033 { 00034 public: 00035 static vtkImageThreshold *New(); 00036 vtkTypeMacro(vtkImageThreshold,vtkThreadedImageAlgorithm); 00037 void PrintSelf(ostream& os, vtkIndent indent); 00038 00040 void ThresholdByUpper(double thresh); 00041 00043 void ThresholdByLower(double thresh); 00044 00046 void ThresholdBetween(double lower, double upper); 00047 00049 00050 vtkSetMacro(ReplaceIn, int); 00051 vtkGetMacro(ReplaceIn, int); 00052 vtkBooleanMacro(ReplaceIn, int); 00054 00056 00057 void SetInValue(double val); 00058 vtkGetMacro(InValue, double); 00060 00062 00063 vtkSetMacro(ReplaceOut, int); 00064 vtkGetMacro(ReplaceOut, int); 00065 vtkBooleanMacro(ReplaceOut, int); 00067 00069 00070 void SetOutValue(double val); 00071 vtkGetMacro(OutValue, double); 00073 00075 00076 vtkGetMacro(UpperThreshold, double); 00077 vtkGetMacro(LowerThreshold, double); 00079 00081 00082 vtkSetMacro(OutputScalarType, int); 00083 vtkGetMacro(OutputScalarType, int); 00084 void SetOutputScalarTypeToDouble() 00085 {this->SetOutputScalarType(VTK_DOUBLE);} 00086 void SetOutputScalarTypeToFloat() 00087 {this->SetOutputScalarType(VTK_FLOAT);} 00088 void SetOutputScalarTypeToLong() 00089 {this->SetOutputScalarType(VTK_LONG);} 00090 void SetOutputScalarTypeToUnsignedLong() 00091 {this->SetOutputScalarType(VTK_UNSIGNED_LONG);}; 00092 void SetOutputScalarTypeToInt() 00093 {this->SetOutputScalarType(VTK_INT);} 00094 void SetOutputScalarTypeToUnsignedInt() 00095 {this->SetOutputScalarType(VTK_UNSIGNED_INT);} 00096 void SetOutputScalarTypeToShort() 00097 {this->SetOutputScalarType(VTK_SHORT);} 00098 void SetOutputScalarTypeToUnsignedShort() 00099 {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);} 00100 void SetOutputScalarTypeToChar() 00101 {this->SetOutputScalarType(VTK_CHAR);} 00102 void SetOutputScalarTypeToSignedChar() 00103 {this->SetOutputScalarType(VTK_SIGNED_CHAR);} 00104 void SetOutputScalarTypeToUnsignedChar() 00105 {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);} 00107 00108 protected: 00109 vtkImageThreshold(); 00110 ~vtkImageThreshold() {}; 00111 00112 double UpperThreshold; 00113 double LowerThreshold; 00114 int ReplaceIn; 00115 double InValue; 00116 int ReplaceOut; 00117 double OutValue; 00118 00119 int OutputScalarType; 00120 00121 virtual int RequestInformation (vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00122 00123 void ThreadedRequestData(vtkInformation *request, 00124 vtkInformationVector **inputVector, 00125 vtkInformationVector *outputVector, 00126 vtkImageData ***inData, vtkImageData **outData, 00127 int extent[6], int id); 00128 00129 private: 00130 vtkImageThreshold(const vtkImageThreshold&); // Not implemented. 00131 void operator=(const vtkImageThreshold&); // Not implemented. 00132 }; 00133 00134 #endif 00135 00136 00137