I’m trying to use this function but i have some issues because i don’t know how to convert my array for this function. Can you help me?
std::vector < unsigned int > classLabels;
classLabels.resize(numberOfClasses);
for (unsigned int i=0; i<numberOfClasses; i++)
{
for (unsigned int j=0; j<measurementVectorSize; j++)
{
initialMeans[i*measurementVectorSize+j] = (float)i;
}
classLabels[i] = i;
}
typedef itk::Statistics::MinimumDecisionRule DecisionRuleType;
DecisionRuleType::Pointer decisionRule = DecisionRuleType::New();
typedef itk::Statistics::SampleClassifierFilter ClassifierType;
ClassifierType::Pointer classifier = ClassifierType::New();
classifier->SetDecisionRule( (itk::Statistics::DecisionRule::Pointer) decisionRule);
classifier->SetInput(sample);
classifier->SetNumberOfClasses(numberOfClasses);
classifier->SetMembershipFunctions(classLabels);
If i have to change the type of my array, can you explain me how to assignate the values (like in my code developed for an older version of ITK)?