iRoCS Toolbox  1.1.0
FastPhaseOnlyCorrelationFilter.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2015 Thorsten Falk
4  *
5  * Image Analysis Lab, University of Freiburg, Germany
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  **************************************************************************/
22 
23 /*======================================================================*/
28 /*======================================================================*/
29 
30 #ifndef ATBFASTPHASEONLYCORRELATIONFILTER_HH
31 #define ATBFASTPHASEONLYCORRELATIONFILTER_HH
32 
33 #ifdef HAVE_CONFIG_H
34 #include <config.hh>
35 #endif
36 
37 #include "Filter.hh"
38 
40 
41 #include <omp.h>
42 
43 namespace atb
44 {
45 
46 /*======================================================================*/
59 /*======================================================================*/
60  template<typename DataT, int Dim>
61  class FastPhaseOnlyCorrelationFilter : public Filter<DataT,Dim,DataT>
62  {
63 
64  public:
65 
66 /*======================================================================*/
81 /*======================================================================*/
83  blitz::Array<DataT,Dim> const &kernel,
85  DataT const &boundaryValue = traits<DataT>::zero);
86 
87 /*======================================================================*/
91 /*======================================================================*/
93 
94 /*======================================================================*/
107 /*======================================================================*/
108  void apply(
109  blitz::Array<DataT,Dim> const &data,
110  blitz::TinyVector<double,Dim> const &elementSizeUm,
111  blitz::Array<DataT,Dim> &result,
112  iRoCS::ProgressReporter *pr = NULL) const;
113 
114  // Explicitly force the name mangler to also consider the base class
115  // implementation
117 
118 /*======================================================================*/
136 /*======================================================================*/
137  static void apply(
138  blitz::Array<DataT,Dim> const &data,
139  blitz::TinyVector<double,Dim> const &elementSizeUm,
140  blitz::Array<DataT,Dim> &result,
141  blitz::Array<DataT,Dim> const &kernel,
143  DataT const &boundaryValue = traits<DataT>::zero,
144  iRoCS::ProgressReporter *pr = NULL);
145 
146 /*======================================================================*/
163 /*======================================================================*/
164  static void apply(
165  Array<DataT,Dim> const &data, Array<DataT,Dim> &result,
166  blitz::Array<DataT,Dim> const &kernel,
168  DataT const &boundaryValue = traits<DataT>::zero,
169  iRoCS::ProgressReporter *pr = NULL);
170 
171  private:
172 
173  blitz::Array<DataT,Dim> const &_kernel;
174  mutable blitz::Array<std::complex<DataT>,Dim> _kernelFFTCache;
175  static DataT const eps;
176 
177  };
178 
179 }
180 
181 #include "FastPhaseOnlyCorrelationFilter.icc"
182 
183 #endif
Base class (Interface) for all Filter implementations.
The Filter class is the base class for all filter implementations.
Definition: Filter.hh:55
The Array class is an extension to the blitz++ Array class providing additional parameters element si...
Definition: Array.hh:85
BoundaryTreatmentType
BoundaryTreatment.hh "libArrayToolbox/BoundaryTreatment.hh".
FastPhaseOnlyCorrelationFilter(blitz::Array< DataT, Dim > const &kernel, BoundaryTreatmentType bt=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
Constructor.
The traits class provides means to query specific information about different data types...
Definition: TypeTraits.hh:73
void apply(blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< DataT, Dim > &result, iRoCS::ProgressReporter *pr=NULL) const
Apply the filter to the given Array.
The FastPhaseOnlyCorrelationFilter class provides phase-only cross-correlation for n-D Arrays employi...
Treat positions beyond the Array domain as having a constant value.