• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MITK_TEST_BEGIN函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MITK_TEST_BEGIN函数的典型用法代码示例。如果您正苦于以下问题:C++ MITK_TEST_BEGIN函数的具体用法?C++ MITK_TEST_BEGIN怎么用?C++ MITK_TEST_BEGIN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了MITK_TEST_BEGIN函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: 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();
}
开发者ID:Maggunator,项目名称:MITK,代码行数:35,代码来源:mitkFiberTransformationTest.cpp


示例2: mitkACVDTest

int mitkACVDTest(int argc, char* argv[])
{
  if (argc != 10)
  {
    MITK_ERROR << "Invalid argument count!\n"
               << "Usage: mitkACVDTest <filename> <t> <numVertices> <gradation> <subsampling>\n"
               << "                    <edgeSplitting> <optimizationLevel> <forceManifiold>\n"
               << "                    <boundaryFixing>\n"
               << "  See MITK API documentation of mitk::ACVD::Remesh() for details.";

    return EXIT_FAILURE;
  }

  const std::string filename = argv[1];
  const unsigned int t = lexical_cast<unsigned int>(argv[2]);
  const int numVertices = lexical_cast<int>(argv[3]);
  const double gradation = lexical_cast<double>(argv[4]);
  const int subsampling = lexical_cast<int>(argv[5]);
  const double edgeSplitting = lexical_cast<double>(argv[6]);
  const int optimizationLevel = lexical_cast<int>(argv[7]);
  const bool forceManifold = lexical_cast<bool>(argv[8]);
  const bool boundaryFixing = lexical_cast<bool>(argv[9]);

  MITK_TEST_BEGIN("mitkACVDTest")

    Remesh_SurfaceIsNull_ThrowsException();
    Remesh_PolyDataIsNull_ThrowsException();
    Remesh_SurfaceDoesNotHaveDataAtTimeStep_ThrowsException();
    Remesh_SurfaceHasNoPolygons_ThrowsException();

    Remesh_SurfaceIsValid_ReturnsRemeshedSurface(filename, t, numVertices, gradation, subsampling, edgeSplitting, optimizationLevel, forceManifold, boundaryFixing);

  MITK_TEST_END()
}
开发者ID:GHfangxin,项目名称:MITK,代码行数:34,代码来源:mitkACVDTest.cpp


示例3: 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();
}
开发者ID:0r,项目名称:MITK,代码行数:32,代码来源:mitkPropertyDescriptionsTest.cpp


示例4: 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();
}
开发者ID:junaidnaseer,项目名称:MITK,代码行数:27,代码来源:mitkSurfaceDepthSortingTest.cpp


示例5: 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();
}
开发者ID:test-fd301,项目名称:MITK,代码行数:60,代码来源:mitkGenericPropertyTest.cpp


示例6: mitkFactoryRegistrationTest

/**Documentation
 *  Test for factory registration
 */
int mitkFactoryRegistrationTest(int /* argc */, char* /*argv*/[])
{
  // always start with this!
  MITK_TEST_BEGIN("FactoryRegistrationTest");

  MITK_INFO << "Starting Factory registration test.";
  MITK_INFO << "Factory has been registered.";

  bool canWrite = false;
  mitk::DiffusionImage<short>::Pointer img = mitk::DiffusionImage<short>::New();
  mitk::CoreObjectFactory::FileWriterList fileWriters = mitk::CoreObjectFactory::GetInstance()->GetFileWriters();
  MITK_INFO << "Looking for diffusion image writer.";
  for (mitk::CoreObjectFactory::FileWriterList::iterator it = fileWriters.begin() ; it != fileWriters.end() ; ++it)
  {
    if ( (*it)->CanWriteBaseDataType(img.GetPointer()) )
    {
      MITK_INFO << "Found diffusion image writer.";
      canWrite = true;
      break;
    }
  }

  MITK_TEST_CONDITION_REQUIRED(canWrite,"Testing factory registration");

  // always end with this!
  MITK_TEST_END();
}
开发者ID:GHfangxin,项目名称:MITK,代码行数:30,代码来源:mitkFactoryRegistrationTest.cpp


示例7: 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();
}
开发者ID:0r,项目名称:MITK,代码行数:25,代码来源:mitkPointSetVtkMapper2DImageTest.cpp


示例8: 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();
}
开发者ID:heartvalve,项目名称:MITK,代码行数:34,代码来源:mitkNavigationDataTest.cpp


