OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / include / vtk / vtkImageConvolve.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkImageConvolve.h,v $
5   Language:  C++
6   Date:      $Date: 2002/01/22 15:32:11 $
7   Version:   $Revision: 1.11 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
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.
16
17 =========================================================================*/
18 // .NAME vtkImageConvolve - Convolution of an image with a kernel.
19 // .SECTION Description
20 // vtkImageConvolve convolves the image with a 3D NxNxN kernel or a
21 // 2D NxN kernal.  The output image is cropped to the same size as
22 // the input.
23
24 #ifndef __vtkImageConvolve_h
25 #define __vtkImageConvolve_h
26
27 #include "vtkImageToImageFilter.h"
28
29 class VTK_IMAGING_EXPORT vtkImageConvolve : public vtkImageToImageFilter
30 {
31 public:
32   // Description:
33   // Construct an instance of vtkImageConvolve filter.
34   static vtkImageConvolve *New();
35   vtkTypeRevisionMacro(vtkImageConvolve,vtkImageToImageFilter);
36   void PrintSelf(ostream& os, vtkIndent indent);
37
38   // Description:
39   // Get the kernel size
40   vtkGetVector3Macro(KernelSize, int);
41
42   // Description:
43   // Set the kernel to be a given 3x3 or 5x5 or 7x7 kernel.
44   void SetKernel3x3(const float kernel[9]);
45   void SetKernel5x5(const float kernel[25]);
46 //BTX
47   void SetKernel7x7(float kernel[49]);
48 //ETX
49
50   // Description:
51   // Return an array that contains the kernel.
52   float* GetKernel3x3(); 
53   void GetKernel3x3(float kernel[9]);
54   float* GetKernel5x5(); 
55   void GetKernel5x5(float kernel[25]);
56 //BTX
57   float* GetKernel7x7(); 
58   void GetKernel7x7(float kernel[49]);
59 //ETX
60
61   // Description:
62   // Set the kernel to be a 3x3x3 or 5x5x5 or 7x7x7 kernel.
63   void SetKernel3x3x3(const float kernel[27]);
64 //BTX
65   void SetKernel5x5x5(float kernel[125]);
66   void SetKernel7x7x7(float kernel[343]);
67 //ETX
68
69   // Description:
70   // Return an array that contains the kernel
71   float* GetKernel3x3x3(); 
72   void GetKernel3x3x3(float kernel[27]);
73 //BTX
74   float* GetKernel5x5x5(); 
75   void GetKernel5x5x5(float kernel[125]);
76   float* GetKernel7x7x7(); 
77   void GetKernel7x7x7(float kernel[343]);
78 //ETX
79
80 protected:
81   vtkImageConvolve();
82   ~vtkImageConvolve();
83
84   void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, 
85                        int outExt[6], int id);
86
87   void GetKernel(float *kernel);
88   float* GetKernel();
89   void SetKernel(const float* kernel,
90                  int sizeX, int sizeY, int sizeZ);
91   
92
93   int KernelSize[3];
94   float Kernel[343];
95 private:
96   vtkImageConvolve(const vtkImageConvolve&);  // Not implemented.
97   void operator=(const vtkImageConvolve&);  // Not implemented.
98 };
99
100 #endif
101
102
103