<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 <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"> </font></span>for a 3D vector image. However, I'm still running into a problem when I try to set the classifier membership function. I'm getting the following error:<div><br></div><div><div>error: no matching function for call to ‘itk::Statistics::SampleClassifier<main(int,char**)::AdaptorType>::AddMembershipFunction(itk::Statistics::EuclideanDistance<main(int, char**)::MeasurementVectorType>*)’</div><div>/opt/local/include/InsightToolkit-3.16/Algorithms/itkClassifierBase.txx:95: note: candidates are: unsigned int itk::ClassifierBase<TDataContainer>::AddMembershipFunction(itk::Statistics::MembershipFunctionBase<typename TDataContainer::ValueType>*) [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<TVector>::Evaluate(const TVector&) const [with TVector = main(int, char**)::MeasurementVectorType]’:</div><div>/Users/smrolfe/build/test.cxx:142: 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#<expression error>((&((const itk::Statistics::EuclideanDistance<main(int, char**)::MeasurementVectorType>*)this)->itk::Statistics::EuclideanDistance<main(int, char**)::MeasurementVectorType>::<anonymous>)))->itk::Array<double>::<anonymous>.vnl_vector<T>::operator[] [with T = double](i) - (+ x)->itk::Vector<main(int, char**)::PixelType, 3u>::<anonymous>.itk::FixedArray<TValueType, VLength>::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<TVector>::Evaluate(const TVector&, const TVector&) const [with TVector = main(int, char**)::MeasurementVectorType]’:</div><div>/Users/smrolfe/build/test.cxx:142: instantiated from here</div><div>/opt/local/include/InsightToolkit-3.16/Numerics/Statistics/itkEuclideanDistance.txx:39: error: cannot convert ‘itk::Vector<unsigned char, 2u>’ to ‘double’ in assignment</div><div><br></div><div>My code is attached. Please let me know if you have any recommendations.</div><div></div></div></body></html>