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