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

Method DoRead

Modules/ContourModel/src/IO/mitkContourModelSetReader.cpp:42–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42std::vector<itk::SmartPointer<mitk::BaseData>> mitk::ContourModelSetReader::DoRead()
43{
44 std::vector<itk::SmartPointer<mitk::BaseData>> result;
45 std::vector<itk::SmartPointer<mitk::BaseData>> internalResult;
46
47 std::string location = GetInputLocation();
48
49 // Switch the current locale to "C"
50 LocaleSwitch localeSwitch("C");
51
52 try
53 {
54 mitk::ContourModelSet::Pointer contourSet = mitk::ContourModelSet::New();
55
56 mitk::ContourModelReader reader;
57 reader.SetInput(location);
58 internalResult = reader.Read();
59
60 for (unsigned int i = 0; i < internalResult.size(); ++i)
61 {
62 contourSet->AddContourModel(dynamic_cast<mitk::ContourModel *>(internalResult.at(i).GetPointer()));
63 }
64 result.push_back(dynamic_cast<mitk::BaseData *>(contourSet.GetPointer()));
65 }
66 catch (...)
67 {
68 MITK_ERROR << "Cannot read contourModel.";
69 }
70
71 return result;
72}
73
74mitk::ContourModelSetReader *mitk::ContourModelSetReader::Clone() const
75{

Callers

nothing calls this directly

Calls 8

GetInputLocationFunction · 0.85
AddContourModelMethod · 0.80
GetPointerMethod · 0.80
atMethod · 0.80
NewFunction · 0.50
SetInputMethod · 0.45
ReadMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected