VTK
dox/Imaging/Morphological/vtkImageThresholdConnectivity.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImageThresholdConnectivity.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 =========================================================================*/
00035 #ifndef __vtkImageThresholdConnectivity_h
00036 #define __vtkImageThresholdConnectivity_h
00037 
00038 #include "vtkImagingMorphologicalModule.h" // For export macro
00039 #include "vtkImageAlgorithm.h"
00040 
00041 class vtkPoints;
00042 class vtkImageData;
00043 class vtkImageStencilData;
00044 
00045 class VTKIMAGINGMORPHOLOGICAL_EXPORT vtkImageThresholdConnectivity :
00046   public vtkImageAlgorithm
00047 {
00048 public:
00049   static vtkImageThresholdConnectivity *New();
00050   vtkTypeMacro(vtkImageThresholdConnectivity, vtkImageAlgorithm);
00051   void PrintSelf(ostream& os, vtkIndent indent);
00052 
00054 
00056   void SetSeedPoints(vtkPoints *points);
00057   vtkGetObjectMacro(SeedPoints, vtkPoints);
00059 
00061   void ThresholdByUpper(double thresh);
00062 
00064   void ThresholdByLower(double thresh);
00065 
00068   void ThresholdBetween(double lower, double upper);
00069 
00071 
00072   vtkSetMacro(ReplaceIn, int);
00073   vtkGetMacro(ReplaceIn, int);
00074   vtkBooleanMacro(ReplaceIn, int);
00076 
00078 
00080   void SetInValue(double val);
00081   vtkGetMacro(InValue, double);
00083 
00085 
00086   vtkSetMacro(ReplaceOut, int);
00087   vtkGetMacro(ReplaceOut, int);
00088   vtkBooleanMacro(ReplaceOut, int);
00090 
00092 
00094   void SetOutValue(double val);
00095   vtkGetMacro(OutValue, double);
00097 
00099 
00100   vtkGetMacro(UpperThreshold, double);
00101   vtkGetMacro(LowerThreshold, double);
00103 
00105 
00106   vtkSetVector2Macro(SliceRangeX, int);
00107   vtkGetVector2Macro(SliceRangeX, int);
00108   vtkSetVector2Macro(SliceRangeY, int);
00109   vtkGetVector2Macro(SliceRangeY, int);
00110   vtkSetVector2Macro(SliceRangeZ, int);
00111   vtkGetVector2Macro(SliceRangeZ, int);
00113 
00115 
00117   virtual void SetStencilData(vtkImageStencilData *stencil);
00118   vtkImageStencilData *GetStencil();
00120 
00122 
00124   vtkSetMacro(ActiveComponent,int);
00125   vtkGetMacro(ActiveComponent,int);
00127 
00129 
00133   vtkSetVector3Macro(NeighborhoodRadius, double);
00134   vtkGetVector3Macro(NeighborhoodRadius, double);
00136 
00138 
00140   vtkSetClampMacro(NeighborhoodFraction, double, 0.0, 1.0);
00141   vtkGetMacro(NeighborhoodFraction, double);
00143 
00145   unsigned long GetMTime();
00146 
00148 
00150   vtkGetMacro(NumberOfInVoxels, int);
00152 
00153 protected:
00154   vtkImageThresholdConnectivity();
00155   ~vtkImageThresholdConnectivity();
00156 
00157   double UpperThreshold;
00158   double LowerThreshold;
00159   double InValue;
00160   double OutValue;
00161   int ReplaceIn;
00162   int ReplaceOut;
00163 
00164   double NeighborhoodRadius[3];
00165   double NeighborhoodFraction;
00166 
00167   vtkPoints *SeedPoints;
00168 
00169   int SliceRangeX[2];
00170   int SliceRangeY[2];
00171   int SliceRangeZ[2];
00172 
00173   int NumberOfInVoxels;
00174 
00175   int ActiveComponent;
00176 
00177   vtkImageData *ImageMask;
00178 
00179   void ComputeInputUpdateExtent(int inExt[6], int outExt[6]);
00180 
00181   virtual int FillInputPortInformation(int port, vtkInformation *info);
00182   virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **,
00183                                   vtkInformationVector *);
00184   virtual int RequestData(vtkInformation *, vtkInformationVector **,
00185                           vtkInformationVector *);
00186 
00187 private:
00188   vtkImageThresholdConnectivity(const vtkImageThresholdConnectivity&);  // Not implemented.
00189   void operator=(const vtkImageThresholdConnectivity&);  // Not implemented.
00190 };
00191 
00192 #endif