1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkSimpleImageToImageFilter.h,v $
6 Date: $Date: 2002/10/04 20:43:44 $
7 Version: $Revision: 1.11 $
9 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
11 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notice for more information.
17 =========================================================================*/
18 // .NAME vtkSimpleImageToImageFilter - Generic image filter with one input.
19 // .SECTION Description
20 // vtkSimpleImageToImageFilter is a filter which aims to avoid much
21 // of the complexity associated with vtkImageToImageFilter (i.e.
22 // support for pieces, multi-threaded operation). If you need to write
23 // a simple image-image filter which operates on the whole input, use
24 // this as the superclass. The subclass has to provide only an execute
25 // method which takes input and output as arguments. Memory allocation
26 // is handled in vtkSimpleImageToImageFilter. Also, you are guaranteed to
27 // have a valid input in the Execute(input, output) method. By default,
29 // requests it's input's whole extent and copies the input's information
30 // (spacing, whole extent etc...) to the output. If the output's setup
31 // is different (for example, if it performs some sort of sub-sampling),
32 // ExecuteInformation has to be overwritten. As an example of how this
33 // can be done, you can look at vtkImageShrink3D::ExecuteInformation.
34 // For a complete example which uses templates to support generic data
35 // types, see vtkSimpleFilterExample.
38 // vtkImageToImageFilter vtkSimpleImageFilterExample
40 #ifndef __vtkSimpleImageToImageFilter_h
41 #define __vtkSimpleImageToImageFilter_h
43 #include "vtkImageSource.h"
45 class VTK_FILTERING_EXPORT vtkSimpleImageToImageFilter : public vtkImageSource
48 vtkTypeRevisionMacro(vtkSimpleImageToImageFilter,vtkImageSource);
49 void PrintSelf(ostream& os, vtkIndent indent);
52 // Set the Input of a filter.
53 virtual void SetInput(vtkImageData *input);
54 vtkImageData *GetInput();
58 vtkSimpleImageToImageFilter();
59 ~vtkSimpleImageToImageFilter();
61 // These are called by the superclass.
62 // You might have to override ExecuteInformation
63 virtual void ExecuteInformation();
64 virtual void ComputeInputUpdateExtent(int inExt[6], int outExt[6]);
66 // You don't have to touch this unless you have a good reason.
67 virtual void ExecuteData(vtkDataObject *output);
68 // In the simplest case, this is the only method you need to define.
69 virtual void SimpleExecute(vtkImageData* input, vtkImageData* output) = 0;
71 vtkSimpleImageToImageFilter(const vtkSimpleImageToImageFilter&); // Not implemented.
72 void operator=(const vtkSimpleImageToImageFilter&); // Not implemented.