1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkImageCorrelation.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   vtkImageCorrelation
17  * @brief   Correlation imageof the two inputs.
18  *
19  * vtkImageCorrelation finds the correlation between two data sets.
20  * SetDimensionality determines
21  * whether the Correlation will be 3D, 2D or 1D.
22  * The default is a 2D Correlation.  The Output type will be double.
23  * The output size will match the size of the first input.
24  * The second input is considered the correlation kernel.
25  */
26 
27 #ifndef vtkImageCorrelation_h
28 #define vtkImageCorrelation_h
29 
30 #include "vtkImagingGeneralModule.h" // For export macro
31 #include "vtkThreadedImageAlgorithm.h"
32 
33 class VTKIMAGINGGENERAL_EXPORT vtkImageCorrelation : public vtkThreadedImageAlgorithm
34 {
35 public:
36   static vtkImageCorrelation* New();
37   vtkTypeMacro(vtkImageCorrelation, vtkThreadedImageAlgorithm);
38   void PrintSelf(ostream& os, vtkIndent indent) override;
39 
40   ///@{
41   /**
42    * Determines how the input is interpreted (set of 2d slices ...).
43    * The default is 2.
44    */
45   vtkSetClampMacro(Dimensionality, int, 2, 3);
46   vtkGetMacro(Dimensionality, int);
47   ///@}
48 
49   /**
50    * Set the input image.
51    */
SetInput1Data(vtkDataObject * in)52   virtual void SetInput1Data(vtkDataObject* in) { this->SetInputData(0, in); }
53 
54   /**
55    * Set the correlation kernel.
56    */
SetInput2Data(vtkDataObject * in)57   virtual void SetInput2Data(vtkDataObject* in) { this->SetInputData(1, in); }
58 
59 protected:
60   vtkImageCorrelation();
61   ~vtkImageCorrelation() override = default;
62 
63   int Dimensionality;
64   int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
65   int RequestUpdateExtent(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
66 
67   void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
68     vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
69     int outExt[6], int threadId) override;
70 
71 private:
72   vtkImageCorrelation(const vtkImageCorrelation&) = delete;
73   void operator=(const vtkImageCorrelation&) = delete;
74 };
75 
76 #endif
77