VTK
dox/Filtering/vtkImageToImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImageToImageFilter.h
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 __vtkImageToImageFilter_h
00033 #define __vtkImageToImageFilter_h
00034 
00035 #include "vtkImageSource.h"
00036 
00037 class vtkMultiThreader;
00038 
00039 class VTK_FILTERING_EXPORT vtkImageToImageFilter : public vtkImageSource
00040 {
00041 public:
00042   vtkTypeMacro(vtkImageToImageFilter,vtkImageSource);
00043   void PrintSelf(ostream& os, vtkIndent indent);
00044 
00046 
00047   virtual void SetInput(vtkImageData *input);
00048   vtkImageData *GetInput();
00050   
00052 
00053   void SetBypass( int ) {};
00054   void BypassOn() {};
00055   void BypassOff() {};
00056   vtkGetMacro(Bypass,int);
00058 
00060 
00064   virtual void ThreadedExecute(vtkImageData *inData, 
00065                                vtkImageData *outData,
00066                                int extent[6], int threadId);
00068   
00070 
00071   vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00072   vtkGetMacro( NumberOfThreads, int );
00074 
00075   void SetInputMemoryLimit(int) 
00076     {vtkErrorMacro( << "SetInputMemoryLimit is obsolete: Use a vtkImageDataStreamer instead!" );};
00077   long GetInputMemoryLimit()
00078     {vtkErrorMacro( << "GetInputMemoryLimit is obsolete: Use a vtkImageDataStreamer instead!" ); return 0;};
00079 
00081 
00082   virtual int SplitExtent(int splitExt[6], int startExt[6], 
00083                           int num, int total);
00085 
00086 protected:
00087   vtkImageToImageFilter();
00088   ~vtkImageToImageFilter();
00089 
00090   vtkMultiThreader *Threader;
00091   int Bypass;
00092   int BypassWasOn;
00093   int NumberOfThreads;
00094   
00095   // This is called by the superclass.
00096   void ExecuteInformation();
00097   // This is the method you should override.
00098   virtual void ExecuteInformation(vtkImageData *inData, vtkImageData *outData);
00099 
00100   // This is called by the superclass.
00101   // This is the method you should override.
00102   void ExecuteData(vtkDataObject *output);
00103 
00104   // This also copies other arrays from point and cell data from input to output.
00105   virtual vtkImageData *AllocateOutputData(vtkDataObject *out);
00106   
00107   // The method that starts the multithreading
00108   void MultiThread(vtkImageData *input, vtkImageData *output);
00109 
00110   void ComputeInputUpdateExtents( vtkDataObject *output );
00111   virtual void ComputeInputUpdateExtent(int inExt[6], int outExt[6]);
00112 
00113   char *InputScalarsSelection;
00114   vtkSetStringMacro(InputScalarsSelection);
00115 
00116   virtual int FillInputPortInformation(int, vtkInformation*);
00117 
00118 private:
00119   vtkImageToImageFilter(const vtkImageToImageFilter&);  // Not implemented.
00120   void operator=(const vtkImageToImageFilter&);  // Not implemented.
00121 };
00122 
00123 #endif
00124 
00125 
00126 
00127 
00128 
00129 
00130