Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkPointSetVtkMapper2DTest.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 mitkPointSetVtkMapper2DTest(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("mitkPointSetVtkMapper2DTest")
31 
32  mitk::RenderingTestHelper renderingHelper(640, 480, argc, argv);
33 
34  // sagittal view direction
36 
37  // disables anti-aliasing which is enabled on several graphics cards and
38  // causes problems when doing a pixel-wise comparison to a reference image
39  renderingHelper.GetVtkRenderWindow()->SetMultiSamples(0);
40 
41  //### Usage of CompareRenderWindowAgainstReference: See docu of mitkRrenderingTestHelper
42  MITK_TEST_CONDITION(renderingHelper.CompareRenderWindowAgainstReference(argc, argv) == true,
43  "CompareRenderWindowAgainstReference test result positive?");
44 
45  // use this to generate a reference screenshot or save the file:
46  if (false)
47  {
48  renderingHelper.SaveReferenceScreenShot("C:/development_ITK4/output.png");
49  }
50 
51  MITK_TEST_END();
52 }
void SetViewDirection(mitk::SliceNavigationController::ViewDirection viewDirection)
Set the view direction of the renderwindow (e.g. sagittal, coronal, axial)
vtkRenderWindow * GetVtkRenderWindow()
Getter for the vtkRenderWindow which should be used to call vtkRegressionTestImage.
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 mitkPointSetVtkMapper2DTest(int argc, char *argv[])
#define MITK_TEST_CONDITION(COND, MSG)
and MITK_TEST_END()