<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I have cleared up some problems in adapting the example&nbsp;<span class="Apple-style-span" style="font-family: Courier; font-size: 10px; ">Examples/Statistics/KdTreeBasedKMeansClustering.cxx</span><span class="Apple-style-span" style="font-size: 10px; "><font class="Apple-style-span" face="Times">&nbsp;</font></span>for a 3D vector image. &nbsp;However, I'm still running into a problem when I try to set the classifier membership function. &nbsp;I'm getting the following error:<div><br></div><div><div>error: no matching function for call to ‘itk::Statistics::SampleClassifier&lt;main(int,char**)::AdaptorType&gt;::AddMembershipFunction(itk::Statistics::EuclideanDistance&lt;main(int, char**)::MeasurementVectorType&gt;*)’</div><div>/opt/local/include/InsightToolkit-3.16/Algorithms/itkClassifierBase.txx:95: note: candidates are: unsigned int itk::ClassifierBase&lt;TDataContainer&gt;::AddMembershipFunction(itk::Statistics::MembershipFunctionBase&lt;typename TDataContainer::ValueType&gt;*) [with TDataContainer = main(int, char**)::AdaptorType]</div><div>/opt/local/include/InsightToolkit-3.16/Numerics/Statistics/itkEuclideanDistance.txx: In member function ‘double itk::Statistics::EuclideanDistance&lt;TVector&gt;::Evaluate(const TVector&amp;) const [with TVector = main(int, char**)::MeasurementVectorType]’:</div><div>/Users/smrolfe/build/test.cxx:142: &nbsp; instantiated from here</div><div>/opt/local/include/InsightToolkit-3.16/Numerics/Statistics/itkEuclideanDistance.txx:65: error: no match for ‘operator-’ in ‘(+#‘obj_type_ref’ not supported by dump_expr#&lt;expression error&gt;((&amp;((const itk::Statistics::EuclideanDistance&lt;main(int, char**)::MeasurementVectorType&gt;*)this)-&gt;itk::Statistics::EuclideanDistance&lt;main(int, char**)::MeasurementVectorType&gt;::&lt;anonymous&gt;)))-&gt;itk::Array&lt;double&gt;::&lt;anonymous&gt;.vnl_vector&lt;T&gt;::operator[] [with T = double](i) - (+ x)-&gt;itk::Vector&lt;main(int, char**)::PixelType, 3u&gt;::&lt;anonymous&gt;.itk::FixedArray&lt;TValueType, VLength&gt;::operator[] [with TValueType = main(int, char**)::PixelType, unsigned int VLength = 3u](i)’</div><div>/opt/local/include/InsightToolkit-3.16/Numerics/Statistics/itkEuclideanDistance.txx: In member function ‘double itk::Statistics::EuclideanDistance&lt;TVector&gt;::Evaluate(const TVector&amp;, const TVector&amp;) const [with TVector = main(int, char**)::MeasurementVectorType]’:</div><div>/Users/smrolfe/build/test.cxx:142: &nbsp; instantiated from here</div><div>/opt/local/include/InsightToolkit-3.16/Numerics/Statistics/itkEuclideanDistance.txx:39: error: cannot convert ‘itk::Vector&lt;unsigned char, 2u&gt;’ to ‘double’ in&nbsp;assignment</div><div><br></div><div>My code is attached. &nbsp;Please let me know if you have any recommendations.</div><div></div></div></body></html>