Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Imaging/vtkImageThreshold.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageThreshold.h,v $
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 "vtkImageToImageFilter.h"
00031 
00032 class VTK_IMAGING_EXPORT vtkImageThreshold : public vtkImageToImageFilter
00033 {
00034 public:
00035   static vtkImageThreshold *New();
00036   vtkTypeRevisionMacro(vtkImageThreshold,vtkImageToImageFilter);
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 SetOutputScalarTypeToUnsignedChar()
00103     {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);}
00105   
00106 protected:
00107   vtkImageThreshold();
00108   ~vtkImageThreshold() {};
00109 
00110   double UpperThreshold;
00111   double LowerThreshold;
00112   int ReplaceIn;
00113   double InValue;
00114   int ReplaceOut;
00115   double OutValue;
00116   
00117   int OutputScalarType;
00118 
00119   void ExecuteInformation(vtkImageData *inData, vtkImageData *outData);
00120   void ExecuteInformation(){this->vtkImageToImageFilter::ExecuteInformation();};
00121   void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, 
00122                        int extent[6], int id);
00123 private:
00124   vtkImageThreshold(const vtkImageThreshold&);  // Not implemented.
00125   void operator=(const vtkImageThreshold&);  // Not implemented.
00126 };
00127 
00128 #endif
00129 
00130 
00131