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

Imaging/vtkImageDifference.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageDifference.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00044 #ifndef __vtkImageDifference_h
00045 #define __vtkImageDifference_h
00046 
00047 #include "vtkImageTwoInputFilter.h"
00048 
00049 class VTK_IMAGING_EXPORT vtkImageDifference : public vtkImageTwoInputFilter
00050 {
00051 public:
00052   static vtkImageDifference *New();
00053   vtkTypeRevisionMacro(vtkImageDifference,vtkImageTwoInputFilter);
00054   void PrintSelf(ostream& os, vtkIndent indent);
00055 
00057 
00058   void SetImage(vtkImageData *image) {this->SetInput2(image);}
00059   vtkImageData *GetImage() {return this->GetInput2();}
00061 
00063 
00064   void SetInput(vtkImageData *input) {this->SetInput1(input);}
00065   void SetInput(int num, vtkImageData *input)
00066     { this->vtkImageMultipleInputFilter::SetInput(num, input); };
00068   
00070 
00071   float GetError(void);
00072   void GetError(float *e) { *e = this->GetError(); };
00074   
00076 
00079   float GetThresholdedError(void);
00080   void GetThresholdedError(float *e) { *e = this->GetThresholdedError(); };
00082 
00083 
00085 
00086   vtkSetMacro(Threshold,int);
00087   vtkGetMacro(Threshold,int);
00089 
00091 
00096   vtkSetMacro(AllowShift,int);
00097   vtkGetMacro(AllowShift,int);
00098   vtkBooleanMacro(AllowShift,int);
00100 
00102 
00105   vtkSetMacro(Averaging,int);
00106   vtkGetMacro(Averaging,int);
00107   vtkBooleanMacro(Averaging,int);
00109 
00110 protected:
00111   vtkImageDifference();
00112   ~vtkImageDifference() {};
00113 
00114   float ErrorPerThread[VTK_MAX_THREADS];
00115   float ThresholdedErrorPerThread[VTK_MAX_THREADS];
00116   int AllowShift;
00117   int Threshold;
00118   int Averaging;
00119   
00120   void ExecuteInformation(vtkImageData **inputs, vtkImageData *output); 
00121   void ComputeInputUpdateExtent(int inExt[6], int outExt[6],
00122                                 int whichInput);
00123   void ExecuteInformation(){this->vtkImageTwoInputFilter::ExecuteInformation();};
00124   void ThreadedExecute(vtkImageData **inDatas, vtkImageData *outData,
00125                        int extent[6], int id);  
00126   
00127 private:
00128   vtkImageDifference(const vtkImageDifference&);  // Not implemented.
00129   void operator=(const vtkImageDifference&);  // Not implemented.
00130 };
00131 
00132 #endif
00133 
00134