Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkPlanarFigureIOTest.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "mitkTestingMacros.h"
18 
19 #include "mitkPlanarAngle.h"
20 #include "mitkPlanarCircle.h"
21 #include "mitkPlanarCross.h"
23 #include "mitkPlanarLine.h"
24 #include "mitkPlanarPolygon.h"
25 #include "mitkPlanarRectangle.h"
27 
28 #include "mitkPlanarFigureReader.h"
29 #include "mitkPlanarFigureWriter.h"
30 
31 #include "mitkPlaneGeometry.h"
32 
33 #include <itksys/SystemTools.hxx>
34 
36 {
37  return original->Clone();
38 }
39 
41 class PlanarFigureIOTestClass
42 {
43 public:
44  typedef std::list<mitk::PlanarFigure::Pointer> PlanarFigureList;
45  typedef std::vector<mitk::PlanarFigureWriter::Pointer> PlanarFigureToMemoryWriterList;
46 
47  static PlanarFigureList CreatePlanarFigures()
48  {
49  PlanarFigureList planarFigures;
50 
51  // Create PlaneGeometry on which to place the PlanarFigures
53  planeGeometry->InitializeStandardPlane(100.0, 100.0);
54 
55  // Create a few sample points for PlanarFigure placement
56  mitk::Point2D p0;
57  p0[0] = 20.0;
58  p0[1] = 20.0;
59  mitk::Point2D p1;
60  p1[0] = 80.0;
61  p1[1] = 80.0;
62  mitk::Point2D p2;
63  p2[0] = 90.0;
64  p2[1] = 10.0;
65  mitk::Point2D p3;
66  p3[0] = 10.0;
67  p3[1] = 90.0;
68 
69  // Create PlanarAngle
71  planarAngle->SetPlaneGeometry(planeGeometry);
72  planarAngle->PlaceFigure(p0);
73  planarAngle->SetCurrentControlPoint(p1);
74  planarAngle->AddControlPoint(p2);
75  planarAngle->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
76  planarFigures.push_back(planarAngle.GetPointer());
77 
78  // Create PlanarCircle
80  planarCircle->SetPlaneGeometry(planeGeometry);
81  planarCircle->PlaceFigure(p0);
82  planarCircle->SetCurrentControlPoint(p1);
83  planarCircle->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
84  planarFigures.push_back(planarCircle.GetPointer());
85 
86  // Create PlanarCross
88  planarCross->SetSingleLineMode(false);
89  planarCross->SetPlaneGeometry(planeGeometry);
90  planarCross->PlaceFigure(p0);
91  planarCross->SetCurrentControlPoint(p1);
92  planarCross->AddControlPoint(p2);
93  planarCross->AddControlPoint(p3);
94  planarCross->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
95  planarFigures.push_back(planarCross.GetPointer());
96 
97  // Create PlanarFourPointAngle
99  planarFourPointAngle->SetPlaneGeometry(planeGeometry);
100  planarFourPointAngle->PlaceFigure(p0);
101  planarFourPointAngle->SetCurrentControlPoint(p1);
102  planarFourPointAngle->AddControlPoint(p2);
103  planarFourPointAngle->AddControlPoint(p3);
104  planarFourPointAngle->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
105  planarFigures.push_back(planarFourPointAngle.GetPointer());
106 
107  // Create PlanarLine
109  planarLine->SetPlaneGeometry(planeGeometry);
110  planarLine->PlaceFigure(p0);
111  planarLine->SetCurrentControlPoint(p1);
112  planarLine->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
113  planarFigures.push_back(planarLine.GetPointer());
114 
115  // Create PlanarPolygon
117  planarPolygon->SetClosed(false);
118  planarPolygon->SetPlaneGeometry(planeGeometry);
119  planarPolygon->PlaceFigure(p0);
120  planarPolygon->SetCurrentControlPoint(p1);
121  planarPolygon->AddControlPoint(p2);
122  planarPolygon->AddControlPoint(p3);
123  planarPolygon->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
124  planarFigures.push_back(planarPolygon.GetPointer());
125 
126  // Create PlanarSubdivisionPolygon
128  planarSubdivisionPolygon->SetClosed(false);
129  planarSubdivisionPolygon->SetPlaneGeometry(planeGeometry);
130  planarSubdivisionPolygon->PlaceFigure(p0);
131  planarSubdivisionPolygon->SetCurrentControlPoint(p1);
132  planarSubdivisionPolygon->AddControlPoint(p2);
133  planarSubdivisionPolygon->AddControlPoint(p3);
134  planarSubdivisionPolygon->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
135  planarFigures.push_back(planarSubdivisionPolygon.GetPointer());
136 
137  // Create PlanarRectangle
139  planarRectangle->SetPlaneGeometry(planeGeometry);
140  planarRectangle->PlaceFigure(p0);
141  planarRectangle->SetCurrentControlPoint(p1);
142  planarRectangle->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
143  planarFigures.push_back(planarRectangle.GetPointer());
144 
145  // create preciseGeometry which is using float coordinates
147  mitk::Vector3D right;
148  right[0] = 0.0;
149  right[1] = 1.23456;
150  right[2] = 0.0;
151 
152  mitk::Vector3D down;
153  down[0] = 1.23456;
154  down[1] = 0.0;
155  down[2] = 0.0;
156 
157  mitk::Vector3D spacing;
158  spacing[0] = 0.0123456;
159  spacing[1] = 0.0123456;
160  spacing[2] = 1.123456;
161  preciseGeometry->InitializeStandardPlane(right, down, &spacing);
162 
163  // convert points into the precise coordinates
164  mitk::Point2D p0precise;
165  p0precise[0] = p0[0] * spacing[0];
166  p0precise[1] = p0[1] * spacing[1];
167  mitk::Point2D p1precise;
168  p1precise[0] = p1[0] * spacing[0];
169  p1precise[1] = p1[1] * spacing[1];
170  mitk::Point2D p2precise;
171  p2precise[0] = p2[0] * spacing[0];
172  p2precise[1] = p2[1] * spacing[1];
173  mitk::Point2D p3precise;
174  p3precise[0] = p3[0] * spacing[0];
175  p3precise[1] = p3[1] * spacing[1];
176 
177  // Now all PlanarFigures are create using the precise Geometry
178  // Create PlanarCross
180  nochncross->SetSingleLineMode(false);
181  nochncross->SetPlaneGeometry(preciseGeometry);
182  nochncross->PlaceFigure(p0precise);
183  nochncross->SetCurrentControlPoint(p1precise);
184  nochncross->AddControlPoint(p2precise);
185  nochncross->AddControlPoint(p3precise);
186  nochncross->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
187  planarFigures.push_back(nochncross.GetPointer());
188 
189  // Create PlanarAngle
190  mitk::PlanarAngle::Pointer planarAnglePrecise = mitk::PlanarAngle::New();
191  planarAnglePrecise->SetPlaneGeometry(preciseGeometry);
192  planarAnglePrecise->PlaceFigure(p0precise);
193  planarAnglePrecise->SetCurrentControlPoint(p1precise);
194  planarAnglePrecise->AddControlPoint(p2precise);
195  planarAnglePrecise->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
196  planarFigures.push_back(planarAnglePrecise.GetPointer());
197 
198  // Create PlanarCircle
200  planarCirclePrecise->SetPlaneGeometry(preciseGeometry);
201  planarCirclePrecise->PlaceFigure(p0precise);
202  planarCirclePrecise->SetCurrentControlPoint(p1precise);
203  planarCirclePrecise->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
204  planarFigures.push_back(planarCirclePrecise.GetPointer());
205 
206  // Create PlanarFourPointAngle
208  planarFourPointAnglePrecise->SetPlaneGeometry(preciseGeometry);
209  planarFourPointAnglePrecise->PlaceFigure(p0precise);
210  planarFourPointAnglePrecise->SetCurrentControlPoint(p1precise);
211  planarFourPointAnglePrecise->AddControlPoint(p2precise);
212  planarFourPointAnglePrecise->AddControlPoint(p3precise);
213  planarFourPointAnglePrecise->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
214  planarFigures.push_back(planarFourPointAnglePrecise.GetPointer());
215 
216  // Create PlanarLine
217  mitk::PlanarLine::Pointer planarLinePrecise = mitk::PlanarLine::New();
218  planarLinePrecise->SetPlaneGeometry(preciseGeometry);
219  planarLinePrecise->PlaceFigure(p0precise);
220  planarLinePrecise->SetCurrentControlPoint(p1precise);
221  planarLinePrecise->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
222  planarFigures.push_back(planarLinePrecise.GetPointer());
223 
224  // Create PlanarPolygon
226  planarPolygonPrecise->SetClosed(false);
227  planarPolygonPrecise->SetPlaneGeometry(preciseGeometry);
228  planarPolygonPrecise->PlaceFigure(p0precise);
229  planarPolygonPrecise->SetCurrentControlPoint(p1precise);
230  planarPolygonPrecise->AddControlPoint(p2precise);
231  planarPolygonPrecise->AddControlPoint(p3precise);
232  planarPolygonPrecise->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
233  planarFigures.push_back(planarPolygonPrecise.GetPointer());
234 
235  // Create PlanarSubdivisionPolygon
237  planarSubdivisionPolygonPrecise->SetClosed(false);
238  planarSubdivisionPolygonPrecise->SetPlaneGeometry(preciseGeometry);
239  planarSubdivisionPolygonPrecise->PlaceFigure(p0precise);
240  planarSubdivisionPolygonPrecise->SetCurrentControlPoint(p1precise);
241  planarSubdivisionPolygonPrecise->AddControlPoint(p2precise);
242  planarSubdivisionPolygonPrecise->AddControlPoint(p3precise);
243  planarSubdivisionPolygonPrecise->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
244  planarFigures.push_back(planarSubdivisionPolygonPrecise.GetPointer());
245 
246  // Create PlanarRectangle
248  planarRectanglePrecise->SetPlaneGeometry(preciseGeometry);
249  planarRectanglePrecise->PlaceFigure(p0precise);
250  planarRectanglePrecise->SetCurrentControlPoint(p1precise);
251  planarRectanglePrecise->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
252  planarFigures.push_back(planarRectanglePrecise.GetPointer());
253 
254  return planarFigures;
255  }
256 
257  static PlanarFigureList CreateDeepCopiedPlanarFigures(PlanarFigureList original)
258  {
259  PlanarFigureList copiedPlanarFigures;
260 
261  PlanarFigureList::iterator it1;
262 
263  for (it1 = original.begin(); it1 != original.end(); ++it1)
264  {
265  mitk::PlanarFigure::Pointer copiedFigure = (*it1)->Clone();
266 
267  copiedPlanarFigures.push_back(copiedFigure);
268  }
269  return copiedPlanarFigures;
270  }
271 
272  static PlanarFigureList CreateClonedPlanarFigures(PlanarFigureList original)
273  {
274  PlanarFigureList clonedPlanarFigures;
275  clonedPlanarFigures.resize(original.size());
276  std::transform(original.begin(), original.end(), clonedPlanarFigures.begin(), Clone);
277  return clonedPlanarFigures;
278  }
279 
280  static void VerifyPlanarFigures(PlanarFigureList &planarFigures1, PlanarFigureList &planarFigures2)
281  {
282  PlanarFigureList::iterator it1, it2;
283 
284  int i = 0;
285  for (it1 = planarFigures1.begin(); it1 != planarFigures1.end(); ++it1)
286  {
287  bool planarFigureFound = false;
288  int j = 0;
289  for (it2 = planarFigures2.begin(); it2 != planarFigures2.end(); ++it2)
290  {
291  // Compare PlanarFigures (returns false if different types)
292  if (ComparePlanarFigures(*it1, *it2))
293  {
294  planarFigureFound = true;
295  }
296  ++j;
297  }
298 
299  // Test if (at least) on PlanarFigure of the first type was found in the second list
300  MITK_TEST_CONDITION_REQUIRED(planarFigureFound,
301  "Testing if " << (*it1)->GetNameOfClass() << " has a counterpart " << i);
302  ++i;
303  }
304  }
305 
306  static bool ComparePlanarFigures(mitk::PlanarFigure *figure1, mitk::PlanarFigure *figure2)
307  {
308  // Test if PlanarFigures are of same type; otherwise return
309  if (strcmp(figure1->GetNameOfClass(), figure2->GetNameOfClass()) != 0)
310  {
311  return false;
312  }
313 
314  if (strcmp(figure1->GetNameOfClass(), "PlanarCross") == 0)
315  {
316  std::cout << "Planar Cross Found" << std::endl;
317  }
318 
319  // Test for equal number of control points
320  if (figure1->GetNumberOfControlPoints() != figure2->GetNumberOfControlPoints())
321  {
322  return false;
323  }
324 
325  // Test if all control points are equal
326  for (unsigned int i = 0; i < figure1->GetNumberOfControlPoints(); ++i)
327  {
328  mitk::Point2D point1 = figure1->GetControlPoint(i);
329  mitk::Point2D point2 = figure2->GetControlPoint(i);
330 
331  if (point1.EuclideanDistanceTo(point2) >= mitk::eps)
332  {
333  return false;
334  }
335  }
336 
337  // Test for equal number of properties
338  typedef mitk::PropertyList::PropertyMap PropertyMap;
339  const PropertyMap *properties1 = figure1->GetPropertyList()->GetMap();
340  const PropertyMap *properties2 = figure2->GetPropertyList()->GetMap();
341 
342  if (properties1->size() != properties2->size())
343  {
344  return false;
345  }
346 
347  MITK_INFO << "List 1:";
348  for (auto i1 = properties1->begin(); i1 != properties1->end(); ++i1)
349  {
350  std::cout << i1->first << std::endl;
351  }
352 
353  MITK_INFO << "List 2:";
354  for (auto i2 = properties2->begin(); i2 != properties2->end(); ++i2)
355  {
356  std::cout << i2->first << std::endl;
357  }
358 
359  MITK_INFO << "-------";
360 
361  // Test if all properties are equal
362  if (!std::equal(properties1->begin(), properties1->end(), properties2->begin(), PropertyMapEntryCompare()))
363  {
364  return false;
365  }
366 
367  // Test if Geometry is equal
368  const mitk::PlaneGeometry *planeGeometry1 = dynamic_cast<const mitk::PlaneGeometry *>(figure1->GetPlaneGeometry());
369  const mitk::PlaneGeometry *planeGeometry2 = dynamic_cast<const mitk::PlaneGeometry *>(figure2->GetPlaneGeometry());
370 
371  // Test Geometry transform parameters
372  typedef mitk::Geometry3D::TransformType TransformType;
373  const TransformType *affineGeometry1 = planeGeometry1->GetIndexToWorldTransform();
374  const TransformType::ParametersType &parameters1 = affineGeometry1->GetParameters();
375  const TransformType::ParametersType &parameters2 = planeGeometry2->GetIndexToWorldTransform()->GetParameters();
376  for (unsigned int i = 0; i < affineGeometry1->GetNumberOfParameters(); ++i)
377  {
378  if (fabs(parameters1.GetElement(i) - parameters2.GetElement(i)) >= mitk::eps)
379  {
380  return false;
381  }
382  }
383 
384  // Test Geometry bounds
386  const BoundsArrayType &bounds1 = planeGeometry1->GetBounds();
387  const BoundsArrayType &bounds2 = planeGeometry2->GetBounds();
388  for (unsigned int i = 0; i < 6; ++i)
389  {
390  if (fabs(bounds1.GetElement(i) - bounds2.GetElement(i)) >= mitk::eps)
391  {
392  return false;
393  };
394  }
395 
396  // Test Geometry spacing and origin
397  mitk::Vector3D spacing1 = planeGeometry1->GetSpacing();
398  mitk::Vector3D spacing2 = planeGeometry2->GetSpacing();
399  if ((spacing1 - spacing2).GetNorm() >= mitk::eps)
400  {
401  return false;
402  }
403 
404  mitk::Point3D origin1 = planeGeometry1->GetOrigin();
405  mitk::Point3D origin2 = planeGeometry2->GetOrigin();
406 
407  if (origin1.EuclideanDistanceTo(origin2) >= mitk::eps)
408  {
409  return false;
410  }
411  return true;
412  }
413 
414  static void SerializePlanarFigures(PlanarFigureList &planarFigures, std::string &fileName)
415  {
416  // std::string sceneFileName = Poco::Path::temp() + /*Poco::Path::separator() +*/ "scene.zip";
417  std::cout << "File name: " << fileName << std::endl;
418 
420  writer->SetFileName(fileName.c_str());
421 
422  unsigned int i;
423  PlanarFigureList::iterator it;
424  for (it = planarFigures.begin(), i = 0; it != planarFigures.end(); ++it, ++i)
425  {
426  writer->SetInput(i, *it);
427  }
428 
429  writer->Update();
430 
431  MITK_TEST_CONDITION_REQUIRED(writer->GetSuccess(), "Testing if writing was successful");
432  }
433 
434  static PlanarFigureList DeserializePlanarFigures(std::string &fileName)
435  {
436  // Read in the planar figures
438  reader->SetFileName(fileName.c_str());
439  reader->Update();
440 
441  MITK_TEST_CONDITION_REQUIRED(reader->GetSuccess(), "Testing if reading was successful");
442 
443  // Store them in the list and return it
444  PlanarFigureList planarFigures;
445  for (unsigned int i = 0; i < reader->GetNumberOfOutputs(); ++i)
446  {
447  mitk::PlanarFigure *figure = reader->GetOutput(i);
448  planarFigures.push_back(figure);
449  }
450 
451  return planarFigures;
452  }
453 
454  static PlanarFigureToMemoryWriterList SerializePlanarFiguresToMemoryBuffers(PlanarFigureList &planarFigures)
455  {
456  PlanarFigureToMemoryWriterList pfMemoryWriters;
457  unsigned int i;
458  PlanarFigureList::iterator it;
459 
460  bool success = true;
461  for (it = planarFigures.begin(), i = 0; it != planarFigures.end(); ++it, ++i)
462  {
464  writer->SetWriteToMemory(true);
465  writer->SetInput(*it);
466  writer->Update();
467 
468  pfMemoryWriters.push_back(writer);
469 
470  if (!writer->GetSuccess())
471  success = false;
472  }
473 
474  MITK_TEST_CONDITION_REQUIRED(success, "Testing if writing to memory buffers was successful");
475 
476  return pfMemoryWriters;
477  }
478 
479  static PlanarFigureList DeserializePlanarFiguresFromMemoryBuffers(PlanarFigureToMemoryWriterList pfMemoryWriters)
480  {
481  // Store them in the list and return it
482  PlanarFigureList planarFigures;
483  bool success = true;
484  for (unsigned int i = 0; i < pfMemoryWriters.size(); ++i)
485  {
486  // Read in the planar figures
488  reader->SetReadFromMemory(true);
489  reader->SetMemoryBuffer(pfMemoryWriters[i]->GetMemoryPointer(), pfMemoryWriters[i]->GetMemorySize());
490  reader->Update();
491  mitk::PlanarFigure *figure = reader->GetOutput(0);
492  planarFigures.push_back(figure);
493 
494  if (!reader->GetSuccess())
495  success = false;
496  }
497 
498  MITK_TEST_CONDITION_REQUIRED(success, "Testing if reading was successful");
499 
500  return planarFigures;
501  }
502 
503 private:
504  class PropertyMapEntryCompare
505  {
506  public:
507  bool operator()(const mitk::PropertyList::PropertyMap::value_type &entry1,
508  const mitk::PropertyList::PropertyMap::value_type &entry2)
509  {
510  MITK_INFO << "Comparing " << entry1.first << "(" << entry1.second->GetValueAsString() << ") and " << entry2.first
511  << "(" << entry2.second->GetValueAsString() << ")";
512  // Compare property objects contained in the map entries (see mitk::PropertyList)
513  return *(entry1.second) == *(entry2.second);
514  }
515  };
516 
517 }; // end test helper class
518 
528 int mitkPlanarFigureIOTest(int /* argc */, char * /*argv*/ [])
529 {
530  MITK_TEST_BEGIN("PlanarFigureIO");
531 
532  // Create a number of PlanarFigure objects
533  PlanarFigureIOTestClass::PlanarFigureList originalPlanarFigures = PlanarFigureIOTestClass::CreatePlanarFigures();
534 
535  // Create a number of "deep-copied" planar figures to test the DeepCopy function (deprecated)
536  PlanarFigureIOTestClass::PlanarFigureList copiedPlanarFigures =
537  PlanarFigureIOTestClass::CreateDeepCopiedPlanarFigures(originalPlanarFigures);
538 
539  PlanarFigureIOTestClass::VerifyPlanarFigures(originalPlanarFigures, copiedPlanarFigures);
540 
541  // Create a number of cloned planar figures to test the Clone function
542  PlanarFigureIOTestClass::PlanarFigureList clonedPlanarFigures =
543  PlanarFigureIOTestClass::CreateClonedPlanarFigures(originalPlanarFigures);
544 
545  PlanarFigureIOTestClass::VerifyPlanarFigures(originalPlanarFigures, clonedPlanarFigures);
546 
547  // Write PlanarFigure objects into temp file
548  // tmpname
549  static unsigned long count = 0;
550  unsigned long n = count++;
551  std::ostringstream name;
552  for (int i = 0; i < 6; ++i)
553  {
554  name << char('a' + (n % 26));
555  n /= 26;
556  }
557  std::string myname;
558  myname.append(name.str());
559 
560  std::string fileName = itksys::SystemTools::GetCurrentWorkingDirectory() + myname + ".pf";
561 
562  PlanarFigureIOTestClass::SerializePlanarFigures(originalPlanarFigures, fileName);
563 
564  // Write PlanarFigure objects to memory buffers
565  PlanarFigureIOTestClass::PlanarFigureToMemoryWriterList writersWithMemoryBuffers =
566  PlanarFigureIOTestClass::SerializePlanarFiguresToMemoryBuffers(originalPlanarFigures);
567 
568  // Read PlanarFigure objects from temp file
569  PlanarFigureIOTestClass::PlanarFigureList retrievedPlanarFigures =
570  PlanarFigureIOTestClass::DeserializePlanarFigures(fileName);
571 
572  // Read PlanarFigure objects from memory buffers
573  PlanarFigureIOTestClass::PlanarFigureList retrievedPlanarFiguresFromMemory =
574  PlanarFigureIOTestClass::DeserializePlanarFiguresFromMemoryBuffers(writersWithMemoryBuffers);
575 
576  auto it = writersWithMemoryBuffers.begin();
577  while (it != writersWithMemoryBuffers.end())
578  {
579  (*it)->ReleaseMemory();
580  ++it;
581  }
582 
583  // Test if original and retrieved PlanarFigure objects are the same
584  PlanarFigureIOTestClass::VerifyPlanarFigures(originalPlanarFigures, retrievedPlanarFigures);
585 
586  // Test if original and memory retrieved PlanarFigure objects are the same
587  PlanarFigureIOTestClass::VerifyPlanarFigures(originalPlanarFigures, retrievedPlanarFiguresFromMemory);
588 
589  // empty the originalPlanarFigures
590  originalPlanarFigures.empty();
591 
592  // Test if deep-copied and retrieved PlanarFigure objects are the same
593  PlanarFigureIOTestClass::VerifyPlanarFigures(copiedPlanarFigures, retrievedPlanarFigures);
594 
595  MITK_TEST_END()
596 }
const Point3D GetOrigin() const
Get the origin, e.g. the upper-left corner of the plane.
static Pointer New()
BoundingBoxType::BoundsArrayType BoundsArrayType
#define MITK_INFO
Definition: mitkLogMacros.h:22
static Pointer New()
#define MITK_TEST_CONDITION_REQUIRED(COND, MSG)
GeometryTransformHolder::TransformType TransformType
static Pointer New()
const mitk::Vector3D GetSpacing() const
Get the spacing (size of a pixel).
virtual const PlaneGeometry * GetPlaneGeometry() const
Returns (previously set) 2D geometry of this figure.
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
int mitkPlanarFigureIOTest(int, char *[])
Test for PlanarFigure reader and writer classes.
const BoundsArrayType GetBounds() const
static Pointer New()
std::map< std::string, BaseProperty::Pointer > PropertyMap
static Pointer New()
mitk::PropertyList::Pointer GetPropertyList() const
Get the data's property list.
static Pointer New()
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons...
Point2D GetControlPoint(unsigned int index) const
Returns specified control point in 2D world coordinates.
static Pointer New()
MITKCORE_EXPORT const ScalarType eps
Describes a two-dimensional, rectangular plane.
static Pointer New()
and MITK_TEST_END()
static mitk::PlanarFigure::Pointer Clone(mitk::PlanarFigure::Pointer original)
static Pointer New()
unsigned int GetNumberOfControlPoints() const
Returns the current number of 2D control points defining this figure.
mitk::AffineTransform3D * GetIndexToWorldTransform()
Get the transformation used to convert from index to world coordinates.
BoundingBoxType::BoundsArrayType BoundsArrayType