Beispiel #1
0
int mitkImageVtkMapper2DColorTest(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")

  mitkRenderingTestHelper renderingHelper(640, 480, argc, argv);
  //Set the opacity for all images
  renderingHelper.SetImageProperty("color", mitk::ColorProperty::New(0.0f, 0.0f, 255.0f));
  //for now this test renders in sagittal view direction
  renderingHelper.SetViewDirection(mitk::SliceNavigationController::Sagittal);

  //####################
  //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");
  }
  //####################

  //### Usage of CompareRenderWindowAgainstReference: See docu of mitkRrenderingTestHelper
  MITK_TEST_CONDITION( renderingHelper.CompareRenderWindowAgainstReference(argc, argv) == true, "CompareRenderWindowAgainstReference test result positive?" );

  MITK_TEST_END();
}
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();
}
/**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();
}
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();
}
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();
}
/**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();
}
/**
* 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();
}
/**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();
}
/**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();
}
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();
}
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();
}
/**
 * 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();
} 
Beispiel #13
0
/**Documentation
 *  test for the class "ToFProcessingCommon".
 */
int mitkToFProcessingCommonTest(int /* argc */, char* /*argv*/[])
{
  MITK_TEST_BEGIN("ToFProcessingCommon");

  unsigned int i = 10;
  unsigned int j = 50;
  mitk::ScalarType distance = 1000;
  mitk::ScalarType focalLength = 10;
  mitk::Point2D interPixelDistance;
  interPixelDistance[0] = 0.05;
  interPixelDistance[1] = 0.05;
  mitk::Point2D principalPoint;
  principalPoint[0] = 100;
  principalPoint[1] = 100;
  // expected coordinate
  mitk::ToFProcessingCommon::ToFPoint3D expectedCoordinate;
  expectedCoordinate[0] = -400.0988;
  expectedCoordinate[1] = -222.2771;
  expectedCoordinate[2] =  889.1084;
  // resulting coordinate
  mitk::ToFProcessingCommon::ToFPoint3D resultingCoordinate = mitk::ToFProcessingCommon::IndexToCartesianCoordinates(i,j,distance,focalLength,interPixelDistance,principalPoint);
  MITK_TEST_CONDITION_REQUIRED(mitk::Equal(expectedCoordinate,resultingCoordinate),"Testing IndexToCartesianCoordinates()");
  // expected index
  mitk::ToFProcessingCommon::ToFPoint3D expectedIndex;
  expectedIndex[0] = i;
  expectedIndex[1] = j;
  expectedIndex[2] = 1000;
  mitk::ToFProcessingCommon::ToFPoint3D resultingIndex = mitk::ToFProcessingCommon::CartesianToIndexCoordinates(expectedCoordinate,focalLength,interPixelDistance,principalPoint);
  MITK_TEST_CONDITION_REQUIRED(mitk::Equal(expectedIndex,resultingIndex),"Testing CartesianToIndexCoordinates()");

  MITK_TEST_END();

}
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();
}
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();
}
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();
}
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();
}
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();
}
/**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();
}
/**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();
}
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();
}
Beispiel #22
0
/**
* This function is testing methods of the class USImage2D.
*/
int mitkUSImageTest(int /* argc */, char* /*argv*/[])
{
  MITK_TEST_BEGIN("mitkUSImage2DTest");

    mitkUSImageTestClass::TestInstantiation();
    mitkUSImageTestClass::TestMetadataInProperties();

  MITK_TEST_END();
}
int mitkMultiComponentImageDataComparisonFilterTest(int /*argc*/, char *argv[])
{
  MITK_TEST_BEGIN("MultiComponentImageDataComparisonFilter");

  // instantiation
  mitk::MultiComponentImageDataComparisonFilter::Pointer testObject =
    mitk::MultiComponentImageDataComparisonFilter::New();
  MITK_TEST_CONDITION_REQUIRED(testObject.IsNotNull(), "Testing instantiation of test class!");

  MITK_TEST_CONDITION_REQUIRED(testObject->GetCompareFilterResult() == nullptr, "Testing initialization of result struct");
  MITK_TEST_CONDITION_REQUIRED(testObject->GetTolerance() == 0.0f, "Testing initialization of tolerance member");
  MITK_TEST_CONDITION_REQUIRED(testObject->GetResult() == false, "Testing initialization of CompareResult member");

  // initialize compare result struct and pass it to the filter
  mitk::CompareFilterResults compareResult;
  compareResult.m_MaximumDifference = 0.0f;
  compareResult.m_MinimumDifference = itk::NumericTraits<double>::max();
  compareResult.m_MeanDifference = 0.0f;
  compareResult.m_FilterCompleted = false;
  compareResult.m_TotalDifference = 0.0f;
  compareResult.m_PixelsWithDifference = 0;
  testObject->SetCompareFilterResult(&compareResult);

  MITK_TEST_CONDITION_REQUIRED(testObject->GetCompareFilterResult() != nullptr,
                               "Testing set/get of compare result struct");
  MITK_TEST_CONDITION_REQUIRED(testObject->GetResult() == false, "CompareResult still false");

  // now load an image with several components and present it to the filter
  mitk::Image::Pointer testImg = dynamic_cast<mitk::Image*>(mitk::IOUtil::Load(argv[1])[0].GetPointer());
  mitk::Image::Pointer testImg2 = testImg->Clone();

  testObject->SetValidImage(testImg);
  testObject->SetTestImage(testImg2);

  MITK_TEST_CONDITION_REQUIRED(testObject->GetNumberOfIndexedInputs() == 2, "Testing correct handling of input images");

  testObject->Update();

  MITK_TEST_CONDITION_REQUIRED(testObject->GetResult(), "Testing filter processing with equal image data");

  // now change some of the data and check if the response is correct
  mitk::ImageReadAccessor imgAcc(testImg2);
  unsigned char *imgData = (unsigned char *)imgAcc.GetData();
  imgData[10] += 1;
  imgData[20] += 2;
  imgData[30] += 3;

  testObject->Update();

  MITK_TEST_CONDITION_REQUIRED(testObject->GetResult() == false, "Testing filter processing with unequal image data");
  MITK_TEST_CONDITION_REQUIRED(
    mitk::Equal((int)testObject->GetCompareFilterResult()->m_PixelsWithDifference, (int)3) &&
      mitk::Equal((double)testObject->GetCompareFilterResult()->m_MaximumDifference, (double)3.0) &&
      mitk::Equal((double)testObject->GetCompareFilterResult()->m_MeanDifference, (double)2.0),
    "Assessing calculated image differences");
  MITK_TEST_END();
}
/**Documentation
 *  test for the class "mitkThreadedToFRawDataReconstruction".
 */
int mitkThreadedToFRawDataReconstructionTest(int /* argc */, char* /*argv*/[])
{
  MITK_TEST_BEGIN("mitkThreadedToFRawDataReconstruction");
  mitk::ThreadedToFRawDataReconstruction::Pointer testObject = mitk::ThreadedToFRawDataReconstruction::New();

  MITK_TEST_CONDITION_REQUIRED(testObject.GetPointer(), "Testing initializing of class");
  MITK_TEST_CONDITION_REQUIRED(!testObject->GetInit(), "Testing initial state of GetInit()");
  int width = 176;
  int height = 144;
  int modfreq = 20;
  int sdsize  = width*height*8*sizeof(short);
  testObject->Initialize(width, height, modfreq, sdsize );
  MITK_TEST_CONDITION_REQUIRED(testObject->GetInit(), "Testing state of GetInit() after initialization");

  // generate artificial data
  short* shortSource = new short[sdsize];
  vtkShortArray* channelData = vtkShortArray::New();

  for(long i = 0; i < sdsize; ++i)
  {
    shortSource[i] = i+1;
  }

  // use the helper object to set required variables
  RawDataDeviceHelperImpl::Pointer testHelper = RawDataDeviceHelperImpl::New();
  testHelper->SetCaptureWidth(width);
  testHelper->SetCaptureHeight(height);
  testHelper->GetChannelSourceData(shortSource, channelData);
  testObject->SetChannelData( channelData );
  testObject->Update();

  float* distances = new float[width*height];
  float* amplitudes = new float[width*height];
  float* intensties = new float[width*height];

  // set random value and check if it has changed after filter update
  distances[50] = -111;
  amplitudes[50] = -111;
  intensties[50] = -111;
  float before = distances[50];

  testObject->GetDistances(distances);
  testObject->GetAmplitudes(amplitudes);
  testObject->GetIntensities(intensties);
  MITK_TEST_CONDITION_REQUIRED(before != distances[50], "Testing distance data generation and output");
  MITK_TEST_CONDITION_REQUIRED(before != amplitudes[50], "Testing ampltude data generation and output");
  MITK_TEST_CONDITION_REQUIRED(before != intensties[50], "Testing intensity data generation and output");

  // clean up the mess
  delete[] distances;
  delete[] amplitudes;
  delete[] intensties;
  delete[] shortSource;
  channelData->Delete();
  MITK_TEST_END();
}
Beispiel #25
0
/**
 * mitkPlanarArrowTest tests the methods and behavior of mitk::PlanarArrow with sub-tests:
 *
 * 1. Instantiation and basic tests
 *
 */
int mitkPlanarArrowTest(int /* argc */, char* /*argv*/[])
{
  // always start with this!
  MITK_TEST_BEGIN("PlanarArrow")

  // create PlaneGeometry on which to place the PlanarArrow
  mitk::PlaneGeometry::Pointer planeGeometry = mitk::PlaneGeometry::New();
  planeGeometry->InitializeStandardPlane( 100.0, 100.0 );

  // **************************************************************************
  // 1. Instantiation and basic tests
  mitk::PlanarArrow::Pointer PlanarArrow = mitk::PlanarArrow::New();
  PlanarArrow->SetPlaneGeometry( planeGeometry );

  // first test: did this work?
  MITK_TEST_CONDITION_REQUIRED( PlanarArrow.IsNotNull(), "Testing instantiation" );

  // Test placement of PlanarArrow by control points
  mitkPlanarArrowTestClass::TestPlanarArrowPlacement( PlanarArrow );
  PlanarArrow->EvaluateFeatures();

  mitk::PlanarArrow::Pointer clonedArrow = PlanarArrow->Clone();
  MITK_TEST_CONDITION_REQUIRED( clonedArrow.IsNotNull(), "Testing cloning" );
  bool identical( true );
  identical &= clonedArrow->GetMinimumNumberOfControlPoints() == PlanarArrow->GetMinimumNumberOfControlPoints();
  identical &= clonedArrow->GetMaximumNumberOfControlPoints() == PlanarArrow->GetMaximumNumberOfControlPoints();
  identical &= clonedArrow->IsClosed() == PlanarArrow->IsClosed();
  identical &= clonedArrow->IsPlaced() == PlanarArrow->IsPlaced();
  identical &= clonedArrow->GetNumberOfControlPoints() == PlanarArrow->GetNumberOfControlPoints();
  identical &= clonedArrow->GetNumberOfControlPoints() == PlanarArrow->GetNumberOfControlPoints();
  identical &= clonedArrow->GetSelectedControlPoint() == PlanarArrow->GetSelectedControlPoint();
  identical &= clonedArrow->IsPreviewControlPointVisible() == PlanarArrow->IsPreviewControlPointVisible();
  identical &= clonedArrow->GetPolyLinesSize() == PlanarArrow->GetPolyLinesSize();
  identical &= clonedArrow->GetHelperPolyLinesSize() == PlanarArrow->GetHelperPolyLinesSize();
  identical &= clonedArrow->ResetOnPointSelect() == PlanarArrow->ResetOnPointSelect();

  for ( unsigned int i=0; i<clonedArrow->GetNumberOfControlPoints(); ++i )
  {
    identical &= clonedArrow->GetControlPoint(i) == PlanarArrow->GetControlPoint(i);
  }

  for ( unsigned int i=0; i<clonedArrow->GetPolyLinesSize(); ++i )
  {
    mitk::PlanarFigure::PolyLineType polyLine = clonedArrow->GetPolyLine( i );
    for ( unsigned int j=0; j<polyLine.size(); ++j )
    {
      identical &= polyLine.at(j) == PlanarArrow->GetPolyLine(i).at(j);
    }
  }


  MITK_TEST_CONDITION_REQUIRED( identical, "Cloning completely successful" );

  // always end with this!
  MITK_TEST_END();
}
Beispiel #26
0
/**Documentation
 *  test for the class "ImageToOpenCVImageFilter".
 */
