iRoCS Toolbox  1.1.0
ATBMorphology.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 #ifndef ATBMORPHOLOGY_HH
24 #define ATBMORPHOLOGY_HH
25 
26 #ifdef HAVE_CONFIG_H
27 #include <config.hh>
28 #endif
29 
30 #include "TypeTraits.hh"
31 #include "Neighborhood.hh"
32 #include "ATBBasicTree.hh"
33 
35 
36 #include <blitz/array.h>
37 
38 #include <map>
39 
40 /*======================================================================*/
45 /*======================================================================*/
46 
47 namespace atb
48 {
49 
51 
52 /*======================================================================*/
65 /*======================================================================*/
66  template<int Dim>
67  std::vector< blitz::TinyVector<BlitzIndexT,Dim> > sphericalStructuringElement(
68  blitz::TinyVector<double,Dim> const &elementSizeUm, double radiusUm);
69 
70 /*======================================================================*/
84 /*======================================================================*/
85  template<typename DataT, int Dim>
86  void dilate(
87  blitz::Array<DataT,Dim> const &data,
88  blitz::Array<DataT,Dim> &result,
89  std::vector< blitz::TinyVector<BlitzIndexT,Dim> > const &strel,
90  iRoCS::ProgressReporter *progress = NULL);
91 
92 /*======================================================================*/
106 /*======================================================================*/
107  template<typename DataT, int Dim>
108  void erode(
109  blitz::Array<DataT,Dim> const &data,
110  blitz::Array<DataT,Dim> &result,
111  std::vector< blitz::TinyVector<BlitzIndexT,Dim> > const &strel,
112  iRoCS::ProgressReporter *progress = NULL);
113 
114 /*======================================================================*/
127 /*======================================================================*/
128  template<typename DataT, int Dim>
129  void open(
130  blitz::Array<DataT,Dim> const &data,
131  blitz::Array<DataT,Dim> &result,
132  std::vector< blitz::TinyVector<BlitzIndexT,Dim> > const &strel,
133  iRoCS::ProgressReporter *progress = NULL);
134 
135 /*======================================================================*/
148 /*======================================================================*/
149  template<typename DataT, int Dim>
150  void close(
151  blitz::Array<DataT,Dim> const &data,
152  blitz::Array<DataT,Dim> &result,
153  std::vector< blitz::TinyVector<BlitzIndexT,Dim> > const &strel,
154  iRoCS::ProgressReporter *progress = NULL);
155 
156 /*======================================================================*/
171 /*======================================================================*/
172  template<typename DataT, int Dim>
173  void tophat(
174  blitz::Array<DataT,Dim> const &data,
175  blitz::TinyVector<double,Dim> const &elementSizeUm,
176  blitz::Array<DataT,Dim> &result,
177  double radiusUm,
178  iRoCS::ProgressReporter *progress = NULL);
179 
180 /*======================================================================*/
195 /*======================================================================*/
196  template <typename DataT, int Dim>
197  void fillHolesGray(
198  blitz::Array<DataT,Dim> const &data, blitz::Array<DataT,Dim> &result,
200  iRoCS::ProgressReporter *pr = NULL);
201 
202 /*======================================================================*/
214 /*======================================================================*/
215  template<int Dim>
216  void
217  connectedComponentLabelling(const blitz::Array<bool,Dim>& data,
218  blitz::Array<BlitzIndexT,Dim>& labels,
219  NHood nh = COMPLEX_NHOOD,
220  iRoCS::ProgressReporter *pr = NULL);
221 
222 }
223 
224 #include "ATBMorphology.icc"
225 
226 #endif
void close(blitz::Array< DataT, Dim > const &data, blitz::Array< DataT, Dim > &result, std::vector< blitz::TinyVector< BlitzIndexT, Dim > > const &strel, iRoCS::ProgressReporter *progress=NULL)
Morphological closing.
void dilate(blitz::Array< DataT, Dim > const &data, blitz::Array< DataT, Dim > &result, std::vector< blitz::TinyVector< BlitzIndexT, Dim > > const &strel, iRoCS::ProgressReporter *progress=NULL)
Morphological dilation.
void erode(blitz::Array< DataT, Dim > const &data, blitz::Array< DataT, Dim > &result, std::vector< blitz::TinyVector< BlitzIndexT, Dim > > const &strel, iRoCS::ProgressReporter *progress=NULL)
Morphological erosion.
std::vector< blitz::TinyVector< BlitzIndexT, Dim > > sphericalStructuringElement(blitz::TinyVector< double, Dim > const &elementSizeUm, double radiusUm)
Generate a spherical neighborhood for morphological operations.
void connectedComponentLabelling(const blitz::Array< bool, Dim > &data, blitz::Array< BlitzIndexT, Dim > &labels, NHood nh=COMPLEX_NHOOD, iRoCS::ProgressReporter *pr=NULL)
Connected component labelling of the given binary Array.
The Neighborhood class specifies local pixel/voxel neighborhoods.
Definition: Neighborhood.hh:92
Neighborhoods for local operators.
Query specific information about different data types.
Type
Neighborhood.hh "libArrayToolbox/Neighborhood.hh".
void tophat(blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< DataT, Dim > &result, double radiusUm, iRoCS::ProgressReporter *progress=NULL)
Morphological top-hat filter.
void open(blitz::Array< DataT, Dim > const &data, blitz::Array< DataT, Dim > &result, std::vector< blitz::TinyVector< BlitzIndexT, Dim > > const &strel, iRoCS::ProgressReporter *progress=NULL)
Morphological opening.
void fillHolesGray(blitz::Array< DataT, Dim > const &data, blitz::Array< DataT, Dim > &result, typename Neighborhood< Dim >::Type nh=Neighborhood< Dim >::Complex, iRoCS::ProgressReporter *pr=NULL)
Morphological hole filling for gray value data.