示例9: 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();
}
开发者ID:151706061,项目名称:MITK,代码行数:63,代码来源:mitkToFImageWriterTest.cpp


示例10: 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();
}
开发者ID:151706061,项目名称:MITK,代码行数:37,代码来源:mitkToFCameraPMDCamCubeControllerTest.cpp


示例11: 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();
}
开发者ID:151706061,项目名称:MITK,代码行数:35,代码来源:mitkTextOverlay2DRenderingTest.cpp


示例12: 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();
}
开发者ID:AGrafmint,项目名称:MITK,代码行数:26,代码来源:mitkSurfaceGLMapper2DOpacityTest.cpp


示例13: mitkImageVtkMapper2DOpacityTest

int mitkImageVtkMapper2DOpacityTest(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);
  //Set the opacity for all images
  renderingHelper.SetImageProperty("opacity", mitk::FloatProperty::New(0.5f));
  //for now this test renders in coronal view direction
  renderingHelper.SetViewDirection(mitk::SliceNavigationController::Frontal);

  //### 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("d:/tmp/renderingtest.png");
  }

  MITK_TEST_END();
}
开发者ID:0r,项目名称:MITK,代码行数:25,代码来源:mitkImageVtkMapper2DOpacityTest.cpp


示例14: 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();
}
开发者ID:Maggunator,项目名称:MITK,代码行数:30,代码来源:mitkNDIProtocolTest.cpp


示例15: 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();
}
开发者ID:Cdebus,项目名称:MITK,代码行数:34,代码来源:mitkSceneIOCompatibilityTest.cpp


示例16: 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();
}
开发者ID:pollen-metrology,项目名称:MITK,代码行数:33,代码来源:mitkPropertyExtensionsTest.cpp


示例17: 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();
}
开发者ID:GHfangxin,项目名称:MITK,代码行数:31,代码来源:mitkImageVtkMapper2DLevelWindowTest.cpp


示例18: 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();
} 
开发者ID:test-fd301,项目名称:MITK,代码行数:31,代码来源:mitkPlanarPolygonTest.cpp


示例19: mitkPlanarFigureObjectFactoryTest

/**Documentation
 *  Test for factory registration
 */
int mitkPlanarFigureObjectFactoryTest(int /* argc */, char* /*argv*/[])
{
  // always start with this!
  MITK_TEST_BEGIN("PlanarFigureObjectFactoryTest");

  // always end with this!
  MITK_TEST_END();
}
开发者ID:david-guerrero,项目名称:MITK,代码行数:11,代码来源:mitkPlanarFigureObjectFactoryTest.cpp


示例20: mitkLabelOverlay3DRendering2DTest

int mitkLabelOverlay3DRendering2DTest(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("mitkLabelOverlay3DRendering2DTest")

  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);

  mitk::PointSet::Pointer pointset = mitk::PointSet::New();
  mitk::LabelOverlay3D::Pointer label3d = mitk::LabelOverlay3D::New();
  mitk::Point3D offset;
  offset[0] = .5;
  offset[1] = .5;
  offset[2] = .5;

  std::vector<std::string> labels;
  int idx = 0;
  for(int i=-10 ; i < 10 ; i+=4){
    for(int j=-10 ; j < 10 ; j+=4){
      mitk::Point3D point;
      point[0] = i;
      point[1] = j;
      point[2] = (i*j)/10;
      pointset->InsertPoint(idx++, point);
      labels.push_back("test");
    }
  }

  label3d->SetLabelCoordinates(pointset);
  label3d->SetLabelVector(labels);
  label3d->SetOffsetVector(offset);
  OverlayManager->AddOverlay(label3d.GetPointer());

  mitk::DataNode::Pointer datanode = mitk::DataNode::New();
  datanode->SetData(pointset);
  datanode->SetName("pointSet");
  renderingHelper.AddNodeToStorage(datanode);
  renderingHelper.Render();

  //### 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:
  bool generateReferenceScreenshot = false;
  if(generateReferenceScreenshot)
  {
    renderingHelper.SaveReferenceScreenShot("/home/christoph/Pictures/RenderingTestData/mitkLabelOverlay3DRendering2DTest.png");
  }

  MITK_TEST_END();
}
开发者ID:AGrafmint,项目名称:MITK,代码行数:58,代码来源:mitkLabelOverlay3DRendering2DTest.cpp



注:本文中的MITK_TEST_BEGIN函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MITK_TEST_END函数代码示例发布时间:2022-05-30
下一篇:
C++ MIRSRC函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap