Commit b7f749c0 authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

BUG: VectorDataKeywordlist, GetFieldAsString now handles Real and raises...

BUG: VectorDataKeywordlist, GetFieldAsString now handles Real and raises exception for non handled part of the union
parent 6a31bef4
......@@ -83,7 +83,17 @@ VectorDataKeywordlist
{
if (key.compare(m_FieldList[i].first->GetNameRef()) == 0)
{
return m_FieldList[i].second.String;
if (m_FieldList[i].first->GetType() == OFTString )
{
return m_FieldList[i].second.String;
}
if (m_FieldList[i].first->GetType() == OFTReal )
{
std::ostringstream ss;
ss << std::setprecision(15) << m_FieldList[i].second.Real;
return ss.str();
}
itkExceptionMacro(<<"This type is not handle (yet) by GetFieldAsString(), please request for it");
}
}
return "";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment