00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkImageIterateFilter.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 =========================================================================*/ 00040 #ifndef __vtkImageIterateFilter_h 00041 #define __vtkImageIterateFilter_h 00042 00043 00044 #include "vtkImageToImageFilter.h" 00045 00046 class VTK_IMAGING_EXPORT vtkImageIterateFilter : public vtkImageToImageFilter 00047 { 00048 public: 00049 vtkTypeRevisionMacro(vtkImageIterateFilter,vtkImageToImageFilter); 00050 void PrintSelf(ostream& os, vtkIndent indent); 00051 00053 00055 vtkGetMacro(Iteration,int); 00056 vtkGetMacro(NumberOfIterations,int); 00058 00059 void ComputeInputUpdateExtents( vtkDataObject *output ); 00060 //BTX 00061 void ComputeInputUpdateExtent( int [6], int [6] ) 00062 { vtkErrorMacro( << "ComputeInputUpdateExtent should be implemented in subclass" );}; 00063 //ETX 00064 00065 protected: 00066 vtkImageIterateFilter(); 00067 ~vtkImageIterateFilter(); 00068 00069 // Superclass API. Sets defaults, then calls 00070 // ExecuteInformation(vtkImageData *inData, vtkImageData *outData) 00071 // for each iteration 00072 void ExecuteInformation(); 00073 // Called for each iteration (differs from superclass in arguments). 00074 // You should override this method if needed. 00075 virtual void ExecuteInformation(vtkImageData *inData, vtkImageData *outData); 00076 00077 // Superclass API: Calls Execute(vtkImageData *inData, vtkImageData *outData) 00078 // for each iteration. 00079 void ExecuteData(vtkDataObject *output); 00080 virtual void IterativeExecuteData(vtkImageData *in, vtkImageData *out) = 0; 00081 00082 // Replaces "EnlargeOutputUpdateExtent" 00083 virtual void AllocateOutputScalars(vtkImageData *outData); 00084 00085 // Allows subclass to specify the number of iterations 00086 virtual void SetNumberOfIterations(int num); 00087 00088 // for filters that execute multiple times. 00089 int NumberOfIterations; 00090 int Iteration; 00091 // A list of intermediate caches that is created when 00092 // is called SetNumberOfIterations() 00093 vtkImageData **IterationData; 00094 00095 // returns correct vtkImageDatas based on current iteration. 00096 vtkImageData *GetIterationInput(); 00097 vtkImageData *GetIterationOutput(); 00098 private: 00099 vtkImageIterateFilter(const vtkImageIterateFilter&); // Not implemented. 00100 void operator=(const vtkImageIterateFilter&); // Not implemented. 00101 }; 00102 00103 #endif 00104 00105 00106 00107 00108 00109 00110