SimpleITK  1.0.1
sitkNeighborhoodConnectedImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 *
3 * Copyright Insight Software Consortium
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18 #ifndef sitkNeighborhoodConnectedImageFilter_h
19 #define sitkNeighborhoodConnectedImageFilter_h
20 
21 /*
22  * WARNING: DO NOT EDIT THIS FILE!
23  * THIS FILE IS AUTOMATICALLY GENERATED BY THE SIMPLEITK BUILD PROCESS.
24  * Please look at sitkRegionGrowingImageFilterTemplate.h.in to make changes.
25  */
26 
27 #include <memory>
28 
29 #include "sitkImageFilter.h"
30 #include "sitkBasicFilters.h"
31 
32 namespace itk {
33  namespace simple {
34 
43  public:
45 
49 
52 
55 
56 
57 
61  SITK_RETURN_SELF_TYPE_HEADER SetLower ( double Lower ) { this->m_Lower = Lower; return *this; }
62 
66  double GetLower() const { return this->m_Lower; }
67 
71  SITK_RETURN_SELF_TYPE_HEADER SetUpper ( double Upper ) { this->m_Upper = Upper; return *this; }
72 
76  double GetUpper() const { return this->m_Upper; }
77 
81  SITK_RETURN_SELF_TYPE_HEADER SetRadius ( const std::vector<unsigned int> & Radius ) { this->m_Radius = Radius; return *this; }
82 
84  SITK_RETURN_SELF_TYPE_HEADER SetRadius( unsigned int value ) { this->m_Radius = std::vector<unsigned int>(3, value); return *this; }
85 
86 
90  std::vector<unsigned int> GetRadius() const { return this->m_Radius; }
91 
95  SITK_RETURN_SELF_TYPE_HEADER SetReplaceValue ( double ReplaceValue ) { this->m_ReplaceValue = ReplaceValue; return *this; }
96 
100  double GetReplaceValue() const { return this->m_ReplaceValue; }
102  SITK_RETURN_SELF_TYPE_HEADER SetSeedList ( const std::vector< std::vector<unsigned int> > &t )
103  {
104  this->m_SeedList = t; return *this;
105  }
106 
108  std::vector< std::vector<unsigned int> > GetSeedList() const
109  {
110  return this->m_SeedList;
111  }
112 
114  SITK_RETURN_SELF_TYPE_HEADER ClearSeeds( )
115  {
116  this->m_SeedList.clear();
117  return *this;
118  }
119 
121  SITK_RETURN_SELF_TYPE_HEADER SetSeed( const std::vector<unsigned int> &idx )
122  {
123  this->m_SeedList.clear();
124  this->m_SeedList.push_back(idx);
125  return *this;
126  }
127 
129  SITK_RETURN_SELF_TYPE_HEADER AddSeed( const std::vector<unsigned int> &idx )
130  {
131  this->m_SeedList.push_back(idx);
132  return *this;
133  }
134 
136  std::string GetName() const { return std::string ("NeighborhoodConnectedImageFilter"); }
137 
139  std::string ToString() const;
140 
141 
143  Image Execute ( const Image& image1 );
144 
145 
147  Image Execute ( const Image& image1, const std::vector< std::vector<unsigned int> > &seedList, double lower, double upper, const std::vector<unsigned int> & radius, double replaceValue );
148 
149  private:
150 
153  typedef Image (Self::*MemberFunctionType)( const Image& image1 );
154  template <class TImageType> Image ExecuteInternal ( const Image& image1 );
155 
156 
157 
158  friend struct detail::MemberFunctionAddressor<MemberFunctionType>;
159 
160  nsstd::auto_ptr<detail::MemberFunctionFactory<MemberFunctionType> > m_MemberFactory;
161 
162 
163  double m_Lower;
164  double m_Upper;
165  /* Radius of the neighborhood used to compute the median */
166  std::vector<unsigned int> m_Radius;
167  /* Pixels that lie within Lower and Upper (inclusive)
168  will be replaced with this value. The default is 1. */
170 
172  std::vector< std::vector<unsigned int> > m_SeedList;
173 
174  };
175 
176 
183 Image SITKBasicFilters_EXPORT NeighborhoodConnected ( const Image& image1, const std::vector< std::vector<unsigned int> > &seedList, double lower = 0, double upper = 1, const std::vector<unsigned int> & radius = std::vector<unsigned int>(3, 1), double replaceValue = 1 );
184 
185 
186  } // end namespace simple
187 } // end namespace itk
188 #endif
Self & SetSeed(const std::vector< unsigned int > &idx)
#define SITKBasicFilters_EXPORT
typelist::MakeTypeList< BasicPixelID< int8_t >, BasicPixelID< uint8_t >, BasicPixelID< int16_t >, BasicPixelID< uint16_t >, BasicPixelID< int32_t >, BasicPixelID< uint32_t >, BasicPixelID< float >, BasicPixelID< double > >::Type BasicPixelIDTypeList
Self & AddSeed(const std::vector< unsigned int > &idx)
std::vector< std::vector< unsigned int > > GetSeedList() const
nsstd::auto_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
Image NeighborhoodConnected(const Image &image1, const std::vector< std::vector< unsigned int > > &seedList, double lower=0, double upper=1, const std::vector< unsigned int > &radius=std::vector< unsigned int >(3, 1), double replaceValue=1)
Self & SetRadius(const std::vector< unsigned int > &Radius)
The main Image class for SimpleITK.
Definition: sitkImage.h:54
Self & SetSeedList(const std::vector< std::vector< unsigned int > > &t)
Label pixels that are connected to a seed and lie within a neighborhood.
The base interface for SimpleITK filters that take one input image.