Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkImageToImageFilter.h

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