Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkSceneIOCompatibilityTest.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 // MITK
19 #include "mitkTestingMacros.h"
20 
21 // VTK
22 #include <vtkRegressionTestImage.h>
23 
24 int mitkSceneIOCompatibilityTest(int argc, char *argv[])
25 {
26  // Load all arguments but last into a DataStorage,
27  // Take last argument as reference rendering.
28  //
29  // Setup a renderwindow of fixed size X*Y.
30  // Render the DataStorage.
31  // Compare rendering to reference image.
32  MITK_TEST_BEGIN("mitkSceneIOCompatibilityTest")
33 
34  mitk::RenderingTestHelper renderingHelper(200, 200, argc, argv);
35 
36  // Usage of CompareRenderWindowAgainstReference: See documentation of mitkRenderingTestHelper
37  MITK_TEST_CONDITION(renderingHelper.CompareRenderWindowAgainstReference(argc, argv) == true,
38  "CompareRenderWindowAgainstReference test result positive?");
39 
40  // You can use this to generate a new reference
41  // on your platform or after changes:
42  if (false)
43  {
44  renderingHelper.SaveReferenceScreenShot("/where/you/want.png");
45  }
46 
47  MITK_TEST_END();
48 }
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
void SaveReferenceScreenShot(std::string fileName)
SaveReferenceScreenShot Convenience method to save a reference screen shot.
int mitkSceneIOCompatibilityTest(int argc, char *argv[])
bool CompareRenderWindowAgainstReference(int argc, char *argv[], double threshold=10.0)
CompareRenderWindowAgainstReference Convenience method to compare the image rendered in the internal ...
#define MITK_TEST_CONDITION(COND, MSG)
and MITK_TEST_END()