SimpleITK  1.0.1
sitkScalarImageKmeansImageFilter.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 sitkScalarImageKmeansImageFilter_h
19 #define sitkScalarImageKmeansImageFilter_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 sitkImageFilterTemplate.h.in to make changes.
25  */
26 
27 #include <memory>
28 
29 #include "sitkBasicFilters.h"
30 #include "sitkImageFilter.h"
31 
32 namespace itk {
33  namespace simple {
34 
59  public:
61 
65 
68 
71 
72 
73 
76  SITK_RETURN_SELF_TYPE_HEADER SetClassWithInitialMean ( std::vector<double> ClassWithInitialMean ) { this->m_ClassWithInitialMean = ClassWithInitialMean; return *this; }
77 
80  std::vector<double> GetClassWithInitialMean() const { return this->m_ClassWithInitialMean; }
81 
85  SITK_RETURN_SELF_TYPE_HEADER SetUseNonContiguousLabels ( bool UseNonContiguousLabels ) { this->m_UseNonContiguousLabels = UseNonContiguousLabels; return *this; }
86 
88  SITK_RETURN_SELF_TYPE_HEADER UseNonContiguousLabelsOn() { return this->SetUseNonContiguousLabels(true); }
89  SITK_RETURN_SELF_TYPE_HEADER UseNonContiguousLabelsOff() { return this->SetUseNonContiguousLabels(false); }
90 
94  bool GetUseNonContiguousLabels() const { return this->m_UseNonContiguousLabels; }
101  std::vector<double> GetFinalMeans() const { return this->m_FinalMeans; };
102 
104  std::string GetName() const { return std::string ("ScalarImageKmeansImageFilter"); }
105 
107  std::string ToString() const;
108 
109 
111  Image Execute ( const Image& image1 );
112 
113 
115  Image Execute ( const Image& image1, std::vector<double> classWithInitialMean, bool useNonContiguousLabels );
116 
117 
118  private:
119 
122  typedef Image (Self::*MemberFunctionType)( const Image& image1 );
123  template <class TImageType> Image ExecuteInternal ( const Image& image1 );
124 
125 
126 
127  friend struct detail::MemberFunctionAddressor<MemberFunctionType>;
128 
129  nsstd::auto_ptr<detail::MemberFunctionFactory<MemberFunctionType> > m_MemberFactory;
130 
131 
132  std::vector<double> m_ClassWithInitialMean;
133  /* */
135  /* Docs */
136  std::vector<double> m_FinalMeans;
137 
138  };
139 
140 
141 
150  SITKBasicFilters_EXPORT Image ScalarImageKmeans ( const Image& image1, std::vector<double> classWithInitialMean = std::vector<double>(), bool useNonContiguousLabels = false );
151 
152  }
153 }
154 #endif
#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 & SetClassWithInitialMean(std::vector< double > ClassWithInitialMean)
Classifies the intensity values of a scalar image using the K-Means algorithm.
Image ScalarImageKmeans(const Image &image1, std::vector< double > classWithInitialMean=std::vector< double >(), bool useNonContiguousLabels=false)
Classifies the intensity values of a scalar image using the K-Means algorithm.
Self & SetUseNonContiguousLabels(bool UseNonContiguousLabels)
The main Image class for SimpleITK.
Definition: sitkImage.h:54
nsstd::auto_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
The base interface for SimpleITK filters that take one input image.