Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkImageVtkMapper2DTest.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 mitkImageVtkMapper2DTest(int argc, char *argv[])
25 {
26  // load all arguments into a datastorage, take last argument as reference rendering
27  // setup a renderwindow of fixed size X*Y
28  // render the datastorage
29  // compare rendering to reference image
30  MITK_TEST_BEGIN("mitkImageVtkMapper2DTest")
31 
32  mitk::RenderingTestHelper renderingHelper(640, 480, argc, argv);
33 
34  //### Usage of CompareRenderWindowAgainstReference: See docu of mitkRrenderingTestHelper
35  MITK_TEST_CONDITION(renderingHelper.CompareRenderWindowAgainstReference(argc, argv) == true,
36  "CompareRenderWindowAgainstReference test result positive?");
37 
38  // use this to generate a reference screenshot or save the file:
39  if (false)
40  {
41  renderingHelper.SaveReferenceScreenShot("/home/kilgus/Pictures/RenderingTestData/output.png");
42  }
43 
44  MITK_TEST_END();
45 }
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
void SaveReferenceScreenShot(std::string fileName)
SaveReferenceScreenShot Convenience method to save a reference screen shot.
bool CompareRenderWindowAgainstReference(int argc, char *argv[], double threshold=10.0)
CompareRenderWindowAgainstReference Convenience method to compare the image rendered in the internal ...
int mitkImageVtkMapper2DTest(int argc, char *argv[])
#define MITK_TEST_CONDITION(COND, MSG)
and MITK_TEST_END()