Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkImageVtkMapper2DOpacityTest.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 mitkImageVtkMapper2DOpacityTest(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("opacity", mitk::FloatProperty::New(0.5f));
35  // for now this test renders in coronal 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  // use this to generate a reference screenshot or save the file:
43  if (false)
44  {
45  renderingHelper.SaveReferenceScreenShot("d:/tmp/renderingtest.png");
46  }
47 
48  MITK_TEST_END();
49 }
void SetViewDirection(mitk::SliceNavigationController::ViewDirection viewDirection)
Set the view direction of the renderwindow (e.g. sagittal, coronal, axial)
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)
static Pointer New()
and MITK_TEST_END()
int mitkImageVtkMapper2DOpacityTest(int argc, char *argv[])