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

Method ReadPoints

Modules/Core/src/IO/mitkPointSetReaderService.cpp:115–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113
114
115mitk::PointSet::Pointer mitk::PointSetReaderService::ReadPoints(mitk::PointSet::Pointer newPointSet,
116 tinyxml2::XMLElement *currentTimeSeries,
117 unsigned int currentTimeStep)
118{
119 if (currentTimeSeries->FirstChildElement("point") != nullptr)
120 {
121 for (auto *currentPoint = currentTimeSeries->FirstChildElement("point"); currentPoint != nullptr;
122 currentPoint = currentPoint->NextSiblingElement())
123 {
124 unsigned int id(0);
125 auto spec((mitk::PointSpecificationType)0);
126 double x(0.0);
127 double y(0.0);
128 double z(0.0);
129
130 id = atoi(currentPoint->FirstChildElement("id")->GetText());
131 if (currentPoint->FirstChildElement("specification") != nullptr)
132 {
133 spec = (mitk::PointSpecificationType)atoi(currentPoint->FirstChildElement("specification")->GetText());
134 }
135 x = atof(currentPoint->FirstChildElement("x")->GetText());
136 y = atof(currentPoint->FirstChildElement("y")->GetText());
137 z = atof(currentPoint->FirstChildElement("z")->GetText());
138
139 mitk::Point3D point;
140 mitk::FillVector3D(point, x, y, z);
141 newPointSet->SetPoint(id, point, spec, currentTimeStep);
142 }
143 }
144 else
145 {
146 if (currentTimeStep != newPointSet->GetTimeSteps() + 1)
147 {
148 newPointSet->Expand(currentTimeStep + 1); // expand time step series with empty time step
149 }
150 }
151 return newPointSet;
152}
153
154mitk::PointSetReaderService::PointSetReaderService(const mitk::PointSetReaderService &other)
155 : mitk::AbstractFileReader(other)

Callers 1

DoReadMethod · 0.95

Calls 5

FillVector3DFunction · 0.85
GetTimeStepsMethod · 0.80
GetTextMethod · 0.45
SetPointMethod · 0.45
ExpandMethod · 0.45

Tested by

no test coverage detected