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

Filtering/vtkImageToImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageToImageFilter.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 =========================================================================*/
00046 #ifndef __vtkImageToImageFilter_h
00047 #define __vtkImageToImageFilter_h
00048 
00049 #include "vtkImageSource.h"
00050 
00051 class vtkMultiThreader;
00052 
00053 class VTK_FILTERING_EXPORT vtkImageToImageFilter : public vtkImageSource
00054 {
00055 public:
00056   vtkTypeRevisionMacro(vtkImageToImageFilter,vtkImageSource);
00057   void PrintSelf(ostream& os, vtkIndent indent);
00058 
00060 
00061   virtual void SetInput(vtkImageData *input);
00062   vtkImageData *GetInput();
00064   
00066 
00067   void SetBypass( int ) {};
00068   void BypassOn() {};
00069   void BypassOff() {};
00070   vtkGetMacro(Bypass,int);
00072 
00074 
00078   virtual void ThreadedExecute(vtkImageData *inData, 
00079                                vtkImageData *outData,
00080                                int extent[6], int threadId);
00082   
00084 
00085   vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00086   vtkGetMacro( NumberOfThreads, int );
00088 
00089   void SetInputMemoryLimit(int) 
00090     {vtkErrorMacro( << "SetInputMemoryLimit is obsolete: Use a vtkImageDataStreamer instead!" );};
00091   long GetInputMemoryLimit()
00092     {vtkErrorMacro( << "GetInputMemoryLimit is obsolete: Use a vtkImageDataStreamer instead!" ); return 0;};
00093 
00095 
00096   virtual int SplitExtent(int splitExt[6], int startExt[6], 
00097                           int num, int total);
00099 
00100 protected:
00101   vtkImageToImageFilter();
00102   ~vtkImageToImageFilter();
00103 
00104   vtkMultiThreader *Threader;
00105   int Bypass;
00106   int BypassWasOn;
00107   int NumberOfThreads;
00108   
00109   // This is called by the superclass.
00110   void ExecuteInformation();
00111   // This is the method you should override.
00112   virtual void ExecuteInformation(vtkImageData *inData, vtkImageData *outData);
00113 
00114   // This is called by the superclass.
00115   // This is the method you should override.
00116   void ExecuteData(vtkDataObject *output);
00117 
00118   // This also copies other arrays from point and cell data from input to output.
00119   virtual vtkImageData *AllocateOutputData(vtkDataObject *out);
00120   
00121   // The method that starts the multithreading
00122   void MultiThread(vtkImageData *input, vtkImageData *output);
00123 
00124   void ComputeInputUpdateExtents( vtkDataObject *output );
00125   virtual void ComputeInputUpdateExtent(int inExt[6], int outExt[6]);
00126 
00127   char *InputScalarsSelection;
00128   vtkSetStringMacro(InputScalarsSelection);
00129 
00130 private:
00131   vtkImageToImageFilter(const vtkImageToImageFilter&);  // Not implemented.
00132   void operator=(const vtkImageToImageFilter&);  // Not implemented.
00133 };
00134 
00135 #endif
00136 
00137 
00138 
00139 
00140 
00141 
00142