Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkImageVtkMapper2DColorTest.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 mitkImageVtkMapper2DColorTest(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  // Set the opacity for all images
34  renderingHelper.SetImageProperty("color", mitk::ColorProperty::New(0.0f, 0.0f, 255.0f));
35  // for now this test renders in sagittal view direction
37 
38  //### Usage of CompareRenderWindowAgainstReference: See docu of mitkRrenderingTestHelper
39  MITK_TEST_CONDITION(renderingHelper.CompareRenderWindowAgainstReference(argc, argv) == true,
40  "CompareRenderWindowAgainstReference test result positive?");
41 
42  //####################
43  // Use this to generate a reference screenshot or save the file.
44  //(Only in your local version of the test!)
45  if (false)
46  {
47  renderingHelper.SaveReferenceScreenShot("/home/kilgus/Pictures/RenderingTestData/output.png");
48  }
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)
int mitkImageVtkMapper2DColorTest(int argc, char *argv[])
static Pointer New()
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 ...
void SetImageProperty(const char *propertyKey, mitk::BaseProperty *property)
This method set the property of the member datastorage.
#define MITK_TEST_CONDITION(COND, MSG)
and MITK_TEST_END()