int mitkImageToOpenCVImageFilterTest(int argc, char* argv[])
{
  MITK_TEST_BEGIN("ImageToOpenCVImageFilter")

  testGeneratedImage();
  testLoadedImage(argv[1]);
  // always end with this!
  MITK_TEST_END();

}
Beispiel #27
0
/**
* This function is testing methods of the class USDevice.
*/
int mitkUSDeviceTest(int /* argc */, char* /*argv*/[])
{
  MITK_TEST_BEGIN("mitkUSDeviceTest");

  mitkUSDeviceTestClass::TestInstantiation();
  mitkUSDeviceTestClass::TestAddProbe();
  mitkUSDeviceTestClass::TestActivateProbe();

  MITK_TEST_END();
}
int mitkNavigationDataToIGTLMessageFilterTest(int /* argc */, char* /*argv*/[])
{
  MITK_TEST_BEGIN("NavigationDataToIGTLMessageFilter");
  //COMP: Deactivated these tests because they dont work atm..
  //NavigationDataToIGTLMessageFilterContructor_DefaultCall_IsNotEmpty();
  //TestModeQTransMsg();
  //TestModeTransMsg();

  MITK_TEST_END();
}
/**Documentation
 *  test for the class "ToFCameraPMDRawDataCamCubeDevice".
 */
