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 
31 
32 #include "vtkImagingGeneralModule.h" // For export macro
33 #include "vtkThreadedImageAlgorithm.h"
34 
35 class VTKIMAGINGGENERAL_EXPORT vtkImageCorrelation : public vtkThreadedImageAlgorithm
36 {
37 public:
38   static vtkImageCorrelation *New();
39   vtkTypeMacro(vtkImageCorrelation,vtkThreadedImageAlgorithm);
40   void PrintSelf(ostream& os, vtkIndent indent) override;
41 
42   //@{
43   /**
44    * Determines how the input is interpreted (set of 2d slices ...).
45    * The default is 2.
46    */
47   vtkSetClampMacro(Dimensionality,int,2,3);
48   vtkGetMacro(Dimensionality,int);
49   //@}
50 
51   /**
52    * Set the input image.
53    */
SetInput1Data(vtkDataObject * in)54   virtual void SetInput1Data(vtkDataObject *in) { this->SetInputData(0,in); }
55 
56   /**
57    * Set the correlation kernel.
58    */
SetInput2Data(vtkDataObject * in)59   virtual void SetInput2Data(vtkDataObject *in) { this->SetInputData(1,in); }
60 
61 protected:
62   vtkImageCorrelation();
~vtkImageCorrelation()63   ~vtkImageCorrelation() override {}
64 
65   int Dimensionality;
66   int RequestInformation (vtkInformation *,
67                                   vtkInformationVector **,
68                                   vtkInformationVector *) override;
69   int RequestUpdateExtent(vtkInformation*,
70                                    vtkInformationVector**,
71                                    vtkInformationVector*) override;
72 
73   void ThreadedRequestData(vtkInformation *request,
74                                    vtkInformationVector **inputVector,
75                                    vtkInformationVector *outputVector,
76                                    vtkImageData ***inData,
77                                    vtkImageData **outData,
78                                    int extent[6], int threadId) override;
79 
80 private:
81   vtkImageCorrelation(const vtkImageCorrelation&) = delete;
82   void operator=(const vtkImageCorrelation&) = delete;
83 };
84 
85 #endif
86 
87 
88 
89