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