VTK  9.1.0
vtkImageConvolve.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageConvolve.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
43 #ifndef vtkImageConvolve_h
44 #define vtkImageConvolve_h
45 
46 #include "vtkImagingGeneralModule.h" // For export macro
48 
49 class VTKIMAGINGGENERAL_EXPORT vtkImageConvolve : public vtkThreadedImageAlgorithm
50 {
51 public:
53 
56  static vtkImageConvolve* New();
58  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
62 
65  vtkGetVector3Macro(KernelSize, int);
67 
69 
72  void SetKernel3x3(const double kernel[9]);
73  void SetKernel5x5(const double kernel[25]);
75 
76  void SetKernel7x7(const double kernel[49]);
77 
79 
82  double* GetKernel3x3() VTK_SIZEHINT(9);
83  void GetKernel3x3(double kernel[9]);
84  double* GetKernel5x5() VTK_SIZEHINT(25);
85  void GetKernel5x5(double kernel[25]);
87 
88  double* GetKernel7x7() VTK_SIZEHINT(49);
89  void GetKernel7x7(double kernel[49]);
90 
94  void SetKernel3x3x3(const double kernel[27]);
95 
96  void SetKernel5x5x5(const double kernel[125]);
97  void SetKernel7x7x7(const double kernel[343]);
98 
100 
103  double* GetKernel3x3x3() VTK_SIZEHINT(27);
104  void GetKernel3x3x3(double kernel[27]);
106 
107  double* GetKernel5x5x5() VTK_SIZEHINT(125);
108  void GetKernel5x5x5(double kernel[125]);
109  double* GetKernel7x7x7() VTK_SIZEHINT(343);
110  void GetKernel7x7x7(double kernel[343]);
111 
112 protected:
114  ~vtkImageConvolve() override;
115 
116  void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
117  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
118  int outExt[6], int id) override;
119 
120  void GetKernel(double* kernel);
121  double* GetKernel();
122  void SetKernel(const double* kernel, int sizeX, int sizeY, int sizeZ);
123 
124  int KernelSize[3];
125  double Kernel[343];
126 
127 private:
128  vtkImageConvolve(const vtkImageConvolve&) = delete;
129  void operator=(const vtkImageConvolve&) = delete;
130 };
131 
132 #endif
Convolution of an image with a kernel.
double * GetKernel3x3()
Return an array that contains the kernel.
void SetKernel3x3(const double kernel[9])
Set the kernel to be a given 3x3 or 5x5 or 7x7 kernel.
void SetKernel7x7(const double kernel[49])
void SetKernel5x5(const double kernel[25])
Set the kernel to be a given 3x3 or 5x5 or 7x7 kernel.
static vtkImageConvolve * New()
Construct an instance of vtkImageConvolve filter.
void PrintSelf(ostream &os, vtkIndent indent) override
Construct an instance of vtkImageConvolve filter.
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
#define VTK_SIZEHINT(...)