MCPcopy Create free account
hub / github.com/computationalpathologygroup/ASAP / loadRepositoryFromFile

Method loadRepositoryFromFile

annotation/AnnotationService.cpp:25–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25bool AnnotationService::loadRepositoryFromFile(const std::string& source) {
26 if (source.rfind(std::string(".xml")) != source.npos) {
27 _repo = std::make_shared<XmlRepository>(_list);
28 _repo->setSource(source);
29 if (!_repo->load()) {
30 _list->removeAllAnnotations();
31 _list->removeAllGroups();
32 _repo = std::make_shared<ImageScopeRepository>(_list);
33 _repo->setSource(source);
34 }
35 }
36 else if (source.rfind(std::string(".ndpa")) != source.npos) {
37 _repo = std::make_shared<NDPARepository>(_list);
38 _repo->setSource(source);
39 }
40 return _repo->load();
41}
42
43bool AnnotationService::saveRepositoryToFile(const std::string& source) {
44 if (source.rfind(std::string(".xml")) != source.npos) {

Callers 1

onLoadButtonPressedMethod · 0.80

Calls 4

setSourceMethod · 0.80
removeAllAnnotationsMethod · 0.80
removeAllGroupsMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected