Skip to content
Snippets Groups Projects
Commit 9ec53d34 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

BUG: fix parsing of Kmeans model files

parent 64081fba
No related branches found
No related tags found
No related merge requests found
...@@ -292,12 +292,15 @@ protected: ...@@ -292,12 +292,15 @@ protected:
itkExceptionMacro(<< "File : " << modelFileName << " couldn't be opened"); itkExceptionMacro(<< "File : " << modelFileName << " couldn't be opened");
} }
// get the end line with the centroids // get the line with the centroids (starts with "2 ")
std::string line, centroidLine; std::string line, centroidLine;
while(std::getline(infile,line)) while(std::getline(infile,line))
{ {
if (!line.empty()) if (line.size() > 2 && line[0] == '2' && line[1] == ' ')
{
centroidLine = line; centroidLine = line;
break;
}
} }
std::vector<std::string> centroidElm; std::vector<std::string> centroidElm;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment