iRoCS Toolbox  1.1.0
SphericalTensor.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2015 Marco Reisert, 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 SPHERICALTENSOR_HH
32 #define SPHERICALTENSOR_HH
33 
34 #ifdef HAVE_CONFIG_H
35 #include <config.hh>
36 #endif
37 
38 #include <map>
39 #include <omp.h>
40 
42 
43 #include "Array.hh"
44 
45 namespace atb
46 {
47 
48 /*======================================================================*/
54 /*======================================================================*/
56  {
57 
58 /*======================================================================*/
74 /*======================================================================*/
75  SDMagFeatureIndex(const double sigma, const int laplace, const int band)
76  : s(sigma), l(laplace), b(band)
77  {}
78 
79 /*======================================================================*/
83 /*======================================================================*/
85  {}
86 
88  double s;
89 
93  int l;
94 
96  int b;
97 
103  bool operator<(const SDMagFeatureIndex& rhs) const
104  {
105  if (s < rhs.s) return true;
106  if (s == rhs.s && l < rhs.l) return true;
107  if (s == rhs.s && l == rhs.l && b < rhs.b) return true;
108  return false;
109  }
110 
111  };
112 
113  std::ostream &operator<<(std::ostream &os, SDMagFeatureIndex const &index);
114 
115 /*======================================================================*/
139 /*======================================================================*/
140  void STderivReal(
141  double *in, BlitzIndexT sz[], BlitzIndexT L, double *out,
142  double factor = 1.0);
143 
144 /*======================================================================*/
156 /*======================================================================*/
157  template<typename DataT>
158  void STderiv(const blitz::Array<DataT,3>& data,
159  std::map<SDMagFeatureIndex,blitz::Array<DataT,3>*>& out,
160  const double sigma, const int laplace,
161  const BlitzIndexT maxBand);
162 
163 /*======================================================================*/
177 /*======================================================================*/
178  template<typename DataT>
179  void STderiv(Array<DataT,3> const &data,
180  std::map<SDMagFeatureIndex,Array<DataT,3>*> &out,
181  double sigma, int laplace, BlitzIndexT maxBand);
182 
183 /*======================================================================*/
198 /*======================================================================*/
199  template<typename DataT>
200  void STderiv(Array<DataT,3> const &data,
201  std::map< SDMagFeatureIndex, Array<DataT,3> > &sdFeatures,
202  double sigma, int laplace, BlitzIndexT maxBand);
203 
204 }
205 
206 #include "SphericalTensor.icc"
207 
208 #endif
Array class derived from blitz++ Arrays for handling microscopic datasets with associated element siz...
void STderivReal(double *in, BlitzIndexT sz[], BlitzIndexT L, double *out, double factor=1.0)
Compute real spherical derivatives of the tensor with given rank (band).
void STderiv(const blitz::Array< DataT, 3 > &data, std::map< SDMagFeatureIndex, blitz::Array< DataT, 3 > *> &out, const double sigma, const int laplace, const BlitzIndexT maxBand)
Wrapper method for computing spherical tensorial derivative magnitude features.
The Array class is an extension to the blitz++ Array class providing additional parameters element si...
Definition: Array.hh:85
std::ostream & operator<<(std::ostream &os, BasicTreeNode< KeyT, ContentT > const &n)
int b
The spherical tensor band to compute the magnitude for.
~SDMagFeatureIndex()
Destructor.
Data structure to index a feature structure consisting of multi-scale spherical derivative features...
int BlitzIndexT
The native integer type for indexing blitz++ Arrays.
Definition: TypeTraits.hh:56
int l
The Laplace order of the spherical feature (l Laplacian filters are applied prior to spherical tensor...
SDMagFeatureIndex(const double sigma, const int laplace, const int band)
Create a new feature index for a rotation-invariant spherical tensor magnitude feature.
bool operator<(const SDMagFeatureIndex &rhs) const
Strict weak ordering of spherical tensors for sorting.
double s
Standard deviation of the Gaussian fliter used for scale selection.