int mitkToFCameraPMDRawDataCamCubeDeviceTest(int /* argc */, char* /*argv*/[])
{
  MITK_TEST_BEGIN("ToFCameraPMDRawDataCamCubeDevice");

  mitk::ToFCameraPMDRawDataCamCubeDevice::Pointer rawDataCamCubeDevice = mitk::ToFCameraPMDRawDataCamCubeDevice::New();
  //try if hardware is connected
  try
  {
  // No hardware attached for automatic testing -> test correct error handling
  MITK_TEST_CONDITION_REQUIRED(rawDataCamCubeDevice->ConnectCamera(), "Test ConnectCamera()");
  MITK_TEST_CONDITION_REQUIRED(!rawDataCamCubeDevice->IsCameraActive(), "Test IsCameraActive() before StartCamera()");
  MITK_TEST_OUTPUT(<<"Call StartCamera()");
  rawDataCamCubeDevice->StartCamera();
  MITK_TEST_CONDITION_REQUIRED(rawDataCamCubeDevice->IsCameraActive(), "Test IsCameraActive() after StartCamera()");
  MITK_TEST_OUTPUT(<<"Call UpdateCamera()");
  rawDataCamCubeDevice->UpdateCamera();
  int numberOfPixels = rawDataCamCubeDevice->GetCaptureWidth()*rawDataCamCubeDevice->GetCaptureHeight();
  MITK_INFO<<numberOfPixels;
  float* distances = new float[numberOfPixels];
  float* amplitudes = new float[numberOfPixels];
  float* intensities = new float[numberOfPixels];
  char* sourceData = new char[numberOfPixels];
  short* shortSource = new short[numberOfPixels];
  int requiredImageSequence = 0;
  int imageSequence = 0;
  vtkSmartPointer<vtkShortArray> vtkArray = vtkSmartPointer<vtkShortArray>::New();
  rawDataCamCubeDevice->GetChannelSourceData(shortSource, vtkArray);
  MITK_TEST_CONDITION_REQUIRED(rawDataCamCubeDevice->GetChannelSize()!=0, "Test if channelsize is set!");
  MITK_TEST_CONDITION_REQUIRED(vtkArray->GetNumberOfTuples()== 4, "Check channel data processing!");
  vtkArray->Delete();

  rawDataCamCubeDevice->GetDistances(distances,imageSequence);
  rawDataCamCubeDevice->GetAmplitudes(amplitudes,imageSequence);
  rawDataCamCubeDevice->GetIntensities(intensities,imageSequence);
  rawDataCamCubeDevice->GetAllImages(distances,amplitudes,intensities,sourceData,requiredImageSequence,imageSequence);
  MITK_TEST_CONDITION_REQUIRED(rawDataCamCubeDevice->IsCameraActive(), "Test IsCameraActive() before StopCamera()");
  MITK_TEST_OUTPUT(<<"Call StopCamera()");
  rawDataCamCubeDevice->StopCamera();
  MITK_TEST_CONDITION_REQUIRED(!rawDataCamCubeDevice->IsCameraActive(), "Test IsCameraActive() after StopCamera()");

  MITK_TEST_CONDITION_REQUIRED(rawDataCamCubeDevice->DisconnectCamera(), "Test DisonnectCamera()");
  delete[] distances;
  delete[] amplitudes;
  delete[] intensities;
  delete[] sourceData;
  delete[] shortSource;
  }
  catch(std::exception &e)
  {
      MITK_INFO << e.what();
      MITK_TEST_CONDITION_REQUIRED(rawDataCamCubeDevice->IsCameraActive()==false, "Testing that no connection could be established.");
  }

  MITK_TEST_END();
}
int mitkPointSetFileIOTest(int, char*[])
{
    MITK_TEST_BEGIN("PointSet");

    // minimum test w/ identity geometry
    {
        mitkPointSetFileIOTestClass test;
        MITK_TEST_CONDITION(test.PointSetWrite(), "Testing if the PointSetWriter writes Data" );
        test.PointSetLoadAndCompareTest(); // load - compare
    }

    // case with a more complex geometry
    {
        mitkPointSetFileIOTestClass test;

        mitk::Geometry3D::Pointer g = mitk::Geometry3D::New();

        // define arbitrary transformation matrix
        // the number don't have much meaning - we just want them reproduced
        // by the writer/reader cycle
        mitk::BaseGeometry::BoundsArrayType bounds;
        bounds[0] = -918273645.18293746;
        bounds[1] = -52.723;
        bounds[2] = -1.002;
        bounds[3] = 918273645.18293746;
        bounds[4] = +1.002;
        bounds[5] = +52.723;
        g->SetBounds(bounds);

        mitk::ScalarType matrixCoeffs[9] = {
            0.0, 1.1, 2.2,
            3.3, 4.4, 5.5,
            6.6, 7.7, 8.8
        };

        mitk::AffineTransform3D::MatrixType matrix;
        matrix.GetVnlMatrix().set(matrixCoeffs);

        mitk::AffineTransform3D::OffsetType offset;
        offset[0] = -43.1829374;
        offset[1] = 0.0;
        offset[2] = +43.1829374;

        mitk::AffineTransform3D::Pointer transform = mitk::AffineTransform3D::New();
        transform->SetMatrix(matrix);
        transform->SetOffset(offset);
        g->SetIndexToWorldTransform(transform);

        MITK_TEST_CONDITION( test.PointSetWrite(g), "Testing if the PointSetWriter writes Data _with_ geometry" );
        test.PointSetLoadAndCompareTest(); // load - compare
    }


    MITK_TEST_END();
}