本文整理汇总了C++中MITK_TEST_END函数的典型用法代码示例。如果您正苦于以下问题:C++ MITK_TEST_END函数的具体用法?C++ MITK_TEST_END怎么用?C++ MITK_TEST_END使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MITK_TEST_END函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mitkPropertyDescriptionsTest
int mitkPropertyDescriptionsTest(int, char* [])
{
MITK_TEST_BEGIN("mitkPropertyDescriptionsTest");
mitk::IPropertyDescriptions* propertyDescriptions = mitk::CoreServices::GetPropertyDescriptions();
MITK_TEST_CONDITION_REQUIRED(propertyDescriptions != NULL, "Get property descriptions service");
propertyDescriptions->AddDescription("propertyName1", "description1a");
propertyDescriptions->AddDescription("propertyName1", "description1b");
std::string description1 = propertyDescriptions->GetDescription("propertyName1");
MITK_TEST_CONDITION(
description1 == "description1a",
"Get description of \"propertyName1\"");
propertyDescriptions->AddDescription("propertyName1", "description1b", "", true);
description1 = propertyDescriptions->GetDescription("propertyName1");
MITK_TEST_CONDITION(
description1 == "description1b",
"Get overwritten description of \"propertyName1\"");
propertyDescriptions->AddDescription("propertyName1", "description1c", "className");
std::string description2 = propertyDescriptions->GetDescription("propertyName1", "className");
description1 = propertyDescriptions->GetDescription("propertyName1");
MITK_TEST_CONDITION(
description1 == "description1b" && description2 == "description1c",
"Get description of \"propertyName1\" restricted to \"className\"");
MITK_TEST_END();
}
示例2: mitkFiberTransformationTest
/**Documentation
* Test if fiber transfortaiom methods work correctly
*/
int mitkFiberTransformationTest(int argc, char* argv[])
{
MITK_TEST_BEGIN("mitkFiberTransformationTest");
MITK_TEST_CONDITION_REQUIRED(argc==3,"check for input data")
try{
RegisterFiberTrackingObjectFactory();
mitk::FiberBundleX::Pointer groundTruthFibs = dynamic_cast<mitk::FiberBundleX*>(mitk::IOUtil::LoadDataNode(argv[1])->GetData());
mitk::FiberBundleX::Pointer transformedFibs = dynamic_cast<mitk::FiberBundleX*>(mitk::IOUtil::LoadDataNode(argv[2])->GetData());
groundTruthFibs->RotateAroundAxis(90, 45, 10);
groundTruthFibs->TranslateFibers(2, 3, 5);
groundTruthFibs->ScaleFibers(1, 0.1, 1.3);
groundTruthFibs->RemoveLongFibers(150);
groundTruthFibs->RemoveShortFibers(20);
groundTruthFibs->DoFiberSmoothing(1.0);
groundTruthFibs->ApplyCurvatureThreshold(3.0, true);
groundTruthFibs->MirrorFibers(0);
groundTruthFibs->MirrorFibers(1);
groundTruthFibs->MirrorFibers(2);
MITK_TEST_CONDITION_REQUIRED(groundTruthFibs->Equals(transformedFibs),"check transformation")
}
catch(...) {
return EXIT_FAILURE;
}
// always end with this!
MITK_TEST_END();
}
示例3: mitkSurfaceGLMapper2DOpacityTest
int mitkSurfaceGLMapper2DOpacityTest(int argc, char* argv[])
{
// load all arguments into a datastorage, take last argument as reference rendering
// setup a renderwindow of fixed size X*Y
// render the datastorage
// compare rendering to reference image
MITK_TEST_BEGIN("mitkSurfaceGLMapper2DOpacityTest")
mitk::RenderingTestHelper renderingHelper(640, 480, argc, argv);
//Set the opacity for all images
renderingHelper.GetDataStorage()->GetNode(mitk::NodePredicateDataType::New("Surface"))->SetProperty("opacity", mitk::FloatProperty::New(0.5f));
//### Usage of CompareRenderWindowAgainstReference: See docu of mitkRrenderingTestHelper
MITK_TEST_CONDITION( renderingHelper.CompareRenderWindowAgainstReference(argc, argv) == true, "CompareRenderWindowAgainstReference test result positive?" );
//####################
//Use this to generate a reference screenshot or save the file.
//(Only in your local version of the test!)
if(false)
{
renderingHelper.SaveReferenceScreenShot("/home/kilgus/Pictures/RenderingTestData/output.png");
}
//####################
MITK_TEST_END();
}
示例4: mitkTextOverlay2DRenderingTest
int mitkTextOverlay2DRenderingTest(int argc, char* argv[])
{
// load all arguments into a datastorage, take last argument as reference rendering
// setup a renderwindow of fixed size X*Y
// render the datastorage
// compare rendering to reference image
MITK_TEST_BEGIN("mitkTextOverlay2DRenderingTest")
mitk::RenderingTestHelper renderingHelper(640, 480, argc, argv);
// renderingHelper.SetAutomaticallyCloseRenderWindow(false);
mitk::BaseRenderer* renderer = mitk::BaseRenderer::GetInstance(renderingHelper.GetVtkRenderWindow());
mitk::OverlayManager::Pointer OverlayManager = mitk::OverlayManager::New();
renderer->SetOverlayManager(OverlayManager);
//Add the overlay to the overlayManager. It is added to all registered renderers automaticly
OverlayManager->AddOverlay(createTextOverlay(20,1,0,0,200,400,"Test1").GetPointer());
OverlayManager->AddOverlay(createTextOverlay(30,0,1,0,400,400,"Test2").GetPointer());
OverlayManager->AddOverlay(createTextOverlay(15,0,0,1,400,200,"Test3").GetPointer());
OverlayManager->AddOverlay(createTextOverlay(10,1,0,0,20,200,"Test4").GetPointer());
renderingHelper.Render();
//use this to generate a reference screenshot or save the file:
bool generateReferenceScreenshot = false;
if(generateReferenceScreenshot)
{
renderingHelper.SaveReferenceScreenShot("/home/christoph/Pictures/RenderingTestData/mitkTextOverlay2DRenderingTest_ball.png");
}
//### Usage of CompareRenderWindowAgainstReference: See docu of mitkRrenderingTestHelper
MITK_TEST_CONDITION( renderingHelper.CompareRenderWindowAgainstReference(argc, argv) == true, "CompareRenderWindowAgainstReference test result positive?" );
MITK_TEST_END();
}
示例5: mitkNDIProtocolTest
/**Documentation
* Test for mitk::NDIProtocol
*/
int mitkNDIProtocolTest(int /* argc */, char* /*argv*/[])
{
// always start with this!
MITK_TEST_BEGIN("NDIProtocolTest");
// let's create an object of our class
mitk::NDIProtocol::Pointer myNDIProtocol = NDIProtocolTestClass::New().GetPointer();
// first test: did this work?
// using MITK_TEST_CONDITION_REQUIRED makes the test stop after failure, since
// it makes no sense to continue without an object.
MITK_TEST_CONDITION_REQUIRED(myNDIProtocol.IsNotNull(),"Testing instantiation");
//COMM(mitk::SerialCommunication::BaudRate baudRate , mitk::SerialCommunication::DataBits dataBits, mitk::SerialCommunication::Parity parity, mitk::SerialCommunication::StopBits stopBits, mitk::SerialCommunication::HardwareHandshake hardwareHandshake)
//No testing possible, hardware required
//All other methods
//No testing possible, hardware required
// always end with this!
MITK_TEST_END();
}
示例6: mitkNavigationDataTest
/**
* This function is testing the Class mitk::NavigationData. For most tests we would need the MicronTracker hardware, so only a few
* simple tests, which can run without the hardware are implemented yet (2009, January, 23rd). As soon as there is a working
* concept to test the tracking classes which are very close to the hardware on all systems more tests are needed here.
*/
int mitkNavigationDataTest(int /* argc */, char* /*argv*/[])
{
MITK_TEST_BEGIN("NavigationData");
//TestInstatiation();
//TestGetterSetter();
//TestGraft();
//TestPrintSelf();
//TestWrongInputs();
//TestAffineConstructor();
//TestAffineConstructorErrorDeterminantNonEqualOne();
//TestAffineConstructorErrorTransposedNotInverse();
//TestAffineConstructorErrorCheckingFalse();
//TestAffineGetter();
//TestAffineToNaviDataToAffine();
//TestTransform();
//TestInverse();
//TestDoubleInverse();
TestInverseError();
//TestCompose();
//TestReverseCompose();
MITK_TEST_END();
}
示例7: mitkToFImageWriterTest
/**Documentation
* test for the class "ToFImageWriter".
*/
int mitkToFImageWriterTest(int /* argc */, char* /*argv*/[])
{
MITK_TEST_BEGIN("ToFImageWriter");
//testing initialization of object
mitk::ToFImageWriter::Pointer tofWriter = mitk::ToFImageWriter::New();
MITK_TEST_CONDITION_REQUIRED(tofWriter.GetPointer(), "Testing initialization of test object!");
MITK_TEST_CONDITION_REQUIRED(tofWriter->GetExtension()!= "", "Test initialization of member extension!");
MITK_TEST_CONDITION_REQUIRED(tofWriter->GetDistanceImageFileName()== "", "Test initialization of member distanceImageFileName!");
MITK_TEST_CONDITION_REQUIRED(tofWriter->GetAmplitudeImageFileName()== "", "Test initialization of member amplitudeImageFileName!");
MITK_TEST_CONDITION_REQUIRED(tofWriter->GetIntensityImageFileName()== "", "Test initialization of member intnensityImageFileName!");
MITK_TEST_CONDITION_REQUIRED(tofWriter->GetDistanceImageSelected()==true, "Test initialization of member distanceImageSelected!");
MITK_TEST_CONDITION_REQUIRED(tofWriter->GetAmplitudeImageSelected()==false, "Test initialization of member amplitudeImageSelected!");
MITK_TEST_CONDITION_REQUIRED(tofWriter->GetIntensityImageSelected()==false, "Test initialization of member intensityImageSelected!");
MITK_TEST_CONDITION_REQUIRED(tofWriter->GetRGBImageSelected()==false, "Test initialization of member rgbImageSelected!");
MITK_TEST_CONDITION_REQUIRED(tofWriter->GetToFCaptureWidth()== 200, "Test initialization of member captureWidth!");
MITK_TEST_CONDITION_REQUIRED(tofWriter->GetToFCaptureHeight()== 200, "Test initialization of member captureHeight!");
MITK_TEST_CONDITION_REQUIRED(tofWriter->GetToFImageType()== mitk::ToFImageWriter::ToFImageType3D, "Test initialization of member ToFImageType!");
//set member parameter and test again
unsigned int dimX = 255;
unsigned int dimY = 188;
std::string distanceImageFileName("distImg.pic");
std::string amplitudeImageFileName("amplImg.pic");
std::string intensityImageFileName("intImg.pic");
std::string rgbImageFileName("rgbImg.pic");
std::string fileExtension(".test");
bool distanceImageSelected = false;
bool amplitudeImageSelected = false;
bool intensityImageSelected = false;
bool rgbImageSelected = false;
tofWriter->SetToFCaptureWidth(dimX);
tofWriter->SetToFCaptureHeight(dimY);
tofWriter->SetDistanceImageFileName(distanceImageFileName);
tofWriter->SetAmplitudeImageFileName(amplitudeImageFileName);
tofWriter->SetIntensityImageFileName(intensityImageFileName);
tofWriter->SetRGBImageFileName(rgbImageFileName);
tofWriter->SetExtension(fileExtension);
tofWriter->SetDistanceImageSelected(distanceImageSelected);
tofWriter->SetAmplitudeImageSelected(amplitudeImageSelected);
tofWriter->SetIntensityImageSelected(intensityImageSelected);
tofWriter->SetRGBImageSelected(rgbImageSelected);
tofWriter->SetToFImageType(mitk::ToFImageWriter::ToFImageType2DPlusT);
MITK_TEST_CONDITION_REQUIRED(distanceImageFileName==tofWriter->GetDistanceImageFileName(), "Testing set/get distance image file name");
MITK_TEST_CONDITION_REQUIRED(amplitudeImageFileName==tofWriter->GetAmplitudeImageFileName(), "Testing set/get amplitude image file name");
MITK_TEST_CONDITION_REQUIRED(intensityImageFileName==tofWriter->GetIntensityImageFileName(), "Testing set/get intensity image file name");
MITK_TEST_CONDITION_REQUIRED(rgbImageFileName==tofWriter->GetRGBImageFileName(), "Testing set/get rgb image file name");
MITK_TEST_CONDITION_REQUIRED(dimX==tofWriter->GetToFCaptureWidth(), "Testing set/get CaptureWidth");
MITK_TEST_CONDITION_REQUIRED(dimY==tofWriter->GetToFCaptureHeight(), "Testing set/get CaptureHeight");
MITK_TEST_CONDITION_REQUIRED(distanceImageSelected==tofWriter->GetDistanceImageSelected(), "Testing set/get distance image selection");
MITK_TEST_CONDITION_REQUIRED(amplitudeImageSelected==tofWriter->GetAmplitudeImageSelected(), "Testing set/get amplitude image selection");
MITK_TEST_CONDITION_REQUIRED(intensityImageSelected==tofWriter->GetIntensityImageSelected(), "Testing set/get intensity image selection");
MITK_TEST_CONDITION_REQUIRED(rgbImageSelected==tofWriter->GetRGBImageSelected(), "Testing set/get rgb image selection");
MITK_TEST_CONDITION_REQUIRED(fileExtension==tofWriter->GetExtension(), "Testing set/get file extension");
MITK_TEST_CONDITION_REQUIRED(mitk::ToFImageWriter::ToFImageType2DPlusT==tofWriter->GetToFImageType(), "Testing set/get ToFImageType");
MITK_TEST_END();
}
示例8: mitkToFCameraPMDCamCubeControllerTest
/**Documentation
* test for the class "ToFCameraPMDCamCubeController".
*/
int mitkToFCameraPMDCamCubeControllerTest(int /* argc */, char* /*argv*/[])
{
MITK_TEST_BEGIN("ToFCameraPMDCamCubeController");
mitk::ToFCameraPMDCamCubeController::Pointer camCubeController = mitk::ToFCameraPMDCamCubeController::New();
try
{
MITK_TEST_CONDITION_REQUIRED(camCubeController.IsNotNull(),"Testing initialzation!");
MITK_TEST_CONDITION_REQUIRED(camCubeController->GetCaptureHeight()== 200 ,"Testing initialization of CaptureHeight");
MITK_TEST_CONDITION_REQUIRED(camCubeController->GetCaptureWidth()== 200 ,"Testing initialization of CaptureWidth");
MITK_TEST_CONDITION_REQUIRED(camCubeController->OpenCameraConnection(),"Testing opening of camera connection!");
MITK_TEST_CONDITION_REQUIRED(camCubeController->UpdateCamera(),"Testing UpdateCamera()");
MITK_TEST_CONDITION_REQUIRED(camCubeController->SetDistanceOffset(0.5f),"Testing SetDistanceOffset()");
MITK_TEST_OUTPUT(<<"Call GetDistanceOffset()");
MITK_INFO<<camCubeController->GetDistanceOffset();
MITK_TEST_CONDITION_REQUIRED(camCubeController->SetRegionOfInterest(3,5,200,201),"Testing SetRegionOfInterest()");
MITK_TEST_OUTPUT(<<"Call GetRegionOfInterest()");
MITK_INFO<<camCubeController->GetRegionOfInterest();
MITK_TEST_CONDITION_REQUIRED(camCubeController->SetExposureMode(0),"Testing SetExposureMode()");
MITK_TEST_CONDITION_REQUIRED(camCubeController->SetFieldOfView(35.7f),"Testing SetFieldOfView()");
MITK_TEST_CONDITION_REQUIRED(camCubeController->SetFPNCalibration(true),"Testing SetFPNCalibration()");
MITK_TEST_CONDITION_REQUIRED(camCubeController->SetFPPNCalibration(true),"Testing SetFPPNCalibration()");
MITK_TEST_CONDITION_REQUIRED(camCubeController->SetLinearityCalibration(true),"Testing SetLinearityCalibration()");
MITK_TEST_CONDITION_REQUIRED(camCubeController->SetLensCalibration(true),"Testing SetLensCalibration()");
MITK_TEST_CONDITION_REQUIRED(camCubeController->CloseCameraConnection(),"Testing closing of camera connection!");
}
catch(std::exception &e)
{
MITK_INFO << e.what();
}
MITK_TEST_END();
}
示例9: mitkPropertyExtensionsTest
int mitkPropertyExtensionsTest(int, char *[])
{
MITK_TEST_BEGIN("mitkPropertyExtensionsTest");
mitk::IPropertyExtensions *propertyExtensions = mitk::CoreServices::GetPropertyExtensions();
MITK_TEST_CONDITION_REQUIRED(propertyExtensions != NULL, "Get property extensions service");
propertyExtensions->AddExtension("propertyName1", TestPropertyExtension::New("extension1a").GetPointer());
propertyExtensions->AddExtension("propertyName1", TestPropertyExtension::New("extension1b").GetPointer());
TestPropertyExtension::Pointer extension1 =
dynamic_cast<TestPropertyExtension *>(propertyExtensions->GetExtension("propertyName1").GetPointer());
MITK_TEST_CONDITION(extension1.IsNotNull() && extension1->GetName() == "extension1a",
"Get extension of \"propertyName1\"");
propertyExtensions->AddExtension("propertyName1", TestPropertyExtension::New("extension1b").GetPointer(), "", true);
extension1 = dynamic_cast<TestPropertyExtension *>(propertyExtensions->GetExtension("propertyName1").GetPointer());
MITK_TEST_CONDITION(extension1.IsNotNull() && extension1->GetName() == "extension1b",
"Get overwritten extension of \"propertyName1\"");
propertyExtensions->AddExtension(
"propertyName1", TestPropertyExtension::New("extension1c").GetPointer(), "className");
TestPropertyExtension::Pointer extension2 =
dynamic_cast<TestPropertyExtension *>(propertyExtensions->GetExtension("propertyName1", "className").GetPointer());
extension1 = dynamic_cast<TestPropertyExtension *>(propertyExtensions->GetExtension("propertyName1").GetPointer());
MITK_TEST_CONDITION(extension1.IsNotNull() && extension1->GetName() == "extension1b" && extension2.IsNotNull() &&
extension2->GetName() == "extension1c",
"Get extension of \"propertyName1\" restricted to \"className\"");
MITK_TEST_END();
}
示例10: mitkPointSetVtkMapper2DImageTest
int mitkPointSetVtkMapper2DImageTest(int argc, char* argv[])
{
// load all arguments into a datastorage, take last argument as reference rendering
// setup a renderwindow of fixed size X*Y
// render the datastorage
// compare rendering to reference image
MITK_TEST_BEGIN("mitkPointSetVtkMapper2DImageTest")
mitk::RenderingTestHelper renderingHelper(640, 480, argc, argv);
// disables anti-aliasing which is enabled on several graphics cards and
// causes problems when doing a pixel-wise comparison to a reference image
renderingHelper.GetVtkRenderWindow()->SetMultiSamples(0);
//### Usage of CompareRenderWindowAgainstReference: See docu of mitkRrenderingTestHelper
MITK_TEST_CONDITION( renderingHelper.CompareRenderWindowAgainstReference(argc, argv) == true, "CompareRenderWindowAgainstReference test result positive?" );
//use this to generate a reference screenshot or save the file:
if(false)
{
renderingHelper.SaveReferenceScreenShot("C:/development_ITK4/output.png");
}
MITK_TEST_END();
}
示例11: mitkPlanarPolygonTest
/**
* mitkplanarPolygonTest tests the methods and behavior of mitk::PlanarPolygon with sub-tests:
*
* 1. Instantiation and basic tests, including feature evaluation
*
*/
int mitkPlanarPolygonTest(int /* argc */, char* /*argv*/[])
{
// always start with this!
MITK_TEST_BEGIN("planarPolygon")
// create PlaneGeometry on which to place the planarPolygon
mitk::PlaneGeometry::Pointer planeGeometry = mitk::PlaneGeometry::New();
planeGeometry->InitializeStandardPlane( 100.0, 100.0 );
// **************************************************************************
// 1. Instantiation and basic tests, including feature evaluation
mitk::PlanarPolygon::Pointer planarPolygon = mitk::PlanarPolygon::New();
planarPolygon->SetGeometry2D( planeGeometry );
// first test: did this work?
MITK_TEST_CONDITION_REQUIRED( planarPolygon.IsNotNull(), "Testing instantiation" );
// Test placement of planarPolygon by control points
mitkPlanarPolygonTestClass::TestPlanarPolygonPlacement( planarPolygon );
mitkPlanarPolygonTestClass::TestPlanarPolygonEditing( planarPolygon );
// always end with this!
MITK_TEST_END();
}
示例12: mitkSceneIOCompatibilityTest
int mitkSceneIOCompatibilityTest(int argc, char *argv[])
{
try
{
mitk::RenderingTestHelper openGlTest(640, 480);
}
catch (const mitk::TestNotRunException &e)
{
MITK_WARN << "Test not run: " << e.GetDescription();
return 77;
}
// Load all arguments but last into a DataStorage,
// Take last argument as reference rendering.
//
// Setup a renderwindow of fixed size X*Y.
// Render the DataStorage.
// Compare rendering to reference image.
MITK_TEST_BEGIN("mitkSceneIOCompatibilityTest")
mitk::RenderingTestHelper renderingHelper(200, 200, argc, argv);
// Usage of CompareRenderWindowAgainstReference: See documentation of mitkRenderingTestHelper
MITK_TEST_CONDITION(renderingHelper.CompareRenderWindowAgainstReference(argc, argv) == true,
"CompareRenderWindowAgainstReference test result positive?");
// You can use this to generate a new reference
// on your platform or after changes:
if (false)
{
renderingHelper.SaveReferenceScreenShot("/where/you/want.png");
}
MITK_TEST_END();
}
示例13: mitkSurfaceDepthSortingTest
int mitkSurfaceDepthSortingTest(int argc, char *argv[])
{
// load all arguments into a datastorage, take last argument as reference rendering
// setup a renderwindow of fixed size X*Y
// render the datastorage
// compare rendering to reference image
MITK_TEST_BEGIN("mitkRenderingDepthSortingTest")
mitk::RenderingTestHelper renderingHelper(640, 480, argc, argv);
renderingHelper.SetMapperIDToRender3D();
mitk::DataNode *dataNode = renderingHelper.GetDataStorage()->GetNode(mitk::NodePredicateDataType::New("Surface"));
if (dataNode)
{
dataNode->SetOpacity(0.8);
dataNode->SetBoolProperty("Depth Sorting", true);
dataNode->Update();
}
//### Usage of CompareRenderWindowAgainstReference: See docu of mitkRrenderingTestHelper
MITK_TEST_CONDITION(renderingHelper.CompareRenderWindowAgainstReference(argc, argv) == true,
"CompareRenderWindowAgainstReference test result positive?");
MITK_TEST_END();
}
示例14: mitkGenericPropertyTest
int mitkGenericPropertyTest(int /*argc*/, char* /*argv*/[])
{
MITK_TEST_BEGIN(GenericPropertyTest)
// testing for some different data types
TestGenericPropertyForDataType<mitk::IntProperty>(1, 2, "1", "2", "int");
TestGenericPropertyForDataType<mitk::BoolProperty>(true, false, "1", "0", "bool");
TestGenericPropertyForDataType<mitk::FloatProperty>(1.0, -1.0, "1", "-1", "float");
TestGenericPropertyForDataType<mitk::DoubleProperty>(1.0, -1.0, "1", "-1", "double");
TestGenericPropertyForDataType<mitk::StringProperty>(std::string("eins"), std::string("zwei"), std::string("eins"), std::string("zwei"), "std::string");
{
mitk::Point3D p1;
p1[0] = 2.0;
p1[1] = 3.0;
p1[2] = 4.0;
mitk::Point3D p2;
p2[0] =-1.0;
p2[1] = 2.0;
p2[2] = 3.0;
TestGenericPropertyForDataType<mitk::Point3dProperty>( p1, p2, "[2, 3, 4]", "[-1, 2, 3]", "mitk::Point3D");
}
{
mitk::Point4D p1;
p1[0] = 2.0;
p1[1] = 3.0;
p1[2] = 4.0;
p1[3] =-2.0;
mitk::Point4D p2;
p2[0] =-1.0;
p2[1] = 2.0;
p2[2] = 3.0;
p2[3] = 5.0;
TestGenericPropertyForDataType<mitk::Point4dProperty>( p1, p2, "[2, 3, 4, -2]", "[-1, 2, 3, 5]", "mitk::Point4D");
}
/* THIS won't compile because of the interface of XMLWriter... that should be reworked perhaps
{
mitk::Vector2D p1; p1[0] = 2.0; p1[1] = 3.0;
mitk::Vector2D p2; p2[0] =-1.0; p2[1] = 2.0;
TestGenericPropertyForDataType<mitk::Vector2D>( p1, p2, "[2, 3]", "[-1, 2]", "mitk::Vector2D");
}
*/
{
mitk::Vector3D p1;
p1[0] = 2.0;
p1[1] = 3.0;
p1[2] = 4.0;
mitk::Vector3D p2;
p2[0] =-1.0;
p2[1] = 2.0;
p2[2] = 3.0;
TestGenericPropertyForDataType<mitk::Vector3DProperty>( p1, p2, "[2, 3, 4]", "[-1, 2, 3]", "mitk::Vector3D");
}
MITK_TEST_END();
}
示例15: mitkImageVtkMapper2DLevelWindowTest
int mitkImageVtkMapper2DLevelWindowTest(int argc, char* argv[])
{
// load all arguments into a datastorage, take last argument as reference rendering
// setup a renderwindow of fixed size X*Y
// render the datastorage
// compare rendering to reference image
MITK_TEST_BEGIN("mitkImageVtkMapper2DTest")
mitk::RenderingTestHelper renderingHelper(640, 480, argc, argv);
//chose a level window: here we randomly chosen the blood preset.
mitk::LevelWindowPreset* levelWindowPreset = mitk::LevelWindowPreset::New();
bool loadedPreset = levelWindowPreset->LoadPreset();
MITK_TEST_CONDITION_REQUIRED(loadedPreset == true, "Testing if level window preset could be loaded");
double level = levelWindowPreset->getLevel("Blood");
double window = levelWindowPreset->getWindow("Blood");
//apply level window to all images
renderingHelper.SetImageProperty("levelwindow", mitk::LevelWindowProperty::New(mitk::LevelWindow(level, window)) );
//for now this test renders Sagittal
renderingHelper.SetViewDirection(mitk::SliceNavigationController::Sagittal);
//### Usage of CompareRenderWindowAgainstReference: See docu of mitkRrenderingTestHelper
MITK_TEST_CONDITION( renderingHelper.CompareRenderWindowAgainstReference(argc, argv) == true, "CompareRenderWindowAgainstReference test result positive?" );
//use this to generate a reference screenshot or save the file:
if(false)
{
renderingHelper.SaveReferenceScreenShot("/media/hdd/thomasHdd/Pictures/tmp/output1.png");
}
MITK_TEST_END();
}