VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageMask.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 =========================================================================*/ 00032 #ifndef vtkImageMask_h 00033 #define vtkImageMask_h 00034 00035 00036 #include "vtkImagingCoreModule.h" // For export macro 00037 #include "vtkThreadedImageAlgorithm.h" 00038 00039 class VTKIMAGINGCORE_EXPORT vtkImageMask : public vtkThreadedImageAlgorithm 00040 { 00041 public: 00042 static vtkImageMask *New(); 00043 vtkTypeMacro(vtkImageMask,vtkThreadedImageAlgorithm); 00044 void PrintSelf(ostream& os, vtkIndent indent); 00045 00047 00048 void SetMaskedOutputValue(int num, double *v); 00049 void SetMaskedOutputValue(double v) {this->SetMaskedOutputValue(1, &v);} 00050 void SetMaskedOutputValue(double v1, double v2) 00051 {double v[2]; v[0]=v1; v[1]=v2; this->SetMaskedOutputValue(2, v);} 00052 void SetMaskedOutputValue(double v1, double v2, double v3) 00053 {double v[3]; v[0]=v1; v[1]=v2; v[2]=v3; this->SetMaskedOutputValue(3, v);} 00054 double *GetMaskedOutputValue() {return this->MaskedOutputValue;} 00055 int GetMaskedOutputValueLength() {return this->MaskedOutputValueLength;} 00057 00059 00062 vtkSetClampMacro ( MaskAlpha, double, 0.0, 1.0 ); 00063 vtkGetMacro ( MaskAlpha, double ); 00065 00067 void SetImageInputData(vtkImageData *in); 00068 00070 void SetMaskInputData(vtkImageData *in); 00071 00073 00077 vtkSetMacro(NotMask,int); 00078 vtkGetMacro(NotMask,int); 00079 vtkBooleanMacro(NotMask, int); 00081 00083 00084 virtual void SetInput1Data(vtkDataObject *in) { this->SetInputData(0,in); } 00085 virtual void SetInput2Data(vtkDataObject *in) { this->SetInputData(1,in); } 00087 00088 protected: 00089 vtkImageMask(); 00090 ~vtkImageMask(); 00091 00092 double *MaskedOutputValue; 00093 int MaskedOutputValueLength; 00094 int NotMask; 00095 double MaskAlpha; 00096 00097 virtual int RequestInformation (vtkInformation *, 00098 vtkInformationVector **, 00099 vtkInformationVector *); 00100 00101 00102 virtual void ThreadedRequestData(vtkInformation *request, 00103 vtkInformationVector **inputVector, 00104 vtkInformationVector *outputVector, 00105 vtkImageData ***inData, 00106 vtkImageData **outData, 00107 int extent[6], int threadId); 00108 00109 private: 00110 vtkImageMask(const vtkImageMask&); // Not implemented. 00111 void operator=(const vtkImageMask&); // Not implemented. 00112 }; 00113 00114 #endif 00115 00116 00117