19 #include <mapAlgorithmProfileHelper.h>
20 #include <mapConvert.h>
33 const ::map::algorithm::profile::ValueListType &values,
34 const std::string &defaultStr =
"")
36 std::stringstream descriptionString;
37 descriptionString <<
"<tr><td><b>" << name <<
":</b></td><td>";
41 for (::map::algorithm::profile::ValueListType::const_iterator pos = values.begin(); pos != values.end(); ++pos)
43 if (pos != values.begin())
45 descriptionString <<
"<br/>";
47 descriptionString << *pos;
52 if (defaultStr.empty())
54 descriptionString <<
"<font color='gray'><i>unknown / not defined</i></font>";
58 descriptionString << defaultStr;
62 descriptionString <<
"</td></tr>";
64 return descriptionString.str();
71 this->m_teAlgorithmDetails->clear();
75 std::stringstream descriptionString;
78 ::map::algorithm::profile::parseProfileString(newInfo->getAlgorithmProfileStr());
80 descriptionString <<
"<h1>Identification</h1><p><b>Namespace:</b> " << newInfo->getAlgorithmUID().getNamespace()
82 <<
"<b>Name:</b> " << newInfo->getAlgorithmUID().getName() <<
"<br/>"
83 <<
"<b>Version:</b> " << newInfo->getAlgorithmUID().getVersion() <<
"<br/>"
84 <<
"<b>BuildTag:</b> " << newInfo->getAlgorithmUID().getBuildTag() <<
"<br/>"
85 <<
"<b>Location:</b> " << newInfo->getLibraryFilePath() <<
"</p>";
87 descriptionString <<
"<h1>Description</h1><p>" << ::map::algorithm::profile::getDescription(algProfile) <<
"</p>";
88 descriptionString <<
"<h1>Keywords</h1><p>";
89 ::map::algorithm::profile::ValueListType keys = ::map::algorithm::profile::getKeywords(algProfile);
90 for (::map::algorithm::profile::ValueListType::const_iterator keyPos = keys.begin(); keyPos != keys.end(); ++keyPos)
92 if (keyPos != keys.begin())
94 descriptionString <<
"; ";
96 descriptionString << *keyPos;
98 descriptionString <<
"</p>";
100 descriptionString <<
"<h1>Characteristics</h1><table>";
101 descriptionString <<
AddInfoTableRow(
"data type(s)", ::map::algorithm::profile::getDataType(algProfile));
103 ::map::algorithm::profile::getComputationStyle(algProfile));
104 if (::map::algorithm::profile::isDeterministic(algProfile))
106 descriptionString <<
"<tr><td><b>deterministic:</b></td><td>yes</td></tr>";
110 descriptionString <<
"<tr><td><b>deterministic:</b></td><td>no</td></tr>";
112 descriptionString <<
AddInfoTableRow(
"resolution style", ::map::algorithm::profile::getResolutionStyle(algProfile));
114 unsigned int dimension;
116 descriptionString <<
"<tr><td><b>moving dim:</b></td><td>";
117 if (::map::algorithm::profile::getMovingDimensions(algProfile, dimension))
119 descriptionString << map::core::convert::toStr(dimension) <<
"D";
123 descriptionString <<
"<font color='gray'><i>unknown / not defined</i></font>";
125 descriptionString <<
"</td></tr>";
126 descriptionString <<
AddInfoTableRow(
"moving modality", ::map::algorithm::profile::getMovingModality(algProfile));
128 descriptionString <<
"<tr><td><b>target dim:</b></td><td>";
129 if (::map::algorithm::profile::getTargetDimensions(algProfile, dimension))
131 descriptionString << map::core::convert::toStr(dimension) <<
"D";
135 descriptionString <<
"<font color='gray'><i>unknown / not defined</i></font>";
137 descriptionString <<
"</td></tr>";
138 descriptionString <<
AddInfoTableRow(
"target modality", ::map::algorithm::profile::getTargetModality(algProfile));
140 descriptionString <<
AddInfoTableRow(
"subject", ::map::algorithm::profile::getSubject(algProfile));
141 descriptionString <<
AddInfoTableRow(
"object", ::map::algorithm::profile::getObject(algProfile));
142 descriptionString <<
AddInfoTableRow(
"transform model", ::map::algorithm::profile::getTransformModel(algProfile));
143 descriptionString <<
AddInfoTableRow(
"transform domain", ::map::algorithm::profile::getTransformDomain(algProfile));
144 descriptionString <<
AddInfoTableRow(
"metric", ::map::algorithm::profile::getMetric(algProfile));
145 descriptionString <<
AddInfoTableRow(
"optimization", ::map::algorithm::profile::getOptimization(algProfile));
146 descriptionString <<
AddInfoTableRow(
"interaction", ::map::algorithm::profile::getInteraction(algProfile));
147 descriptionString <<
"</table>";
149 descriptionString <<
"<h1>Contact & Usage</h1><table>";
150 descriptionString <<
AddInfoTableRow(
"contact", ::map::algorithm::profile::getContact(algProfile));
152 descriptionString <<
"<tr><td><b>terms:</b></td><td>";
153 if (::map::algorithm::profile::getTerms(algProfile, terms))
155 descriptionString << terms;
159 descriptionString <<
"<font color='gray'><i>unknown / not defined</i></font>";
161 descriptionString <<
"</td></tr>";
162 descriptionString <<
AddInfoTableRow(
"citation", ::map::algorithm::profile::getCitation(algProfile));
163 descriptionString <<
"</table>";
166 this->m_teAlgorithmDetails->clear();
167 this->m_teAlgorithmDetails->insertHtml(QString::fromStdString(descriptionString.str()));
void OnInfoChanged(const map::deployment::DLLInfo *newInfo)
Slot that can be used to trigger updateInfo();.
itk::SmartPointer< Self > Pointer
QmitkAlgorithmProfileViewer(QWidget *parent=0)
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="")