iRoCS Toolbox  1.1.0
CentralHessianUTFilter.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 /*======================================================================*/
29 /*======================================================================*/
30 
31 #ifndef ATBCENTRALHESSIANUTFILTER_HH
32 #define ATBCENTRALHESSIANUTFILTER_HH
33 
34 #ifdef HAVE_CONFIG_H
35 #include <config.hh>
36 #endif
37 
38 #include "CentralGradientFilter.hh"
39 
40 namespace atb
41 {
42 
43 /*======================================================================*/
52 /*======================================================================*/
53  template<typename DataT, int Dim>
55  public SeparableFilter<
56  DataT,Dim,blitz::TinyVector<DataT,Dim * (Dim + 1) / 2> >
57  {
58 
59  public:
60 
61  typedef blitz::TinyVector<DataT,Dim * (Dim + 1) / 2> ResultT;
62 
63 /*======================================================================*/
72 /*======================================================================*/
75  DataT const &boundaryValue = traits<DataT>::zero);
76 
77 /*======================================================================*/
86 /*======================================================================*/
90  DataT const &boundaryValue = traits<DataT>::zero);
91 
92 /*======================================================================*/
96 /*======================================================================*/
97  virtual ~CentralHessianUTFilter();
98 
99 /*======================================================================*/
106 /*======================================================================*/
108 
109 /*======================================================================*/
116 /*======================================================================*/
117  void setAccuracy(
119 
120 /*======================================================================*/
131 /*======================================================================*/
132  static blitz::TinyVector<int,2> indexToMatrixPosition(int dim);
133 
134 /*======================================================================*/
143 /*======================================================================*/
144  static int matrixPositionToIndex(blitz::TinyVector<int,2> const &pos);
145 
146 /*======================================================================*/
158 /*======================================================================*/
159  virtual void applyAlongDim(
160  blitz::Array<DataT,Dim> const &data,
161  blitz::TinyVector<double,Dim> const &elementSizeUm,
162  blitz::Array<DataT,Dim> &filtered, int dim,
163  iRoCS::ProgressReporter *pr = NULL) const;
164 
165 /*======================================================================*/
177 /*======================================================================*/
178  virtual void applyAlongDim(
179  blitz::Array<DataT,Dim> const &data,
180  blitz::TinyVector<double,Dim> const &elementSizeUm,
181  blitz::Array<ResultT,Dim> &filtered, int dim,
182  iRoCS::ProgressReporter *pr = NULL) const;
183 
184  // Explicitly force the name mangler to also consider the base class
185  // implementation
187 
188 /*======================================================================*/
199 /*======================================================================*/
200  virtual void apply(
201  blitz::Array<DataT,Dim> const &data,
202  blitz::TinyVector<double,Dim> const &elementSizeUm,
203  blitz::Array<ResultT,Dim> &filtered,
204  iRoCS::ProgressReporter *pr = NULL) const;
205 
206  // Explicitly force the name mangler to also consider the base class
207  // implementation
209 
210 /*======================================================================*/
225 /*======================================================================*/
226  static void apply(
227  blitz::Array<DataT,Dim> const &data,
228  blitz::TinyVector<double,Dim> const &elementSizeUm,
229  blitz::Array<ResultT,Dim> &filtered,
232  DataT const &boundaryValue = traits<DataT>::zero,
233  iRoCS::ProgressReporter *pr = NULL);
234 
235 /*======================================================================*/
252 /*======================================================================*/
253  static void apply(
254  Array<DataT,Dim> const &data, Array<ResultT,Dim> &filtered,
257  DataT const &boundaryValue = traits<DataT>::zero,
258  iRoCS::ProgressReporter *pr = NULL);
259 
260  private:
261 
263 
264  };
265 
266 }
267 
268 #include "CentralHessianUTFilter.icc"
269 
270 #endif
The Implementation of the filter computing the gradient of the input data using central differences...
CentralHessianUTFilter(BoundaryTreatmentType bt=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
Default Constructor.
void setAccuracy(typename CentralGradientFilter< DataT, Dim >::Accuracy accuracy)
Set the order of accuracy of this filter.
The Filter class is the base class for all filter implementations.
Definition: Filter.hh:55
The CentralHessianUTFilter class implements the SeparableFilter interface and provides hessian comput...
The SeparableFilter class specifies methods a separable filter provides additionally to the filter me...
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".
The traits class provides means to query specific information about different data types...
Definition: TypeTraits.hh:73
virtual void apply(blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< ResultT, Dim > &filtered, iRoCS::ProgressReporter *pr=NULL) const
Apply the filter to the given Array.
blitz::TinyVector< DataT, Dim *(Dim+1)/2 > ResultT
virtual void applyAlongDim(blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< DataT, Dim > &filtered, int dim, iRoCS::ProgressReporter *pr=NULL) const
Apply the filter along the specified dimension.
CentralGradientFilter< DataT, Dim >::Accuracy accuracy() const
Get the order of accuracy of this filter.
static int matrixPositionToIndex(blitz::TinyVector< int, 2 > const &pos)
Compute the linear index for the given matrix position.
virtual ~CentralHessianUTFilter()
Destructor.
Treat positions beyond the Array domain as having a constant value.
static blitz::TinyVector< int, 2 > indexToMatrixPosition(int dim)
Compute the position in the triangular matrix for the given linear index.