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

Imaging/vtkImageMask.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageMask.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 =========================================================================*/
00032 #ifndef __vtkImageMask_h
00033 #define __vtkImageMask_h
00034 
00035 
00036 #include "vtkImageTwoInputFilter.h"
00037 
00038 class VTK_IMAGING_EXPORT vtkImageMask : public vtkImageTwoInputFilter
00039 {
00040 public:
00041   static vtkImageMask *New();
00042   vtkTypeRevisionMacro(vtkImageMask,vtkImageTwoInputFilter);
00043   void PrintSelf(ostream& os, vtkIndent indent);
00044 
00046 
00047   void SetMaskedOutputValue(int num, double *v);
00048   void SetMaskedOutputValue(double v) {this->SetMaskedOutputValue(1, &v);}
00049   void SetMaskedOutputValue(double v1, double v2) 
00050     {double v[2]; v[0]=v1; v[1]=v2; this->SetMaskedOutputValue(2, v);}
00051   void SetMaskedOutputValue(double v1, double v2, double v3) 
00052     {double v[3]; v[0]=v1; v[1]=v2; v[2]=v3; this->SetMaskedOutputValue(3, v);}
00053   double *GetMaskedOutputValue() {return this->MaskedOutputValue;}
00054   int GetMaskedOutputValueLength() {return this->MaskedOutputValueLength;}
00056 
00058 
00061   vtkSetClampMacro ( MaskAlpha, double, 0.0, 1.0 );
00062   vtkGetMacro ( MaskAlpha, double );
00064 
00066   void SetImageInput(vtkImageData *in) {this->SetInput1(in);}
00067 
00069   void SetMaskInput(vtkImageData *in) {this->SetInput2(in);}
00070   
00072 
00076   vtkSetMacro(NotMask,int);
00077   vtkGetMacro(NotMask,int);
00078   vtkBooleanMacro(NotMask, int);
00080   
00081 protected:
00082   vtkImageMask();
00083   ~vtkImageMask();
00084 
00085   double *MaskedOutputValue;
00086   int MaskedOutputValueLength;
00087   int NotMask;
00088   double MaskAlpha;
00089   
00090   void ExecuteInformation(vtkImageData **inDatas, vtkImageData *outData);
00091   void ExecuteInformation(){this->vtkImageTwoInputFilter::ExecuteInformation();};
00092  
00093   void ThreadedExecute(vtkImageData **inDatas, vtkImageData *outData,
00094                        int extent[6], int id);
00095 private:
00096   vtkImageMask(const vtkImageMask&);  // Not implemented.
00097   void operator=(const vtkImageMask&);  // Not implemented.
00098 };
00099 
00100 #endif
00101 
00102 
00103