MCPcopy Create free account
hub / github.com/MITK/MITK / WriteDocument

Function WriteDocument

Modules/Classification/CLUtilities/src/mitkCLResultXMLWriter.cpp:188–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188void WriteDocument(std::ostream& stream, const mitk::Image* image, const mitk::Image* mask,
189 const mitk::AbstractGlobalImageFeature::FeatureListType& features, const std::string& methodName,
190 const std::string& organisation, const std::string& version, const std::string& pipelineUID,
191 const std::map<std::string, us::Any>& cliArgs)
192{
193 tinyxml2::XMLDocument doc;
194 doc.InsertEndChild(doc.NewDeclaration());
195
196 auto* rootNode = doc.NewElement("mp:measurement");
197 rootNode->SetAttribute("xmlns:mp", "https://www.mitk.org/Phenotyping");
198 doc.InsertEndChild(rootNode);
199
200 auto* methodNode = doc.NewElement("mp:measurementMethod");
201 rootNode->InsertEndChild(methodNode);
202
203 auto* methodNameNode = doc.NewElement("mp:name");
204 auto* valueText = doc.NewText(methodName.c_str());
205 methodNameNode->InsertEndChild(valueText);
206 methodNode->InsertEndChild(methodNameNode);
207
208 auto* organisationNode = doc.NewElement("mp:organisation");
209 valueText = doc.NewText(organisation.c_str());
210 organisationNode->InsertEndChild(valueText);
211 methodNode->InsertEndChild(organisationNode);
212
213 auto* versionNode = doc.NewElement("mp:version");
214 valueText = doc.NewText(version.c_str());
215 versionNode->InsertEndChild(valueText);
216 methodNode->InsertEndChild(versionNode);
217
218 auto* imageNode = doc.NewElement("mp:image");
219 rootNode->InsertEndChild(imageNode);
220
221 AddSeriesInstanceUID(image, imageNode);
222 AddFilePath(image, imageNode);
223 AddSOPInstanceUIDs(image, imageNode);
224 AddReaderInfo(image,imageNode);
225
226
227 auto* maskNode = doc.NewElement("mp:mask");
228 rootNode->InsertEndChild(maskNode);
229
230 AddSeriesInstanceUID(mask, maskNode);
231 AddFilePath(mask, maskNode);
232 AddSOPInstanceUIDs(mask, maskNode);
233 AddReaderInfo(mask, maskNode);
234
235 //todo mask reader meta info
236
237 AddDateAndTime(rootNode);
238
239 auto* pipelineNode = doc.NewElement("mp:pipelineUID");
240 valueText = doc.NewText(pipelineUID.c_str());
241 pipelineNode->InsertEndChild(valueText);
242 rootNode->InsertEndChild(pipelineNode);
243
244 auto* paramsNode = doc.NewElement("mp:parameters");
245 rootNode->InsertEndChild(paramsNode);

Callers 1

writeMethod · 0.85

Calls 9

AddSeriesInstanceUIDFunction · 0.85
AddFilePathFunction · 0.85
AddSOPInstanceUIDsFunction · 0.85
AddReaderInfoFunction · 0.85
AddDateAndTimeFunction · 0.85
AddParametersFunction · 0.85
AddFeaturesFunction · 0.85
AddFeatureSettingsFunction · 0.85
PrintMethod · 0.45

Tested by

no test coverage detected