1 /*========================================================================= 2 3 Program: Visualization Toolkit 4 Module: vtkImageDivergence.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 =========================================================================*/ 15 /** 16 * @class vtkImageDivergence 17 * @brief Divergence of a vector field. 18 * 19 * vtkImageDivergence takes a 3D vector field 20 * and creates a scalar field which 21 * which represents the rate of change of the vector field. 22 * The definition of Divergence: 23 * Given V = P(x,y,z), Q(x,y,z), R(x,y,z), 24 * Divergence = dP/dx + dQ/dy + dR/dz. 25 */ 26 27 #ifndef vtkImageDivergence_h 28 #define vtkImageDivergence_h 29 30 #include "vtkImagingMathModule.h" // For export macro 31 #include "vtkThreadedImageAlgorithm.h" 32 33 class VTKIMAGINGMATH_EXPORT vtkImageDivergence : public vtkThreadedImageAlgorithm 34 { 35 public: 36 static vtkImageDivergence* New(); 37 vtkTypeMacro(vtkImageDivergence, vtkThreadedImageAlgorithm); 38 void PrintSelf(ostream& os, vtkIndent indent) override; 39 40 protected: 41 vtkImageDivergence(); 42 ~vtkImageDivergence() override = default; 43 44 int RequestUpdateExtent(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override; 45 int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override; 46 void ThreadedExecute(vtkImageData* inData, vtkImageData* outData, int ext[6], int id) override; 47 48 private: 49 vtkImageDivergence(const vtkImageDivergence&) = delete; 50 void operator=(const vtkImageDivergence&) = delete; 51 }; 52 53 #endif 54