15 #include <mapAlgorithmProfileHelper.h> 16 #include <mapConvert.h> 29 const ::map::algorithm::profile::ValueListType &values,
30 const std::string &defaultStr =
"")
32 std::stringstream descriptionString;
33 descriptionString <<
"<tr><td><b>" << name <<
":</b></td><td>";
37 for (::map::algorithm::profile::ValueListType::const_iterator pos = values.begin(); pos != values.end(); ++pos)
39 if (pos != values.begin())
41 descriptionString <<
"<br/>";
43 descriptionString << *pos;
48 if (defaultStr.empty())
50 descriptionString <<
"<font color='gray'><i>unknown / not defined</i></font>";
54 descriptionString << defaultStr;
58 descriptionString <<
"</td></tr>";
60 return descriptionString.str();
67 this->m_teAlgorithmDetails->clear();
71 std::stringstream descriptionString;
73 ::map::structuredData::Element::Pointer algProfile =
74 ::map::algorithm::profile::parseProfileString(newInfo->getAlgorithmProfileStr());
76 descriptionString <<
"<h1>Identification</h1><p><b>Namespace:</b> " << newInfo->getAlgorithmUID().getNamespace()
78 <<
"<b>Name:</b> " << newInfo->getAlgorithmUID().getName() <<
"<br/>" 79 <<
"<b>Version:</b> " << newInfo->getAlgorithmUID().getVersion() <<
"<br/>" 80 <<
"<b>BuildTag:</b> " << newInfo->getAlgorithmUID().getBuildTag() <<
"<br/>" 81 <<
"<b>Location:</b> " << newInfo->getLibraryFilePath() <<
"</p>";
83 descriptionString <<
"<h1>Description</h1><p>" << ::map::algorithm::profile::getDescription(algProfile) <<
"</p>";
84 descriptionString <<
"<h1>Keywords</h1><p>";
85 ::map::algorithm::profile::ValueListType keys = ::map::algorithm::profile::getKeywords(algProfile);
86 for (::map::algorithm::profile::ValueListType::const_iterator keyPos = keys.begin(); keyPos != keys.end(); ++keyPos)
88 if (keyPos != keys.begin())
90 descriptionString <<
"; ";
92 descriptionString << *keyPos;
94 descriptionString <<
"</p>";
96 descriptionString <<
"<h1>Characteristics</h1><table>";
97 descriptionString <<
AddInfoTableRow(
"data type(s)", ::map::algorithm::profile::getDataType(algProfile));
99 ::map::algorithm::profile::getComputationStyle(algProfile));
100 if (::map::algorithm::profile::isDeterministic(algProfile))
102 descriptionString <<
"<tr><td><b>deterministic:</b></td><td>yes</td></tr>";
106 descriptionString <<
"<tr><td><b>deterministic:</b></td><td>no</td></tr>";
108 descriptionString <<
AddInfoTableRow(
"resolution style", ::map::algorithm::profile::getResolutionStyle(algProfile));
110 unsigned int dimension;
112 descriptionString <<
"<tr><td><b>moving dim:</b></td><td>";
113 if (::map::algorithm::profile::getMovingDimensions(algProfile, dimension))
115 descriptionString << map::core::convert::toStr(dimension) <<
"D";
119 descriptionString <<
"<font color='gray'><i>unknown / not defined</i></font>";
121 descriptionString <<
"</td></tr>";
122 descriptionString <<
AddInfoTableRow(
"moving modality", ::map::algorithm::profile::getMovingModality(algProfile));
124 descriptionString <<
"<tr><td><b>target dim:</b></td><td>";
125 if (::map::algorithm::profile::getTargetDimensions(algProfile, dimension))
127 descriptionString << map::core::convert::toStr(dimension) <<
"D";
131 descriptionString <<
"<font color='gray'><i>unknown / not defined</i></font>";
133 descriptionString <<
"</td></tr>";
134 descriptionString <<
AddInfoTableRow(
"target modality", ::map::algorithm::profile::getTargetModality(algProfile));
136 descriptionString <<
AddInfoTableRow(
"subject", ::map::algorithm::profile::getSubject(algProfile));
137 descriptionString <<
AddInfoTableRow(
"object", ::map::algorithm::profile::getObject(algProfile));
138 descriptionString <<
AddInfoTableRow(
"transform model", ::map::algorithm::profile::getTransformModel(algProfile));
139 descriptionString <<
AddInfoTableRow(
"transform domain", ::map::algorithm::profile::getTransformDomain(algProfile));
140 descriptionString <<
AddInfoTableRow(
"metric", ::map::algorithm::profile::getMetric(algProfile));
141 descriptionString <<
AddInfoTableRow(
"optimization", ::map::algorithm::profile::getOptimization(algProfile));
142 descriptionString <<
AddInfoTableRow(
"interaction", ::map::algorithm::profile::getInteraction(algProfile));
143 descriptionString <<
"</table>";
145 descriptionString <<
"<h1>Contact & Usage</h1><table>";
146 descriptionString <<
AddInfoTableRow(
"contact", ::map::algorithm::profile::getContact(algProfile));
148 descriptionString <<
"<tr><td><b>terms:</b></td><td>";
149 if (::map::algorithm::profile::getTerms(algProfile, terms))
151 descriptionString << terms;
155 descriptionString <<
"<font color='gray'><i>unknown / not defined</i></font>";
157 descriptionString <<
"</td></tr>";
158 descriptionString <<
AddInfoTableRow(
"citation", ::map::algorithm::profile::getCitation(algProfile));
159 descriptionString <<
"</table>";
162 this->m_teAlgorithmDetails->clear();
163 this->m_teAlgorithmDetails->insertHtml(QString::fromStdString(descriptionString.str()));
void OnInfoChanged(const map::deployment::DLLInfo *newInfo)
Slot that can be used to trigger updateInfo();.
QmitkAlgorithmProfileViewer(QWidget *parent=nullptr)
void updateInfo(const map::deployment::DLLInfo *newInfo)
Updates the widget according to the new info.
std::string AddInfoTableRow(const std::string &name, const ::map::algorithm::profile::ValueListType &values, const std::string &defaultStr="")