コード例 #1
0
static void TestRead()
{
  mitk::NavigationToolReader::Pointer myReader = mitk::NavigationToolReader::New();
  mitk::NavigationTool::Pointer readTool = myReader->DoRead("TestTool.tool");
  MITK_TEST_OUTPUT(<<"---- Testing navigation tool reader with first test tool (claron tool) ----");

  //Test if the surfaces do have the same number of vertexes (it would be better to test for real equality of the surfaces!)
  MITK_TEST_CONDITION_REQUIRED(dynamic_cast<mitk::Surface*>(readTool->GetDataNode()->GetData())->GetSizeOfPolyDataSeries()==m_testSurface->GetSizeOfPolyDataSeries(),"Test if surface was restored correctly ...");

  MITK_TEST_CONDITION_REQUIRED(readTool->GetType()==mitk::NavigationTool::Fiducial,"Testing Tool Type");

  MITK_TEST_CONDITION_REQUIRED(readTool->GetTrackingDeviceType()==mitk::ClaronMicron,"Testing Tracking Device Type");

  MITK_TEST_CONDITION_REQUIRED(readTool->GetSerialNumber()=="0815","Testing Serial Number");

  std::ifstream TestFile(readTool->GetCalibrationFile().c_str());
  MITK_TEST_CONDITION_REQUIRED(TestFile,"Testing If Calibration File Exists");

}
コード例 #2
0
static void TestRead2()
{
  mitk::NavigationToolReader::Pointer myReader = mitk::NavigationToolReader::New();
  mitk::NavigationTool::Pointer readTool = myReader->DoRead("TestTool2.tool");
  MITK_TEST_OUTPUT(<<"---- Testing navigation tool reader  with second tool (aurora tool) ----");

  //Test if the surfaces do have the same number of vertexes (it would be better to test for real equality of the surfaces!)
  MITK_TEST_CONDITION_REQUIRED(dynamic_cast<mitk::Surface*>(readTool->GetDataNode()->GetData())->GetSizeOfPolyDataSeries()==m_testSurface->GetSizeOfPolyDataSeries(),"Test if surface was restored correctly ...");

  //Test if the tool type is the same
  MITK_TEST_CONDITION_REQUIRED(readTool->GetType()==mitk::NavigationTool::Instrument,"Testing Tool Type");

  MITK_TEST_CONDITION_REQUIRED(readTool->GetTrackingDeviceType()==mitk::NDIAurora,"Testing Tracking Device Type");

  MITK_TEST_CONDITION_REQUIRED(readTool->GetSerialNumber()=="0816","Testing Serial Number");

  MITK_TEST_CONDITION_REQUIRED(readTool->GetCalibrationFile()=="none","Testing Calibration File");

}