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

Function mitkPointSetFileIOTest

Modules/Core/test/mitkPointSetFileIOTest.cpp:140–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}; // mitkPointSetFileIOTestClass
139
140int mitkPointSetFileIOTest(int, char *[])
141{
142 MITK_TEST_BEGIN("PointSet");
143
144 // minimum test w/ identity geometry
145 {
146 mitkPointSetFileIOTestClass test;
147 MITK_TEST_CONDITION(test.PointSetWrite(), "Testing if the PointSetWriter writes Data");
148 test.PointSetLoadAndCompareTest(); // load - compare
149 }
150
151 // case with a more complex geometry
152 {
153 mitkPointSetFileIOTestClass test;
154
155 mitk::Geometry3D::Pointer g = mitk::Geometry3D::New();
156
157 // define arbitrary transformation matrix
158 // the number don't have much meaning - we just want them reproduced
159 // by the writer/reader cycle
160 mitk::BaseGeometry::BoundsArrayType bounds;
161 bounds[0] = -918273645.18293746;
162 bounds[1] = -52.723;
163 bounds[2] = -1.002;
164 bounds[3] = 918273645.18293746;
165 bounds[4] = +1.002;
166 bounds[5] = +52.723;
167 g->SetBounds(bounds);
168
169 mitk::ScalarType matrixCoeffs[9] = {0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8};
170
171 mitk::AffineTransform3D::MatrixType matrix;
172 matrix.GetVnlMatrix().set(matrixCoeffs);
173
174 mitk::AffineTransform3D::OffsetType offset;
175 offset[0] = -43.1829374;
176 offset[1] = 0.0;
177 offset[2] = +43.1829374;
178
179 mitk::AffineTransform3D::Pointer transform = mitk::AffineTransform3D::New();
180 transform->SetMatrix(matrix);
181 transform->SetOffset(offset);
182 g->SetIndexToWorldTransform(transform);
183
184 MITK_TEST_CONDITION(test.PointSetWrite(g), "Testing if the PointSetWriter writes Data _with_ geometry");
185 test.PointSetLoadAndCompareTest(); // load - compare
186 }
187
188 MITK_TEST_END();
189}

Callers

nothing calls this directly

Calls 7

PointSetWriteMethod · 0.80
GetVnlMatrixMethod · 0.80
SetMatrixMethod · 0.80
NewFunction · 0.50
SetBoundsMethod · 0.45

Tested by

no test coverage detected